コード例 #1
0
        private static TabObject BuildWebServerDetails(EnvironmentWebServerModel model)
        {
            var section = new TabObject();

            section.AddRow().Key("Type").Value(model.ServerType);
            section.AddRow().Key("Integrated Pipeline").Value(model.IntegratedPipeline);
            return(section);
        }
コード例 #2
0
        private TabObject BuildProcessDetails(EnvironmentProcessModel model)
        {
            var section = new TabObject();

            section.AddRow().Key("Worker Process").Value(model.WorkerProcess);
            section.AddRow().Key("Process ID").Value(model.ProcessId);
            section.AddRow().Key("Start Time").Value(model.StartTime);
            return(section);
        }
コード例 #3
0
        private TabObject BuildMachineDetails(EnvironmentMachineModel model)
        {
            var section = new TabObject();

            section.AddRow().Key("Name").Value(model.Name);
            section.AddRow().Key("Operating System").Value(model.OperatingSystem);
            section.AddRow().Key("Start Time").Value(model.StartTime);
            return(section);
        }
コード例 #4
0
        private TabObject BuildTimeZoneDetails(EnvironmentTimeZoneModel model)
        {
            var section = new TabObject();

            section.AddRow().Key("Current").Value(model.Name);
            section.AddRow().Key("Is Daylight Saving").Value(model.IsDaylightSavingTime);
            section.AddRow().Key("UtcOffset").Value(model.UtcOffset);
            section.AddRow().Key("UtcOffset w/DLS").Value(model.UtcOffsetWithDls);
            return(section);
        }
コード例 #5
0
        private TabObject BuildFrameworkDetails(EnvironmentFrameworkModel model)
        {
            var section = new TabObject();

            section.AddRow().Key(".NET Framework").Value(model.DotnetFramework);
            section.AddRow().Key("Debugging").Value(model.Debugging);
            section.AddRow().Key("Server Culture").Value(model.ServerCulture);
            section.AddRow().Key("Current Trust Level").Value(model.CurrentTrustLevel);
            return(section);
        }
コード例 #6
0
 protected virtual void AddSectionDataToTab(List <TSectionModel> sectionModels, TabObject tab)
 {
     if (sectionModels != null && sectionModels.Count > 0)
     {
         tab.AddRow().Key(this.SectionName).Value(sectionModels);
     }
 }
コード例 #7
0
 protected override void AddSectionDataToTab(List <RawOutputSectionModel> sectionModels, TabObject tab)
 {
     if (sectionModels != null && sectionModels.Count > 0)
     {
         foreach (var model in sectionModels)
         {
             tab.AddRow().Key(model.SectionHeader).Value(model.SectionBody);
         }
     }
 }
コード例 #8
0
        private TabObject BuildPathFields(RequestModel request)
        {
            var root = new TabObject();

            root.AddRow().Key("App Relative Current Execution File Path").Value(request.AppRelativeCurrentExecutionFilePath);
            root.AddRow().Key("Application Path").Value(request.ApplicationPath);
            root.AddRow().Key("Current Execution File Path").Value(request.CurrentExecutionFilePath);
            root.AddRow().Key("File Path").Value(request.FilePath);
            root.AddRow().Key("Path").Value(request.Path);
            root.AddRow().Key("Path Info").Value(request.PathInfo);
            root.AddRow().Key("Physical Application Path").Value(request.PhysicalApplicationPath);
            root.AddRow().Key("Physical Path").Value(request.PhysicalPath);

            return(root);
        }
コード例 #9
0
        private object GetDetails(ViewsModel model)
        {
            if (!model.IsFound)
            { 
                if (model.UseCache)
                {
                    return "Not Found In Cache";
                }

                var searchedLocations = new TabSection("Not Found In");
                foreach (var searchedLocation in model.SearchedLocations)
                {
                    searchedLocations.AddRow().Column(searchedLocation);
                }  

                return searchedLocations;
            }

            var section = new TabObject();
            var summary = model.ViewModelSummary;

            if (summary == null)
            {
                return section;
            }

            if (summary.HasDisplayMode)
            {
                section.AddRow().Key("Display Mode").Value(summary.DisplayModeName);                
            }

            section.AddRow().Key("Model Type").Value(summary.ModelType);
            section.AddRow().Key("Model State Valid").Value(summary.IsValid);
            section.AddRow().Key("TempData Keys").Value(summary.TempDataKeys);
            section.AddRow().Key("ViewData Keys").Value(summary.ViewDataKeys);

            return section;
        }
コード例 #10
0
        public object BuildQueryString(IEnumerable <RequestModel.QueryStringParameter> parameters)
        {
            if (!parameters.Any())
            {
                return(null);
            }

            var result = new TabObject();

            foreach (var parameter in parameters)
            {
                result.AddRow().Key(parameter.Key ?? "null").Value(parameter.Value);
            }

            return(result);
        }
コード例 #11
0
        public override object Convert(ConfigurationModel obj)
        {
            var root = new TabObject();

            root.AddRow().Key("/configuration/appSettings").Value(obj.AppSettings);
            root.AddRow().Key("/configuration/connectionStrings").Value(BuildConnectionStringsDetails(obj.ConnectionStrings));
            root.AddRow().Key("/configuration/system.web/authentication").Value(obj.Authentication);
            root.AddRow().Key("/configuration/system.web/roleManager").Value(obj.RoleManager);
            root.AddRow().Key("/configuration/system.web/customErrors").Value(obj.CustomErrors);
            root.AddRow().Key("/configuration/system.web/httpModules").Value(BuildHttpModulesDetails(obj.HttpModules));
            root.AddRow().Key("/configuration/system.web/httpHandlers").Value(BuildHttpHandlersDetails(obj.HttpHandlers));

            return(root.Build());
        }
コード例 #12
0
        public override object Convert(EnvironmentModel obj)
        {
            var root = new TabObject();

            root.AddRow().Key("Machine").Value(BuildMachineDetails(obj.Machine));
            root.AddRow().Key("Web Server").Value(BuildWebServerDetails(obj.WebServer));
            root.AddRow().Key("Framework").Value(BuildFrameworkDetails(obj.Framework));
            root.AddRow().Key("Process").Value(BuildProcessDetails(obj.Process));
            root.AddRow().Key("Timezone").Value(BuildTimeZoneDetails(obj.TimeZone));
            root.AddRow().Key("Application Assemblies").Value(BuildAssemblyDetails(obj.ApplicationAssemblies));
            root.AddRow().Key("System Assemblies").Value(BuildAssemblyDetails(obj.SystemAssemblies));

            return(root.Build());
        }
コード例 #13
0
        private object ConvertMetadata(MetadataContentModel metadata)
        {
            if (metadata == null)
            {
                return(null);
            }

            var section = new TabObject();

            section.AddRow().Key("ConvertEmptyStringToNull").Value(metadata.ConvertEmptyStringToNull.Value).StrongIf(!metadata.ConvertEmptyStringToNull.IsDefault());
            section.AddRow().Key("DataTypeName").Value(metadata.DataTypeName.Value).StrongIf(!metadata.DataTypeName.IsDefault());
            section.AddRow().Key("Description").Value(metadata.Description.Value).StrongIf(!metadata.Description.IsDefault());
            section.AddRow().Key("DisplayFormatString").Value(metadata.DisplayFormatString.Value).StrongIf(!metadata.DisplayFormatString.IsDefault());
            section.AddRow().Key("DisplayName").Value(metadata.DisplayName.Value).StrongIf(!metadata.DisplayName.IsDefault());
            section.AddRow().Key("EditFormatString").Value(metadata.EditFormatString.Value).StrongIf(!metadata.EditFormatString.IsDefault());
            section.AddRow().Key("HideSurroundingHtml").Value(metadata.HideSurroundingHtml.Value).StrongIf(!metadata.HideSurroundingHtml.IsDefault());
            section.AddRow().Key("IsComplexType").Value(metadata.IsComplexType.Value).StrongIf(!metadata.IsComplexType.IsDefault());
            section.AddRow().Key("IsNullableValueType").Value(metadata.IsNullableValueType.Value).StrongIf(!metadata.IsNullableValueType.IsDefault());
            section.AddRow().Key("IsReadOnly").Value(metadata.IsReadOnly.Value).StrongIf(!metadata.IsReadOnly.IsDefault());
            section.AddRow().Key("IsRequired").Value(metadata.IsRequired.Value).StrongIf(!metadata.IsRequired.IsDefault());
            section.AddRow().Key("NullDisplayText").Value(metadata.NullDisplayText.Value).StrongIf(!metadata.NullDisplayText.IsDefault());
            section.AddRow().Key("Order").Value(metadata.Order.Value).StrongIf(!metadata.Order.IsDefault());
            section.AddRow().Key("ShortDisplayName").Value(metadata.ShortDisplayName.Value).StrongIf(!metadata.ShortDisplayName.IsDefault());
            section.AddRow().Key("ShowForDisplay").Value(metadata.ShowForDisplay.Value).StrongIf(!metadata.ShowForDisplay.IsDefault());
            section.AddRow().Key("ShowForEdit").Value(metadata.ShowForEdit.Value).StrongIf(!metadata.ShowForEdit.IsDefault());
            section.AddRow().Key("SimpleDisplayText").Value(metadata.SimpleDisplayText.Value).StrongIf(!metadata.SimpleDisplayText.IsDefault());
            section.AddRow().Key("TemplateHint").Value(metadata.TemplateHint.Value).StrongIf(!metadata.TemplateHint.IsDefault());
            section.AddRow().Key("Watermark").Value(metadata.Watermark.Value).StrongIf(!metadata.Watermark.IsDefault());

            return(section);
        }
コード例 #14
0
        /// <inheritdic cref="TabBase.GetData(ITabContext)" />
        public override object GetData(ITabContext context)
        {
            var commands = context.GetMessages <CommandTimelineMessage>().ToArray();

            if (!commands.Any())
            {
                return(null);
            }

            var ordinal          = 1;
            var duplicationKeys  = new HashSet <string>();
            var duplicationCount = 0;
            var queries          = new TabSection("Ordinal", "Database", "Command", "Parameters", "CommandType", "With Transaction", "Records", "IsError", "Duration", "Offset");

            foreach (var command in commands)
            {
                var parameters = new TabSection("Name", "Value", "DbType", "Direction");

                foreach (var parameter in command.Parameters)
                {
                    parameters.AddRow()
                    .Column(parameter.ParameterName)
                    .Column(parameter.Value)
                    .Column(parameter.DbType.ToString())
                    .Column(parameter.Direction.ToString());
                }

                var row = queries.AddRow()
                          .Column(ordinal)
                          .Column(command.Database)
                          .Column(command.CommandText)
                          .Column(command.Parameters.Any() ? parameters : null)
                          .Column(command.CommandType.ToString())
                          .Column(command.WithTransaction)
                          .Column(command.Records ?? 0)
                          .Column(command.IsError)
                          .Column(command.Duration)
                          .Column(command.Offset);

                var isDuplicated = !duplicationKeys.Add(command.CommandText);

                if (isDuplicated)
                {
                    row.WarnIf(true);
                    duplicationCount++;
                }

                ordinal++;
            }

            var sqlStatistics = new TabSection("Queries", "Duplication", "Total Query Duration");

            sqlStatistics.AddRow()
            .Column(commands.Length)
            .Column(duplicationCount)
            .Column(commands.Select(x => x.Duration).Aggregate((x, y) => x.Add(y)));

            var root = new TabObject();

            root.AddRow().Key("SQL Statistics").Value(sqlStatistics);
            root.AddRow().Key("Queries").Value(queries);

            return(root.Build());
        }
コード例 #15
0
        public override object Convert(RequestModel request)
        {
            var root = new TabObject();

            root.AddRow().Key("Cookies").Value(BuildCookies(request.Cookies));
            root.AddRow().Key("Current UI Culture").Value(request.CurrentUiCulture);
            root.AddRow().Key("Files").Value(BuildFiles(request.Files));
            root.AddRow().Key("Form Variables").Value(BuildFormVariables(request.FormVariables));
            root.AddRow().Key("Header Fields").Value(BuildHeaderFields(request.HeaderFields));
            root.AddRow().Key("Query String").Value(BuildQueryString(request.QueryString));
            root.AddRow().Key("Url").Value(request.Url.ToString());
            root.AddRow().Key("Url Referrer").Value(request.UrlReferrer.ToStringOrDefault());
            root.AddRow().Key("Raw Url").Value(request.RawUrl);
            root.AddRow().Key("Request Type").Value(request.RequestType);
            root.AddRow().Key("Url").Value(request.Url);
            root.AddRow().Key("Url Referrer").Value(request.UrlReferrer);
            root.AddRow().Key("User Agent").Value(request.UserAgent);
            root.AddRow().Key("User Host Address").Value(request.UserHostAddress);
            root.AddRow().Key("User Host Name").Value(request.UserHostName);

            root.AddRow().Key("Path").Value(BuildPathFields(request));

            return(root.Build());
        }
コード例 #16
0
        public override object Convert(RequestModel request)
        {
            var root = new TabObject();

            root.AddRow().Key("Cookies").Value(BuildCookies(request.Cookies));
            root.AddRow().Key("Query String").Value(BuildQueryString(request.QueryString));
            root.AddRow().Key("Url").Value(request.Url.ToString());
            root.AddRow().Key("Url Referrer").Value(request.UrlReferrer.ToStringOrDefault());
            root.AddRow().Key("App Relative Current Execution File Path").Value(request.AppRelativeCurrentExecutionFilePath);
            root.AddRow().Key("Application Path").Value(request.ApplicationPath);
            root.AddRow().Key("Current Execution File Path").Value(request.CurrentExecutionFilePath);
            root.AddRow().Key("Current UI Culture").Value(request.CurrentUiCulture);
            root.AddRow().Key("File Path").Value(request.FilePath);
            root.AddRow().Key("Path").Value(request.Path);
            root.AddRow().Key("Path Info").Value(request.PathInfo);
            root.AddRow().Key("Physical Application Path").Value(request.PhysicalApplicationPath);
            root.AddRow().Key("Physical Path").Value(request.PhysicalPath);
            root.AddRow().Key("Raw Url").Value(request.RawUrl);
            root.AddRow().Key("User Agent").Value(request.UserAgent);
            root.AddRow().Key("User Host Address").Value(request.UserHostAddress);
            root.AddRow().Key("User Host Name").Value(request.UserHostName);

            return(root.Build());
        }
コード例 #17
0
        /// <inheritdic cref="TabBase.GetData(ITabContext)" />
        public override object GetData(ITabContext context)
        {
            var connectionLifetimes  = context.GetMessages <ConnectionLifetimeTimelineMessage>().ToArray();
            var transactionLifetimes = context.GetMessages <TransactionLifetimeTimelineMessage>().ToArray();
            var transactionEvents    = context.GetMessages <TransactionEventTimelineMessage>().ToArray();
            var commands             = context.GetMessages <CommandTimelineMessage>().ToArray();

            var statisticsSection = new TabSection("Database", "Queries", "Total Transaction Duration");
            var eventSection      = new TabSection("Database", "Events", "Queries", "IsCommited", "Total Duration");

            // Statistics
            foreach (var transactionLifetime in transactionLifetimes.OrderBy(x => x.Offset).ToArray())
            {
                statisticsSection.AddRow()
                .Column(connectionLifetimes.First(x => x.ConnectionId == transactionLifetime.ConnectionId).Database)
                .Column(commands.Count(x => x.TransactionId.HasValue && x.TransactionId.Value == transactionLifetime.TransactionId))
                .Column(transactionLifetime.Duration);
            }

            // Events
            foreach (var transactionLifetime in transactionLifetimes.OrderBy(x => x.Offset).ToArray())
            {
                var queries = commands
                              .Where(x => x.TransactionId.HasValue && x.TransactionId.Value == transactionLifetime.TransactionId)
                              .ToArray();

                var events = transactionEvents
                             .Where(x => x.TransactionId == transactionLifetime.TransactionId)
                             .Select(x => new
                {
                    EventType = "Transaction",
                    EventName = x.TransactionEvent.ToString(),
                    Duration  = x.Duration,
                    Offset    = x.Offset
                })
                             .Concat(queries
                                     .Select(x => new
                {
                    EventType = "Command",
                    EventName = x.CommandText,
                    Duration  = x.Duration,
                    Offset    = x.Offset
                })
                                     )
                             .OrderBy(x => x.Offset)
                             .ToArray();

                var eventDetailSection = new TabSection("EventType", "EventName", "Duration", "Offset");
                var duplicatedKeys     = new HashSet <string>();

                foreach (var @event in events)
                {
                    var row = eventDetailSection.AddRow()
                              .Column(@event.EventType)
                              .Column(@event.EventName)
                              .Column(@event.Duration)
                              .Column(@event.Offset);

                    if (@event.EventType == "Command")
                    {
                        row.WarnIf(!duplicatedKeys.Add(@event.EventName));
                    }
                }

                eventSection.AddRow()
                .Column(transactionLifetime.Database)
                .Column(eventDetailSection)
                .Column(commands.Length)
                .Column(transactionLifetime.IsCommited)
                .Column(transactionLifetime.Duration);
            }

            var root = new TabObject();

            root.AddRow().Key("Transaction Statistics").Value(statisticsSection);
            root.AddRow().Key("Transaction Events").Value(eventSection);

            return(root.Build());
        }