diff --git a/AppDynamics.Dexter.Core.csproj b/AppDynamics.Dexter.Core.csproj
index e944b62..2bb9c76 100644
--- a/AppDynamics.Dexter.Core.csproj
+++ b/AppDynamics.Dexter.Core.csproj
@@ -59,6 +59,9 @@
Always
+
+ Always
+
Always
diff --git a/AppDynamics.Dexter.csproj b/AppDynamics.Dexter.csproj
index 04c29ff..38b9b23 100644
--- a/AppDynamics.Dexter.csproj
+++ b/AppDynamics.Dexter.csproj
@@ -159,12 +159,19 @@
+
+
+
+
+
+
+
@@ -226,6 +233,9 @@
Always
+
+ Always
+
Designer
diff --git a/DataObjects/JobConfiguration/JobStatus.cs b/DataObjects/JobConfiguration/JobStatus.cs
index 0c20d25..b3db94f 100644
--- a/DataObjects/JobConfiguration/JobStatus.cs
+++ b/DataObjects/JobConfiguration/JobStatus.cs
@@ -24,8 +24,9 @@ public enum JobStatus
ReportApplicationAndEntityMetricGraphs = 24,
ReportEventsAndHealthRuleViolations = 25,
ReportSnapshots = 26,
- ReportIndividualApplicationAndEntityDetails = 27,
- ReportFlameGraphs = 28,
+ ReportSnapshotsMethodCallLines = 27,
+ ReportIndividualApplicationAndEntityDetails = 28,
+ ReportFlameGraphs = 29,
Done = 30,
diff --git a/DataObjects/ProgramOptions/ProgramOptions.cs b/DataObjects/ProgramOptions/ProgramOptions.cs
index 42c7f58..b3f135e 100644
--- a/DataObjects/ProgramOptions/ProgramOptions.cs
+++ b/DataObjects/ProgramOptions/ProgramOptions.cs
@@ -22,6 +22,8 @@ class ProgramOptions
public string OutputJobFilePath { get; set; }
+ public string ProgramLocationFolderPath { get; set; }
+
public string JobName { get; set; }
[ParserState]
@@ -36,7 +38,7 @@ public string GetUsage()
public override string ToString()
{
- return String.Format("ProgramOptions:\r\nInputJobFilePath='{0}'\r\nRestartJobFromBeginning='{1}'\r\nOutputFolderPath='{2}'\r\nOutputJobFolderPath='{3}'\r\nOutputJobFilePath='{4}'\r\nProcessSequentially='{5}'", this.InputJobFilePath, this.RestartJobFromBeginning, this.OutputFolderPath, this.OutputJobFolderPath, this.OutputJobFilePath, this.ProcessSequentially);
+ return String.Format("ProgramOptions:\r\nInputJobFilePath='{0}'\r\nRestartJobFromBeginning='{1}'\r\nOutputFolderPath='{2}'\r\nOutputJobFolderPath='{3}'\r\nOutputJobFilePath='{4}'\r\nProcessSequentially='{5}'\r\nProgramLocationFolderPath='{6}'", this.InputJobFilePath, this.RestartJobFromBeginning, this.OutputFolderPath, this.OutputJobFolderPath, this.OutputJobFilePath, this.ProcessSequentially, this.ProgramLocationFolderPath);
}
}
}
diff --git a/MethodNamespaceTypeMapping.csv b/MethodNamespaceTypeMapping.csv
new file mode 100644
index 0000000..8c1e440
--- /dev/null
+++ b/MethodNamespaceTypeMapping.csv
@@ -0,0 +1,137 @@
+ClassPrefix,FrameworkType
+ActivityFeeds,Microsoft Dynamics CRM
+antrl,ANTLR Parser
+ASP,.NET ASP.NET
+Asynchronous,.NET ASP.NET
+ch.qos.logback,Logback
+com.amazonaws,Amazon Core
+com.amazonaws.AmazonWebServiceClient,Amazon Web Service Client
+com.amazonaws.auth,Amazon Auth
+com.amazonaws.http,Amazon Http
+com.amazonaws.services.sns,Amazon SNS
+com.amazonaws.services.sqs,Amazon SQS
+com.appdynamics,AppDynamics
+com.appdynamicspilot,AppDynamics
+com.arjuna.ats,JBoss Arjuna
+com.aspose,Aspose Components
+com.atomikos,Atomicos Transactions
+com.bea,BEA Core
+com.blazesoft,FICO BlazeAdvisor
+com.blazesoft.engines,FICO BlazeAdvisor Rules Engine
+com.crossview.commerce,IBM WebSphere Commerce
+com.ctc.wstx,Sun Woodstox
+com.cybersource,CyberSource ECommerce
+com.entrust,Entrust ECommerce
+com.fasterxml.jackson,Jackson Core
+com.fasterxml.jackson.annotation,Jackson Annotation
+com.fasterxml.jackson.core,Jackson Core
+com.fasterxml.jackson.databind,Jackson DataBind
+com.google,Google Core
+com.ibm,IBM Core
+com.informix,Informix
+com.mchange.v2.c3p0,c3p0 JDBC Connection Pooling
+com.microsoft,Microsoft
+com.microsoft.sqlserver,Microsoft SQL Server Driver
+com.mysql,MySQL Driver
+com.nimbusds,NimbusDS
+com.opensymphony,OpenSymphony J2EE
+com.oracle,Oracle Core
+com.paypal,PayPal
+com.pointbase,Pointbase Driver
+com.rsa,RSA Security
+com.singularity,AppDynamics
+com.softwareag,Software AG
+com.sun,JDK Core
+com.sun.jersey,Jersey REST Framework
+com.sun.xml.ws,Sun Web Services
+com.sybase.jdbc2,Sybase JDBC2
+com.sybase.jdbc3,Sybase JDBC3
+com.sybase.jdbc4,Sybase JDBC3
+com.terracotta,Terracota DB
+com.terracottatech,Terracota DB
+com.thoughtworks,ThoughWorks
+com.weblogic,WebLogic Core
+com.webmethods,Software AG webMethods
+Corillian,Corillian/Voyager Banking
+Fiserv,FiServ Financial
+freemarker,Apache FreeMarker
+io.undertow,JBoss Undertow
+java,Java Core
+java.io,Java IO
+java.lang.reflect,Java Reflection
+javax,Java Extension
+jersey,Jersey REST Framework
+jrockit,JRockit JVM
+log4net,Log4Net Logging
+Microsoft,Microsoft
+Microsoft.Azure.KeyVault,Microsoft Azure KeyVault
+Microsoft.Crm,Microsoft Dynamics CRM
+Microsoft.CSharp,.NET C#
+Microsoft.Dynamics,Microsoft Dynamics CRM
+Microsoft.OData,Microsoft OData
+Microsoft.Owin,Microsoft Owin
+Microsoft.Practices,Microsoft Patterns and Practices
+Microsoft.ServiceBus,Microsoft Service Bus
+Microsoft.ServiceFabric,Microsoft Service Fabric
+Microsoft.SharePoint,Microsoft SharePoint
+Microsoft.SqlServer,Microsoft SQL Server
+Microsoft.VisualBasic,.NET VB.NET
+Microsoft.WindowsAzure.Storage,Microsoft Azure Storage
+Microsoft.Xrm,Microsoft Dynamics CRM
+MobileMoney.Voyager,Corillian/Voyager Banking
+MS.Internal.Xaml,.NET XAML
+MS.Internal.Xml,.NET XML
+MySQL,MySQL Driver
+net.sf,SourceForge
+netscape,Netscape
+Newtonsoft.Json,Newtonsoft JSON
+Novell,Novell
+NLog,NLog Framework
+ognl,Apache OGNL
+oracle,Oracle Core
+org.acegisecurity,Acegi Security
+org.apache,Apache
+org.apache.camel.components.seda,Apache Camel Seda
+org.apache.camel.example,Apache Camel Example
+org.apache.cassandra,Apache Cassandra
+org.apache.kafka,Apache Kafka
+org.apache.openejb,Apache OpenEJB
+org.apache.ws,Apache Web Services
+org.apache.xmlbeans,Apache XML Beans
+Org.BouncyCastle,Bouncy Castle Encryption
+org.eclipse.jetty,Eclipse Jetty
+org.glassfish,GlassFish
+org.jboss,JBoss
+org.jboss.soa.esb.client,JBoss ESB
+org.mule.processor,Mule ESB
+org.springframework,Spring
+org.springframework.integration,Spring Integration
+org.springframework.jms,Spring JMS
+persistence.antlr,TopLink JPA
+redis,Redis Cache
+redis.clients,Redis Cache Client
+SNINativeMethodWrapper,.NET ADO.NET
+StackExchange.Redis,Redis StackExchange
+StructureMap,StructureMap IoC/DI
+sun,JDK Core
+sun.reflect,Java Reflection
+System,.NET System
+System.Activities,.NET WF
+System.Collections,.NET Collections
+System.Data,.NET Data
+System.Data.Linq,.NET Data Linq
+System.Diagnostics,.NET Diagnostics
+System.IO,.NET IO
+System.Linq,.NET Linq
+System.Net,.NET Network
+System.Reflection,.NET Reflection
+System.Runtime,.NET Runtime
+System.Security,.NET Security
+System.ServiceModel,.NET WCF
+System.Text,.NET Text
+System.Threading,.NET Threading
+System.Web,.NET ASP.NET
+System.Web.Mvc,.NET ASP.NET MVC
+System.Xaml,.NET XAML
+System.Xml,.NET XML
+weblogic,WebLogic Core
\ No newline at end of file
diff --git a/ProcessJob.cs b/ProcessJob.cs
index 636c839..8d1f274 100644
--- a/ProcessJob.cs
+++ b/ProcessJob.cs
@@ -319,6 +319,8 @@ public class ProcessJob
private const string CONVERT_SNAPSHOTS_SEGMENTS_SERVICE_ENDPOINTS_CALLS_FILE_NAME = "snapshots.serviceendpoints.csv";
private const string CONVERT_SNAPSHOTS_SEGMENTS_DETECTED_ERRORS_FILE_NAME = "snapshots.errors.csv";
private const string CONVERT_SNAPSHOTS_SEGMENTS_BUSINESS_DATA_FILE_NAME = "snapshots.businessdata.csv";
+ private const string CONVERT_SNAPSHOTS_SEGMENTS_METHOD_CALL_LINES_FILE_NAME = "snapshots.methodcalllines.csv";
+ private const string CONVERT_SNAPSHOTS_SEGMENTS_METHOD_CALL_LINES_OCCURRENCES_FILE_NAME = "snapshots.methodcalllinesoccurrences.csv";
private const string CONVERT_SNAPSHOT_FILE_NAME = "snapshot.csv";
private const string CONVERT_SNAPSHOT_SEGMENTS_FILE_NAME = "snapshot.segments.csv";
@@ -326,6 +328,8 @@ public class ProcessJob
private const string CONVERT_SNAPSHOT_SEGMENTS_SERVICE_ENDPOINT_CALLS_FILE_NAME = "snapshot.serviceendpoints.csv";
private const string CONVERT_SNAPSHOT_SEGMENTS_DETECTED_ERRORS_FILE_NAME = "snapshot.errors.csv";
private const string CONVERT_SNAPSHOT_SEGMENTS_BUSINESS_DATA_FILE_NAME = "snapshot.businessdata.csv";
+ private const string CONVERT_SNAPSHOT_SEGMENTS_METHOD_CALL_LINES_FILE_NAME = "snapshot.methodcalllines.csv";
+ private const string CONVERT_SNAPSHOT_SEGMENTS_METHOD_CALL_LINES_OCCURRENCES_FILE_NAME = "snapshot.methodcalllinesoccurrences.csv";
// Settings report list
private const string CONTROLLER_SETTINGS_FILE_NAME = "controller.settings.csv";
@@ -346,6 +350,9 @@ public class ProcessJob
private const string APPLICATION_CONFIGURATION_AGENT_CALL_GRAPH_SETTINGS_FILE_NAME = "callgraphs.configuration.csv";
private const string APPLICATION_CONFIGURATION_HEALTH_RULES_FILE_NAME = "healthrules.csv";
+ // Settings for method and call mapping
+ private const string METHOD_CALL_LINES_TO_FRAMEWORK_TYPE_MAPPING_FILE_NAME = "MethodNamespaceTypeMapping.csv";
+
#endregion
#region Constants for the folder and file names of data reports
@@ -359,6 +366,7 @@ public class ProcessJob
private const string REPORT_METRICS_ALL_ENTITIES_FILE_NAME = "EntityMetrics.{0}.{1:yyyyMMddHH}-{2:yyyyMMddHH}.xlsx";
private const string REPORT_DETECTED_EVENTS_FILE_NAME = "Events.{0}.{1:yyyyMMddHH}-{2:yyyyMMddHH}.xlsx";
private const string REPORT_SNAPSHOTS_FILE_NAME = "Snapshots.{0}.{1:yyyyMMddHH}-{2:yyyyMMddHH}.xlsx";
+ private const string REPORT_SNAPSHOTS_METHOD_CALL_LINES_FILE_NAME = "Snapshots.MethodCallLines.{0}.{1:yyyyMMddHH}-{2:yyyyMMddHH}.xlsx";
private const string REPORT_CONFIGURATION_FILE_NAME = "Configuration.{0}.{1:yyyyMMddHH}-{2:yyyyMMddHH}.xlsx";
// Per entity report names
@@ -462,6 +470,7 @@ public class ProcessJob
private const string REPORT_METRICS_ALL_ENTITIES_TABLE_TOC = "t_TOC";
private const string REPORT_METRICS_ALL_ENTITIES_TABLE_PARAMETERS_TARGETS = "t_InputTargets";
+
private const string REPORT_METRICS_ALL_ENTITIES_TABLE_CONTROLLERS = "t_Controllers";
private const string REPORT_METRICS_ALL_ENTITIES_TABLE_APPLICATIONS_FULL = "t_Applications_Full";
private const string REPORT_METRICS_ALL_ENTITIES_TABLE_APPLICATIONS_HOURLY = "t_Applications_Hourly";
@@ -504,6 +513,10 @@ public class ProcessJob
private const string REPORT_METRICS_GRAPHS_SHEET_INFORMATION_POINTS_METRICS = "11.Information Points.Metrics";
private const string REPORT_METRICS_GRAPHS_SHEET_INFORMATION_POINTS_GRAPHS = "11.Information Points.Graphs";
+ private const string REPORT_METRICS_GRAPHS_TABLE_TOC = "t_TOC";
+ private const string REPORT_METRICS_GRAPHS_TABLE_PARAMETERS_TARGETS = "t_InputTargets";
+ private const string REPORT_METRICS_GRAPHS_TABLE_CONTROLLERS = "t_Controllers";
+
// Description tables from metric.summary.csv
private const string REPORT_METRICS_GRAPHS_METRIC_TABLE_METRIC_DESCRIPTION = "t_Metric_Description_{0}_{1}_{2}";
// Metric data tables from metric.values.csv
@@ -530,6 +543,9 @@ public class ProcessJob
private const string REPORT_DETECTED_EVENTS_TABLE_CONTROLLERS = "t_Controllers";
private const string REPORT_DETECTED_EVENTS_TABLE_APPLICATIONS = "t_Applications";
+ private const string REPORT_DETECTED_EVENTS_TABLE_TOC = "t_TOC";
+ private const string REPORT_DETECTED_EVENTS_TABLE_PARAMETERS_TARGETS = "t_InputTargets";
+
private const string REPORT_DETECTED_EVENTS_TABLE_EVENTS = "t_Events";
private const string REPORT_DETECTED_EVENTS_TABLE_HEALTH_RULE_VIOLATION_EVENTS = "t_HealthRuleViolationEvents";
@@ -644,6 +660,17 @@ public class ProcessJob
private const string REPORT_SNAPSHOTS_SHEET_BUSINESS_DATA = "10.Business Data";
private const string REPORT_SNAPSHOTS_SHEET_BUSINESS_DATA_PIVOT = "10.Business Data.Type";
+ private const string REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES = "11.Method Calls";
+ private const string REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_TYPE_PIVOT = "11.Method Calls.Type";
+ private const string REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_LOCATION_PIVOT = "11.Method Calls.Location";
+
+ private const string REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_OCCURRENCES = "12.Method Occurrences";
+ private const string REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_OCCURRENCES_TYPE_PIVOT = "12.Method Occurrences.Type";
+ private const string REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_OCCURRENCES_LOCATION_PIVOT = "12.Method Occurrences.Location";
+
+ private const string REPORT_SNAPSHOTS_TABLE_TOC = "t_TOC";
+ private const string REPORT_SNAPSHOTS_TABLE_PARAMETERS_TARGETS = "t_InputTargets";
+
private const string REPORT_SNAPSHOTS_TABLE_CONTROLLERS = "t_Controllers";
private const string REPORT_SNAPSHOTS_TABLE_APPLICATIONS = "t_Applications";
@@ -653,6 +680,8 @@ public class ProcessJob
private const string REPORT_SNAPSHOTS_TABLE_SERVICE_ENDPOINT_CALLS = "t_ServiceEndpointCalls";
private const string REPORT_SNAPSHOTS_TABLE_DETECTED_ERRORS = "t_DetectedErrors";
private const string REPORT_SNAPSHOTS_TABLE_BUSINESS_DATA = "t_BusinessData";
+ private const string REPORT_SNAPSHOTS_TABLE_METHOD_CALL_LINES = "t_MethodCallLines";
+ private const string REPORT_SNAPSHOTS_TABLE_METHOD_CALL_LINES_OCCURRENCES = "t_MethodCallLinesOccurrences";
private const string REPORT_SNAPSHOTS_PIVOT_SNAPSHOTS = "p_Snapshots";
private const string REPORT_SNAPSHOTS_PIVOT_SEGMENTS = "p_Segments";
@@ -660,6 +689,10 @@ public class ProcessJob
private const string REPORT_SNAPSHOTS_PIVOT_EXIT_CALLS_DETAILS_DURATION = "p_ExitCallsDetailsDuration";
private const string REPORT_SNAPSHOTS_PIVOT_DETECTED_ERRORS = "p_DetectedErrors";
private const string REPORT_SNAPSHOTS_PIVOT_BUSINESS_DATA = "p_BusinessData";
+ private const string REPORT_SNAPSHOTS_PIVOT_METHOD_CALL_LINES_TYPE = "p_MethodCallLinesType";
+ private const string REPORT_SNAPSHOTS_PIVOT_METHOD_CALL_LINES_LOCATION = "p_MethodCallLinesDuration";
+ private const string REPORT_SNAPSHOTS_PIVOT_METHOD_CALL_LINES_OCCURRENCES_TYPE = "p_MethodCallLinesOccurrencesType";
+ private const string REPORT_SNAPSHOTS_PIVOT_METHOD_CALL_LINES_OCCURRENCES_LOCATION = "p_MethodCallLinesOccurrencesLocation";
private const string REPORT_SNAPSHOTS_PIVOT_SNAPSHOTS_GRAPH = "g_Snapshots";
private const string REPORT_SNAPSHOTS_PIVOT_SEGMENTS_GRAPH = "g_Segments";
@@ -667,6 +700,10 @@ public class ProcessJob
private const string REPORT_SNAPSHOTS_PIVOT_EXIT_CALLS_DETAILS_DURATION_GRAPH = "g_ExitCallsDetailsDuration";
private const string REPORT_SNAPSHOTS_PIVOT_DETECTED_ERRORS_GRAPH = "g_DetectedErrors";
private const string REPORT_SNAPSHOTS_PIVOT_BUSINESS_DATA_GRAPH = "g_BusinessData";
+ private const string REPORT_SNAPSHOTS_PIVOT_METHOD_CALL_LINES_GRAPH_TYPE = "g_MethodCallLinesType";
+ private const string REPORT_SNAPSHOTS_PIVOT_METHOD_CALL_LINES_GRAPH_LOCATION = "g_MethodCallLinesLocation";
+ private const string REPORT_SNAPSHOTS_PIVOT_METHOD_CALL_LINES_OCCURRENCES_GRAPH_TYPE = "g_MethodCallLinesOccurrencesType";
+ private const string REPORT_SNAPSHOTS_PIVOT_METHOD_CALL_LINES_OCCURRENCES_GRAPH_LOCATION = "g_MethodCallLinesOccurrencesLocation";
private const int REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT = 4;
private const int REPORT_SNAPSHOTS_PIVOT_SHEET_START_PIVOT_AT = 8;
@@ -705,6 +742,7 @@ public class ProcessJob
private const string REPORT_CONFIGURATION_SHEET_AGENT_CALL_GRAPH_SETTINGS = "19.Call Graph Settings";
private const string REPORT_CONFIGURATION_DETAILS_TABLE_TOC = "t_TOC";
+ private const string REPORT_CONFIGURATION_TABLE_PARAMETERS_TARGETS = "t_InputTargets";
private const string REPORT_CONFIGURATION_DETAILS_TABLE_CONTROLLERS = "t_Controllers";
// Full and hourly metric data
@@ -876,6 +914,7 @@ internal static void startOrContinueJob(ProgramOptions programOptions)
JobStatus.ReportApplicationAndEntityMetricGraphs,
JobStatus.ReportEventsAndHealthRuleViolations,
JobStatus.ReportSnapshots,
+ JobStatus.ReportSnapshotsMethodCallLines,
JobStatus.ReportIndividualApplicationAndEntityDetails,
//JobStatus.ReportFlameGraphs,
@@ -1247,6 +1286,26 @@ internal static void startOrContinueJob(ProgramOptions programOptions)
}
break;
+ case JobStatus.ReportSnapshotsMethodCallLines:
+ if (jobConfiguration.Input.Snapshots == true && jobConfiguration.Output.Snapshots == true)
+ {
+ if (stepReportSnapshotsMethodCallLines(programOptions, jobConfiguration, jobConfiguration.Status) == true)
+ {
+ jobConfiguration.Status = jobStepsLinked.Find(jobConfiguration.Status).Next.Value;
+ }
+ else
+ {
+ jobConfiguration.Status = JobStatus.Error;
+ }
+ }
+ else
+ {
+ jobConfiguration.Status = jobStepsLinked.Find(jobConfiguration.Status).Next.Value;
+
+ loggerConsole.Debug("Skipping report of snapshots");
+ }
+ break;
+
case JobStatus.ReportIndividualApplicationAndEntityDetails:
if ((jobConfiguration.Input.Metrics == true ||
jobConfiguration.Input.Events == true ||
@@ -3425,7 +3484,7 @@ private static bool stepIndexControllersApplicationsAndEntities(ProgramOptions p
List informationPointsRESTList = FileIOHelper.loadListOfObjectsFromFile(informationPointsFilePath);
List informationPointsList = null;
- if (serviceEndpointsRESTList != null)
+ if (informationPointsRESTList != null)
{
loggerConsole.Info("Index List of Information points ({0} entities)", informationPointsRESTList.Count);
@@ -6449,6 +6508,7 @@ private static bool stepIndexSnapshots(ProgramOptions programOptions, JobConfigu
string snapshotsFolderPath = Path.Combine(applicationFolderPath, SNAPSHOTS_FOLDER_NAME);
string reportFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
string snapshotsAllFolderPath = Path.Combine(reportFolderPath, SNAPSHOTS_FOLDER_NAME);
+ string configFolderPath = Path.Combine(applicationFolderPath, CONFIGURATION_FOLDER_NAME);
// Previosly rendered report files
string applicationReportFilePath = Path.Combine(applicationFolderPath, CONVERT_ENTITY_APPLICATION_FILE_NAME);
@@ -6456,6 +6516,8 @@ private static bool stepIndexSnapshots(ProgramOptions programOptions, JobConfigu
string backendsReportFilePath = Path.Combine(entitiesFolderPath, CONVERT_ENTITY_BACKENDS_FILE_NAME);
string serviceEndpointsReportFilePath = Path.Combine(entitiesFolderPath, CONVERT_ENTITY_SERVICE_ENDPOINTS_FILE_NAME);
string errorsReportFilePath = Path.Combine(entitiesFolderPath, CONVERT_ENTITY_ERRORS_FILE_NAME);
+ string methodInvocationDataCollectorsReportFilePath = Path.Combine(configFolderPath, APPLICATION_CONFIGURATION_METHOD_INVOCATION_DATA_COLLECTORS_FILE_NAME);
+ string methodCallLinesToFrameworkTypeMappingFilePath = Path.Combine(programOptions.ProgramLocationFolderPath, METHOD_CALL_LINES_TO_FRAMEWORK_TYPE_MAPPING_FILE_NAME);
// Report files
string snapshotsReportFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_FILE_NAME);
@@ -6464,6 +6526,8 @@ private static bool stepIndexSnapshots(ProgramOptions programOptions, JobConfigu
string serviceEndpointCallsReportFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_SERVICE_ENDPOINTS_CALLS_FILE_NAME);
string detectedErrorsReportFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_DETECTED_ERRORS_FILE_NAME);
string businessDataReportFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_BUSINESS_DATA_FILE_NAME);
+ string methodCallLinesReportFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_METHOD_CALL_LINES_FILE_NAME);
+ string methodCallLinesOccurrencesReportFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_METHOD_CALL_LINES_OCCURRENCES_FILE_NAME);
string applicationSnapshotsSummaryReportFilePath = Path.Combine(snapshotsFolderPath, CONVERT_APPLICATION_SNAPSHOTS_FILE_NAME);
// Report files for All
@@ -6473,6 +6537,8 @@ private static bool stepIndexSnapshots(ProgramOptions programOptions, JobConfigu
string serviceEndpointCallsAllReporFilePath = Path.Combine(snapshotsAllFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_SERVICE_ENDPOINTS_CALLS_FILE_NAME);
string detectedErrorsAllReporFilePath = Path.Combine(snapshotsAllFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_DETECTED_ERRORS_FILE_NAME);
string businessDataAllReportFilePath = Path.Combine(snapshotsAllFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_BUSINESS_DATA_FILE_NAME);
+ string methodCallLinesAllReportFilePath = Path.Combine(snapshotsAllFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_METHOD_CALL_LINES_FILE_NAME);
+ string methodCallLinesOccurrencesAllReportFilePath = Path.Combine(snapshotsAllFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_METHOD_CALL_LINES_OCCURRENCES_FILE_NAME);
string applicationSnapshotsSummaryAllReportFilePath = Path.Combine(snapshotsAllFolderPath, CONVERT_APPLICATION_SNAPSHOTS_FILE_NAME);
#endregion
@@ -6486,6 +6552,38 @@ private static bool stepIndexSnapshots(ProgramOptions programOptions, JobConfigu
List backendsList = FileIOHelper.readListFromCSVFile(backendsReportFilePath, new BackendEntityReportMap());
List serviceEndpointsList = FileIOHelper.readListFromCSVFile(serviceEndpointsReportFilePath, new ServiceEndpointEntityReportMap());
List errorsList = FileIOHelper.readListFromCSVFile(errorsReportFilePath, new ErrorEntityReportMap());
+ List methodInvocationDataCollectorsList = FileIOHelper.readListFromCSVFile(methodInvocationDataCollectorsReportFilePath, new MethodInvocationDataCollectorReportMap());
+
+ // Load and bucketize the framework mappings
+ List methodCallLineClassToFrameworkTypeMappingList = FileIOHelper.readListFromCSVFile(methodCallLinesToFrameworkTypeMappingFilePath, new MethodCallLineClassTypeMappingReportMap());
+ methodCallLineClassToFrameworkTypeMappingList = methodCallLineClassToFrameworkTypeMappingList.OrderByDescending(m => m.ClassPrefix).ToList();
+ Dictionary> methodCallLineClassToFrameworkTypeMappingDictionary = new Dictionary>(26);
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("a", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "a").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("b", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "b").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("c", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "c").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("d", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "d").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("e", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "e").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("f", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "f").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("g", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "g").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("h", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "h").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("i", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "i").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("j", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "j").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("k", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "k").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("l", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "l").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("m", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "m").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("n", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "n").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("o", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "o").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("p", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "p").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("q", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "q").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("r", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "r").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("s", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "s").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("t", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "t").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("u", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "u").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("v", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "v").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("w", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "w").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("x", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "x").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("y", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "y").ToList());
+ methodCallLineClassToFrameworkTypeMappingDictionary.Add("z", methodCallLineClassToFrameworkTypeMappingList.Where(m => m.ClassPrefix.Substring(0, 1).ToLower() == "z").ToList());
int totalNumberOfSnapshots = 0;
foreach (JobTimeRange jobTimeRange in jobConfiguration.Input.HourlyTimeRanges)
@@ -6510,7 +6608,7 @@ private static bool stepIndexSnapshots(ProgramOptions programOptions, JobConfigu
() => 0,
(listOfSnapshotsInHourChunk, loop, subtotal) =>
{
- subtotal += indexSnapshots(programOptions, jobConfiguration, jobTarget, jobTimeRange, listOfSnapshotsInHourChunk, tiersList, backendsList, serviceEndpointsList, errorsList, false);
+ subtotal += indexSnapshots(programOptions, jobConfiguration, jobTarget, jobTimeRange, listOfSnapshotsInHourChunk, tiersList, backendsList, serviceEndpointsList, errorsList, methodInvocationDataCollectorsList, methodCallLineClassToFrameworkTypeMappingDictionary, false);
return subtotal;
},
(finalResult) =>
@@ -6522,7 +6620,7 @@ private static bool stepIndexSnapshots(ProgramOptions programOptions, JobConfigu
}
else
{
- j = indexSnapshots(programOptions, jobConfiguration, jobTarget, jobTimeRange, listOfSnapshotsInHour.ToList(), tiersList, backendsList, serviceEndpointsList, errorsList, true);
+ j = indexSnapshots(programOptions, jobConfiguration, jobTarget, jobTimeRange, listOfSnapshotsInHour.ToList(), tiersList, backendsList, serviceEndpointsList, errorsList, methodInvocationDataCollectorsList, methodCallLineClassToFrameworkTypeMappingDictionary, true);
}
loggerConsole.Info("{0} snapshots", j);
@@ -6544,6 +6642,8 @@ private static bool stepIndexSnapshots(ProgramOptions programOptions, JobConfigu
FileIOHelper.deleteFile(serviceEndpointCallsReportFilePath);
FileIOHelper.deleteFile(detectedErrorsReportFilePath);
FileIOHelper.deleteFile(businessDataReportFilePath);
+ FileIOHelper.deleteFile(methodCallLinesReportFilePath);
+ FileIOHelper.deleteFile(methodCallLinesOccurrencesReportFilePath);
FileIOHelper.deleteFile(applicationSnapshotsSummaryReportFilePath);
List applicationList = FileIOHelper.readListFromCSVFile(applicationReportFilePath, new ApplicationEntityReportMap());
@@ -6584,75 +6684,85 @@ private static bool stepIndexSnapshots(ProgramOptions programOptions, JobConfigu
{
using (FileStream businessDataReportFileStream = File.Open(businessDataReportFilePath, FileMode.Append))
{
- foreach (JToken snapshot in listOfSnapshotsInHour)
+ using (FileStream methodCallLinesReportFileStream = File.Open(methodCallLinesReportFilePath, FileMode.Append))
{
- if (requestIDs.ContainsKey(snapshot["requestGUID"].ToString()) == true)
+ using (FileStream methodCallLinesOccurrencesReportFileStream = File.Open(methodCallLinesOccurrencesReportFilePath, FileMode.Append))
{
- logger.Warn("Snapshot {0} is a duplicate, skipping", snapshot["requestGUID"]);
- continue;
- }
- requestIDs.Add(snapshot["requestGUID"].ToString(), true);
-
- // Count the snapshot
- if (applicationsRow != null)
- {
- applicationsRow.NumSnapshots++;
- switch (snapshot["userExperience"].ToString())
+ foreach (JToken snapshot in listOfSnapshotsInHour)
{
- case "NORMAL":
- applicationsRow.NumSnapshotsNormal++;
- break;
-
- case "SLOW":
- applicationsRow.NumSnapshotsSlow++;
- break;
-
- case "VERY_SLOW":
- applicationsRow.NumSnapshotsVerySlow++;
- break;
-
- case "STALL":
- applicationsRow.NumSnapshotsStall++;
- break;
-
- case "ERROR":
- applicationsRow.NumSnapshotsError++;
- break;
-
- default:
- break;
+ if (requestIDs.ContainsKey(snapshot["requestGUID"].ToString()) == true)
+ {
+ logger.Warn("Snapshot {0} is a duplicate, skipping", snapshot["requestGUID"]);
+ continue;
+ }
+ requestIDs.Add(snapshot["requestGUID"].ToString(), true);
+
+ // Count the snapshot
+ if (applicationsRow != null)
+ {
+ applicationsRow.NumSnapshots++;
+ switch (snapshot["userExperience"].ToString())
+ {
+ case "NORMAL":
+ applicationsRow.NumSnapshotsNormal++;
+ break;
+
+ case "SLOW":
+ applicationsRow.NumSnapshotsSlow++;
+ break;
+
+ case "VERY_SLOW":
+ applicationsRow.NumSnapshotsVerySlow++;
+ break;
+
+ case "STALL":
+ applicationsRow.NumSnapshotsStall++;
+ break;
+
+ case "ERROR":
+ applicationsRow.NumSnapshotsError++;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ DateTime snapshotTime = convertFromUnixTimestamp((long)snapshot["serverStartTime"]);
+
+ string snapshotFolderPath = Path.Combine(
+ snapshotsFolderPath,
+ getShortenedEntityNameForFileSystem(snapshot["applicationComponentName"].ToString(), (long)snapshot["applicationComponentId"]),
+ getShortenedEntityNameForFileSystem(snapshot["businessTransactionName"].ToString(), (long)snapshot["businessTransactionId"]),
+ String.Format("{0:yyyyMMddHH}", snapshotTime),
+ userExperienceFolderNameMapping[snapshot["userExperience"].ToString()],
+ String.Format(SNAPSHOT_FOLDER_NAME, snapshot["requestGUID"], snapshotTime));
+
+ string thisSnapshotSnapshotsFileName = Path.Combine(snapshotFolderPath, CONVERT_SNAPSHOT_FILE_NAME);
+ string thisSnapshotSegmentsFileName = Path.Combine(snapshotFolderPath, CONVERT_SNAPSHOT_SEGMENTS_FILE_NAME);
+ string thisSnapshotExitCallsFileName = Path.Combine(snapshotFolderPath, CONVERT_SNAPSHOT_SEGMENTS_EXIT_CALLS_FILE_NAME);
+ string thisSnapshotServiceEndpointCallsFileName = Path.Combine(snapshotFolderPath, CONVERT_SNAPSHOT_SEGMENTS_SERVICE_ENDPOINT_CALLS_FILE_NAME);
+ string thisSnapshotDetectedErrorsFileName = Path.Combine(snapshotFolderPath, CONVERT_SNAPSHOT_SEGMENTS_DETECTED_ERRORS_FILE_NAME);
+ string thisSnapshotBusinessDataFileName = Path.Combine(snapshotFolderPath, CONVERT_SNAPSHOT_SEGMENTS_BUSINESS_DATA_FILE_NAME);
+ string thisSnapshotMethodCallLinesFileName = Path.Combine(snapshotFolderPath, CONVERT_SNAPSHOT_SEGMENTS_METHOD_CALL_LINES_FILE_NAME);
+ string thisSnapshotMethodCallOccurrencesLinesFileName = Path.Combine(snapshotFolderPath, CONVERT_SNAPSHOT_SEGMENTS_METHOD_CALL_LINES_OCCURRENCES_FILE_NAME);
+
+ FileIOHelper.appendTwoCSVFiles(snapshotsReportFileStream, thisSnapshotSnapshotsFileName);
+ FileIOHelper.appendTwoCSVFiles(segmentsReportFileStream, thisSnapshotSegmentsFileName);
+ FileIOHelper.appendTwoCSVFiles(callExitsReportFileStream, thisSnapshotExitCallsFileName);
+ FileIOHelper.appendTwoCSVFiles(serviceEndpointCallsReportFileStream, thisSnapshotServiceEndpointCallsFileName);
+ FileIOHelper.appendTwoCSVFiles(detectedErrorsReportFileStream, thisSnapshotDetectedErrorsFileName);
+ FileIOHelper.appendTwoCSVFiles(businessDataReportFileStream, thisSnapshotBusinessDataFileName);
+ FileIOHelper.appendTwoCSVFiles(methodCallLinesReportFileStream, thisSnapshotMethodCallLinesFileName);
+ FileIOHelper.appendTwoCSVFiles(methodCallLinesOccurrencesReportFileStream, thisSnapshotMethodCallOccurrencesLinesFileName);
+
+ j++;
+ if (j % 200 == 0)
+ {
+ Console.Write("[{0}].", j);
+ }
}
}
-
- DateTime snapshotTime = convertFromUnixTimestamp((long)snapshot["serverStartTime"]);
-
- string snapshotFolderPath = Path.Combine(
- snapshotsFolderPath,
- getShortenedEntityNameForFileSystem(snapshot["applicationComponentName"].ToString(), (long)snapshot["applicationComponentId"]),
- getShortenedEntityNameForFileSystem(snapshot["businessTransactionName"].ToString(), (long)snapshot["businessTransactionId"]),
- String.Format("{0:yyyyMMddHH}", snapshotTime),
- userExperienceFolderNameMapping[snapshot["userExperience"].ToString()],
- String.Format(SNAPSHOT_FOLDER_NAME, snapshot["requestGUID"], snapshotTime));
-
- string thisSnapshotSnapshotsFileName = Path.Combine(snapshotFolderPath, CONVERT_SNAPSHOT_FILE_NAME);
- string thisSnapshotSegmentsFileName = Path.Combine(snapshotFolderPath, CONVERT_SNAPSHOT_SEGMENTS_FILE_NAME);
- string thisSnapshotExitCallsFileName = Path.Combine(snapshotFolderPath, CONVERT_SNAPSHOT_SEGMENTS_EXIT_CALLS_FILE_NAME);
- string thisSnapshotServiceEndpointCallsFileName = Path.Combine(snapshotFolderPath, CONVERT_SNAPSHOT_SEGMENTS_SERVICE_ENDPOINT_CALLS_FILE_NAME);
- string thisSnapshotDetectedErrorsFileName = Path.Combine(snapshotFolderPath, CONVERT_SNAPSHOT_SEGMENTS_DETECTED_ERRORS_FILE_NAME);
- string thisSnapshotBusinessDataFileName = Path.Combine(snapshotFolderPath, CONVERT_SNAPSHOT_SEGMENTS_BUSINESS_DATA_FILE_NAME);
-
- FileIOHelper.appendTwoCSVFiles(snapshotsReportFileStream, thisSnapshotSnapshotsFileName);
- FileIOHelper.appendTwoCSVFiles(segmentsReportFileStream, thisSnapshotSegmentsFileName);
- FileIOHelper.appendTwoCSVFiles(callExitsReportFileStream, thisSnapshotExitCallsFileName);
- FileIOHelper.appendTwoCSVFiles(serviceEndpointCallsReportFileStream, thisSnapshotServiceEndpointCallsFileName);
- FileIOHelper.appendTwoCSVFiles(detectedErrorsReportFileStream, thisSnapshotDetectedErrorsFileName);
- FileIOHelper.appendTwoCSVFiles(businessDataReportFileStream, thisSnapshotBusinessDataFileName);
-
- j++;
- if (j % 100 == 0)
- {
- Console.Write("[{0}].", j);
- }
}
}
}
@@ -6694,6 +6804,8 @@ private static bool stepIndexSnapshots(ProgramOptions programOptions, JobConfigu
FileIOHelper.appendTwoCSVFiles(serviceEndpointCallsAllReporFilePath, serviceEndpointCallsReportFilePath);
FileIOHelper.appendTwoCSVFiles(detectedErrorsAllReporFilePath, detectedErrorsReportFilePath);
FileIOHelper.appendTwoCSVFiles(businessDataAllReportFilePath, businessDataReportFilePath);
+ FileIOHelper.appendTwoCSVFiles(methodCallLinesAllReportFilePath, methodCallLinesReportFilePath);
+ FileIOHelper.appendTwoCSVFiles(methodCallLinesOccurrencesAllReportFilePath, methodCallLinesOccurrencesReportFilePath);
FileIOHelper.appendTwoCSVFiles(applicationSnapshotsSummaryAllReportFilePath, applicationSnapshotsSummaryReportFilePath);
#endregion
@@ -7169,6 +7281,7 @@ private static bool stepReportControlerApplicationsAndEntities(ProgramOptions pr
readCSVFileIntoExcelRange(informationPointsAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
#endregion
+
loggerConsole.Info("Finalize Detected Entities Report File");
#region Controllers sheet
@@ -7209,25 +7322,25 @@ private static bool stepReportControlerApplicationsAndEntities(ProgramOptions pr
adjustColumnsOfEntityRowTableInEntitiesReport(APPLICATION_TYPE_SHORT, sheet, table);
- ExcelAddress cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumTiers"].Position + 1, sheet.Dimension.Rows, table.Columns["NumTiers"].Position + 1);
+ ExcelAddress cfAddressNum = new ExcelAddress(REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumTiers"].Position + 1, sheet.Dimension.Rows, table.Columns["NumTiers"].Position + 1);
var cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumNodes"].Position + 1, sheet.Dimension.Rows, table.Columns["NumNodes"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumNodes"].Position + 1, sheet.Dimension.Rows, table.Columns["NumNodes"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBackends"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBackends"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBackends"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBackends"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBTs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBTs"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBTs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBTs"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSEPs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSEPs"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSEPs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSEPs"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumErrors"].Position + 1, sheet.Dimension.Rows, table.Columns["NumErrors"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumErrors"].Position + 1, sheet.Dimension.Rows, table.Columns["NumErrors"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumIPs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumIPs"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumIPs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumIPs"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
}
@@ -7250,16 +7363,16 @@ private static bool stepReportControlerApplicationsAndEntities(ProgramOptions pr
adjustColumnsOfEntityRowTableInEntitiesReport(TIERS_TYPE_SHORT, sheet, table);
- ExcelAddress cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumNodes"].Position + 1, sheet.Dimension.Rows, table.Columns["NumNodes"].Position + 1);
+ ExcelAddress cfAddressNum = new ExcelAddress(REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumNodes"].Position + 1, sheet.Dimension.Rows, table.Columns["NumNodes"].Position + 1);
var cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBTs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBTs"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBTs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBTs"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSEPs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSEPs"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSEPs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSEPs"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumErrors"].Position + 1, sheet.Dimension.Rows, table.Columns["NumErrors"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumErrors"].Position + 1, sheet.Dimension.Rows, table.Columns["NumErrors"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
// Make pivot
@@ -7855,7 +7968,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
ApplicationID = jobTarget.ApplicationID,
Status = jobTarget.Status.ToString()
}, true);
- ExcelTable table = sheet.Tables.Add(range, REPORT_DETECTED_ENTITIES_TABLE_PARAMETERS_TARGETS);
+ ExcelTable table = sheet.Tables.Add(range, REPORT_CONFIGURATION_TABLE_PARAMETERS_TARGETS);
table.ShowHeader = true;
table.TableStyle = TableStyles.Medium2;
table.ShowFilter = true;
@@ -7877,7 +7990,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
#region Entity sheets and their associated pivots
// Entity sheets
- sheet = excelReport.Workbook.Worksheets.Add(REPORT_DETECTED_ENTITIES_SHEET_CONTROLLERS);
+ sheet = excelReport.Workbook.Worksheets.Add(REPORT_CONFIGURATION_SHEET_CONTROLLERS);
sheet.Cells[1, 1].Value = "Table of Contents";
sheet.Cells[1, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SHEET_TOC);
sheet.Cells[1, 2].StyleName = "HyperLinkStyle";
@@ -8118,8 +8231,8 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
loggerConsole.Info("List of Controllers");
- sheet = excelReport.Workbook.Worksheets[REPORT_DETECTED_ENTITIES_SHEET_CONTROLLERS];
- readCSVFileIntoExcelRange(controllersAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_CONTROLLERS];
+ readCSVFileIntoExcelRange(controllersAllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -8128,7 +8241,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
loggerConsole.Info("List of Controller Settings");
sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_CONTROLLER_SETTINGS];
- readCSVFileIntoExcelRange(controllerSettingsAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(controllerSettingsAllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -8137,7 +8250,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
loggerConsole.Info("List of Application Configuration");
sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_APPLICATION_CONFIGURATION];
- readCSVFileIntoExcelRange(applicationConfigurationAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(applicationConfigurationAllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -8146,7 +8259,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
loggerConsole.Info("List of Business Transaction Detection Rules");
sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_BUSINESS_TRANSACTION_DISCOVERY_RULES];
- readCSVFileIntoExcelRange(businessTransactionDiscoveryRulesAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(businessTransactionDiscoveryRulesAllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -8155,7 +8268,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
loggerConsole.Info("List of Business Transaction Entry Rules");
sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_BUSINESS_TRANSACTION_ENTRY_RULES];
- readCSVFileIntoExcelRange(businessTransactionEntryRulesAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(businessTransactionEntryRulesAllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -8164,7 +8277,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
loggerConsole.Info("List of Business Transaction Scopes");
sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_BUSINESS_TRANSACTION_SCOPES];
- readCSVFileIntoExcelRange(businessTransactionEntryScopesAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(businessTransactionEntryScopesAllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -8173,7 +8286,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
loggerConsole.Info("List of Business Transaction 2.0 Detection Rules");
sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_BUSINESS_TRANSACTION_DISCOVERY_RULES_20];
- readCSVFileIntoExcelRange(businessTransactionDiscoveryRules20AllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(businessTransactionDiscoveryRules20AllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -8182,7 +8295,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
loggerConsole.Info("List of Business Transaction 2.0 Entry Rules");
sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_BUSINESS_TRANSACTION_ENTRY_RULES_20];
- readCSVFileIntoExcelRange(businessTransactionEntryRules20AllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(businessTransactionEntryRules20AllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -8191,7 +8304,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
loggerConsole.Info("List of Backend Detection Rules");
sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_BACKEND_DISCOVERY_ENTRY_RULES];
- readCSVFileIntoExcelRange(backendDiscoveryRulesAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(backendDiscoveryRulesAllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -8200,7 +8313,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
loggerConsole.Info("List of Custom Exit Rules");
sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_CUSTOM_EXIT_RULES];
- readCSVFileIntoExcelRange(customExitRulesAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(customExitRulesAllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -8209,7 +8322,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
loggerConsole.Info("List of Information Point Rules");
sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_INFORMATION_POINT_RULES];
- readCSVFileIntoExcelRange(informationPointRulesAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(informationPointRulesAllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -8218,7 +8331,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
loggerConsole.Info("List of Agent Configuration Properties");
sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_AGENT_CONFIGURATION_PROPERTIES];
- readCSVFileIntoExcelRange(agentConfigurationPropertiesAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(agentConfigurationPropertiesAllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -8227,12 +8340,12 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
loggerConsole.Info("List of Method Invocation Data Collectors");
sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_METHOD_INVOCATION_DATA_COLLECTORS];
- readCSVFileIntoExcelRange(methodInvocationDataCollectorsAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(methodInvocationDataCollectorsAllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
loggerConsole.Info("List of HTTP Data Collectors");
sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_HTTP_DATA_COLLECTORS];
- readCSVFileIntoExcelRange(httpDataCollectorsAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(httpDataCollectorsAllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -8241,7 +8354,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
loggerConsole.Info("List of Tier Settings");
sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_TIER_SETTINGS];
- readCSVFileIntoExcelRange(entityTierConfigurationsAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(entityTierConfigurationsAllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -8250,7 +8363,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
loggerConsole.Info("List of Detected Business Transaction and Assigned Data Collectors");
sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_BUSINESS_TRANSACTION_SETTINGS];
- readCSVFileIntoExcelRange(entityBusinessTransactionConfigurationsAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(entityBusinessTransactionConfigurationsAllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -8259,7 +8372,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
loggerConsole.Info("List of Agent Call Graph Settings");
sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_AGENT_CALL_GRAPH_SETTINGS];
- readCSVFileIntoExcelRange(agentCallGraphSettingsAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(agentCallGraphSettingsAllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -8268,7 +8381,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
loggerConsole.Info("List of Health Rules");
sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_HEALTH_RULES];
- readCSVFileIntoExcelRange(healthRulesAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(healthRulesAllReportFilePath, 0, sheet, REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -8277,7 +8390,7 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
#region Controllers sheet
// Make table
- sheet = excelReport.Workbook.Worksheets[REPORT_DETECTED_ENTITIES_SHEET_CONTROLLERS];
+ sheet = excelReport.Workbook.Worksheets[REPORT_CONFIGURATION_SHEET_CONTROLLERS];
logger.Info("Controllers Sheet ({0} rows)", sheet.Dimension.Rows);
loggerConsole.Info("Controllers Sheet ({0} rows)", sheet.Dimension.Rows);
if (sheet.Dimension.Rows > REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT)
@@ -8336,62 +8449,62 @@ private static bool stepReportControllerAndApplicationConfiguration(ProgramOptio
sheet.Column(table.Columns["Controller"].Position + 1).Width = 20;
sheet.Column(table.Columns["ApplicationName"].Position + 1).Width = 20;
- ExcelAddress cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBTDiscoveryRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBTDiscoveryRules"].Position + 1);
+ ExcelAddress cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBTDiscoveryRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBTDiscoveryRules"].Position + 1);
var cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBTEntryRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBTEntryRules"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBTEntryRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBTEntryRules"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBTExcludeRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBTExcludeRules"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBTExcludeRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBTExcludeRules"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBT20Scopes"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBT20Scopes"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBT20Scopes"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBT20Scopes"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBT20DiscoveryRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBT20DiscoveryRules"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBT20DiscoveryRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBT20DiscoveryRules"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBT20EntryRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBT20EntryRules"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBT20EntryRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBT20EntryRules"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBT20ExcludeRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBT20ExcludeRules"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBT20ExcludeRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBT20ExcludeRules"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBackendRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBackendRules"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBackendRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBackendRules"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumInfoPointRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumInfoPointRules"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumInfoPointRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumInfoPointRules"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumAgentProps"].Position + 1, sheet.Dimension.Rows, table.Columns["NumAgentProps"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumAgentProps"].Position + 1, sheet.Dimension.Rows, table.Columns["NumAgentProps"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumHealthRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumHealthRules"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumHealthRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumHealthRules"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumErrorRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumErrorRules"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumErrorRules"].Position + 1, sheet.Dimension.Rows, table.Columns["NumErrorRules"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumHTTPDCVariablesCollected"].Position + 1, sheet.Dimension.Rows, table.Columns["NumHTTPDCVariablesCollected"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumHTTPDCVariablesCollected"].Position + 1, sheet.Dimension.Rows, table.Columns["NumHTTPDCVariablesCollected"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumHTTPDCs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumHTTPDCs"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumHTTPDCs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumHTTPDCs"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumMIDCVariablesCollected"].Position + 1, sheet.Dimension.Rows, table.Columns["NumMIDCVariablesCollected"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumMIDCVariablesCollected"].Position + 1, sheet.Dimension.Rows, table.Columns["NumMIDCVariablesCollected"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumMIDCs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumMIDCs"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumMIDCs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumMIDCs"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBaselines"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBaselines"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBaselines"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBaselines"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumTiers"].Position + 1, sheet.Dimension.Rows, table.Columns["NumTiers"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumTiers"].Position + 1, sheet.Dimension.Rows, table.Columns["NumTiers"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBTs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBTs"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_CONFIGURATION_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumBTs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumBTs"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
}
@@ -9348,8 +9461,8 @@ private static bool stepReportApplicationAndEntityMetrics(ProgramOptions program
loggerConsole.Info("List of Controllers");
- sheet = excelReport.Workbook.Worksheets[REPORT_DETECTED_ENTITIES_SHEET_CONTROLLERS];
- readCSVFileIntoExcelRange(controllersAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ sheet = excelReport.Workbook.Worksheets[REPORT_METRICS_ALL_ENTITIES_SHEET_CONTROLLERS];
+ readCSVFileIntoExcelRange(controllersAllReportFilePath, 0, sheet, REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -9358,12 +9471,12 @@ private static bool stepReportApplicationAndEntityMetrics(ProgramOptions program
loggerConsole.Info("List of Applications (Full)");
sheet = excelReport.Workbook.Worksheets[REPORT_METRICS_ALL_ENTITIES_SHEET_APPLICATIONS_FULL];
- readCSVFileIntoExcelRange(applicationsAllFullReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(applicationsAllFullReportFilePath, 0, sheet, REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
loggerConsole.Info("List of Applications (Hourly)");
sheet = excelReport.Workbook.Worksheets[REPORT_METRICS_ALL_ENTITIES_SHEET_APPLICATIONS_HOURLY];
- readCSVFileIntoExcelRange(applicationsAllHourlyReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(applicationsAllHourlyReportFilePath, 0, sheet, REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -9372,12 +9485,12 @@ private static bool stepReportApplicationAndEntityMetrics(ProgramOptions program
loggerConsole.Info("List of Tiers (Full)");
sheet = excelReport.Workbook.Worksheets[REPORT_METRICS_ALL_ENTITIES_SHEET_TIERS_FULL];
- readCSVFileIntoExcelRange(tiersAllFullReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(tiersAllFullReportFilePath, 0, sheet, REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
loggerConsole.Info("List of Tiers (Hourly)");
sheet = excelReport.Workbook.Worksheets[REPORT_METRICS_ALL_ENTITIES_SHEET_TIERS_HOURLY];
- readCSVFileIntoExcelRange(tiersAllHourlyReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(tiersAllHourlyReportFilePath, 0, sheet, REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -9386,12 +9499,12 @@ private static bool stepReportApplicationAndEntityMetrics(ProgramOptions program
loggerConsole.Info("List of Nodes (Full)");
sheet = excelReport.Workbook.Worksheets[REPORT_METRICS_ALL_ENTITIES_SHEET_NODES_FULL];
- readCSVFileIntoExcelRange(nodesAllFullReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(nodesAllFullReportFilePath, 0, sheet, REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
loggerConsole.Info("List of Nodes (Hourly)");
sheet = excelReport.Workbook.Worksheets[REPORT_METRICS_ALL_ENTITIES_SHEET_NODES_HOURLY];
- readCSVFileIntoExcelRange(nodesAllHourlyReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(nodesAllHourlyReportFilePath, 0, sheet, REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -9400,12 +9513,12 @@ private static bool stepReportApplicationAndEntityMetrics(ProgramOptions program
loggerConsole.Info("List of Backends (Full)");
sheet = excelReport.Workbook.Worksheets[REPORT_METRICS_ALL_ENTITIES_SHEET_BACKENDS_FULL];
- readCSVFileIntoExcelRange(backendsAllFullReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(backendsAllFullReportFilePath, 0, sheet, REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
loggerConsole.Info("List of Backends (Hourly)");
sheet = excelReport.Workbook.Worksheets[REPORT_METRICS_ALL_ENTITIES_SHEET_BACKENDS_HOURLY];
- readCSVFileIntoExcelRange(backendsAllHourlyReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(backendsAllHourlyReportFilePath, 0, sheet, REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -9414,12 +9527,12 @@ private static bool stepReportApplicationAndEntityMetrics(ProgramOptions program
loggerConsole.Info("List of Business Transactions (Full)");
sheet = excelReport.Workbook.Worksheets[REPORT_METRICS_ALL_ENTITIES_SHEET_BUSINESS_TRANSACTIONS_FULL];
- readCSVFileIntoExcelRange(businessTransactionsAllFullReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(businessTransactionsAllFullReportFilePath, 0, sheet, REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
loggerConsole.Info("List of Business Transactions (Hourly)");
sheet = excelReport.Workbook.Worksheets[REPORT_METRICS_ALL_ENTITIES_SHEET_BUSINESS_TRANSACTIONS_HOURLY];
- readCSVFileIntoExcelRange(businessTransactionsAllHourlyReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(businessTransactionsAllHourlyReportFilePath, 0, sheet, REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -9428,12 +9541,12 @@ private static bool stepReportApplicationAndEntityMetrics(ProgramOptions program
loggerConsole.Info("List of Service Endpoints (Full)");
sheet = excelReport.Workbook.Worksheets[REPORT_METRICS_ALL_ENTITIES_SHEET_SERVICE_ENDPOINTS_FULL];
- readCSVFileIntoExcelRange(serviceEndpointsAllFullReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(serviceEndpointsAllFullReportFilePath, 0, sheet, REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
loggerConsole.Info("List of Service Endpoints (Hourly)");
sheet = excelReport.Workbook.Worksheets[REPORT_METRICS_ALL_ENTITIES_SHEET_SERVICE_ENDPOINTS_HOURLY];
- readCSVFileIntoExcelRange(serviceEndpointsAllHourlyReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(serviceEndpointsAllHourlyReportFilePath, 0, sheet, REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -9442,12 +9555,12 @@ private static bool stepReportApplicationAndEntityMetrics(ProgramOptions program
loggerConsole.Info("List of Errors (Full)");
sheet = excelReport.Workbook.Worksheets[REPORT_METRICS_ALL_ENTITIES_SHEET_ERRORS_FULL];
- readCSVFileIntoExcelRange(errorsAllFullReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(errorsAllFullReportFilePath, 0, sheet, REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
loggerConsole.Info("List of Errors (Hourly)");
sheet = excelReport.Workbook.Worksheets[REPORT_METRICS_ALL_ENTITIES_SHEET_ERRORS_HOURLY];
- readCSVFileIntoExcelRange(errorsAllHourlyReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(errorsAllHourlyReportFilePath, 0, sheet, REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -9456,12 +9569,12 @@ private static bool stepReportApplicationAndEntityMetrics(ProgramOptions program
loggerConsole.Info("List of Information Points (Full)");
sheet = excelReport.Workbook.Worksheets[REPORT_METRICS_ALL_ENTITIES_SHEET_INFORMATION_POINTS_FULL];
- readCSVFileIntoExcelRange(informationPointsAllFullReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(informationPointsAllFullReportFilePath, 0, sheet, REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
loggerConsole.Info("List of Information Points (Hourly)");
sheet = excelReport.Workbook.Worksheets[REPORT_METRICS_ALL_ENTITIES_SHEET_INFORMATION_POINTS_HOURLY];
- readCSVFileIntoExcelRange(informationPointsAllHourlyReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(informationPointsAllHourlyReportFilePath, 0, sheet, REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -10387,7 +10500,7 @@ private static bool stepReportEventsAndHealthRuleViolations(ProgramOptions progr
ApplicationID = jobTarget.ApplicationID,
Status = jobTarget.Status.ToString()
}, true);
- ExcelTable table = sheet.Tables.Add(range, REPORT_DETECTED_ENTITIES_TABLE_PARAMETERS_TARGETS);
+ ExcelTable table = sheet.Tables.Add(range, REPORT_DETECTED_EVENTS_TABLE_PARAMETERS_TARGETS);
table.ShowHeader = true;
table.TableStyle = TableStyles.Medium2;
table.ShowFilter = true;
@@ -10413,7 +10526,7 @@ private static bool stepReportEventsAndHealthRuleViolations(ProgramOptions progr
sheet.Cells[1, 1].Value = "Table of Contents";
sheet.Cells[1, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SHEET_TOC);
sheet.Cells[1, 2].StyleName = "HyperLinkStyle";
- sheet.View.FreezePanes(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, 1);
+ sheet.View.FreezePanes(REPORT_DETECTED_EVENTS_LIST_SHEET_START_TABLE_AT + 1, 1);
sheet = excelReport.Workbook.Worksheets.Add(REPORT_DETECTED_EVENTS_SHEET_APPLICATIONS);
sheet.Cells[1, 1].Value = "Table of Contents";
@@ -10480,8 +10593,8 @@ private static bool stepReportEventsAndHealthRuleViolations(ProgramOptions progr
loggerConsole.Info("List of Controllers");
- sheet = excelReport.Workbook.Worksheets[REPORT_DETECTED_ENTITIES_SHEET_CONTROLLERS];
- readCSVFileIntoExcelRange(controllersAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ sheet = excelReport.Workbook.Worksheets[REPORT_DETECTED_EVENTS_SHEET_CONTROLLERS];
+ readCSVFileIntoExcelRange(controllersAllReportFilePath, 0, sheet, REPORT_DETECTED_EVENTS_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -10490,7 +10603,7 @@ private static bool stepReportEventsAndHealthRuleViolations(ProgramOptions progr
loggerConsole.Info("List of Applications");
sheet = excelReport.Workbook.Worksheets[REPORT_DETECTED_EVENTS_SHEET_APPLICATIONS];
- readCSVFileIntoExcelRange(applicationEventsSummaryAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(applicationEventsSummaryAllReportFilePath, 0, sheet, REPORT_DETECTED_EVENTS_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -10499,7 +10612,7 @@ private static bool stepReportEventsAndHealthRuleViolations(ProgramOptions progr
loggerConsole.Info("List of Events");
sheet = excelReport.Workbook.Worksheets[REPORT_DETECTED_EVENTS_SHEET_EVENTS];
- readCSVFileIntoExcelRange(eventsAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(eventsAllReportFilePath, 0, sheet, REPORT_DETECTED_EVENTS_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -10508,7 +10621,7 @@ private static bool stepReportEventsAndHealthRuleViolations(ProgramOptions progr
loggerConsole.Info("List of Health Rule Violation Events");
sheet = excelReport.Workbook.Worksheets[REPORT_DETECTED_EVENTS_SHEET_HEALTH_RULE_VIOLATIONS];
- readCSVFileIntoExcelRange(healthRuleViolationEventsAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(healthRuleViolationEventsAllReportFilePath, 0, sheet, REPORT_DETECTED_EVENTS_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -10541,9 +10654,9 @@ private static bool stepReportEventsAndHealthRuleViolations(ProgramOptions progr
sheet = excelReport.Workbook.Worksheets[REPORT_DETECTED_EVENTS_SHEET_APPLICATIONS];
logger.Info("Applications Sheet ({0} rows)", sheet.Dimension.Rows);
loggerConsole.Info("Applications Sheet ({0} rows)", sheet.Dimension.Rows);
- if (sheet.Dimension.Rows > REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT)
+ if (sheet.Dimension.Rows > REPORT_DETECTED_EVENTS_LIST_SHEET_START_TABLE_AT)
{
- range = sheet.Cells[REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT, 1, sheet.Dimension.Rows, sheet.Dimension.Columns];
+ range = sheet.Cells[REPORT_DETECTED_EVENTS_LIST_SHEET_START_TABLE_AT, 1, sheet.Dimension.Rows, sheet.Dimension.Columns];
table = sheet.Tables.Add(range, REPORT_DETECTED_EVENTS_TABLE_APPLICATIONS);
table.ShowHeader = true;
table.TableStyle = TableStyles.Medium2;
@@ -10552,25 +10665,25 @@ private static bool stepReportEventsAndHealthRuleViolations(ProgramOptions progr
adjustColumnsOfEntityRowTableInMetricReport(APPLICATION_TYPE_SHORT, sheet, table);
- ExcelAddress cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumEvents"].Position + 1, sheet.Dimension.Rows, table.Columns["NumEvents"].Position + 1);
+ ExcelAddress cfAddressNum = new ExcelAddress(REPORT_DETECTED_EVENTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumEvents"].Position + 1, sheet.Dimension.Rows, table.Columns["NumEvents"].Position + 1);
var cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumEventsInfo"].Position + 1, sheet.Dimension.Rows, table.Columns["NumEventsInfo"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_DETECTED_EVENTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumEventsInfo"].Position + 1, sheet.Dimension.Rows, table.Columns["NumEventsInfo"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumEventsWarning"].Position + 1, sheet.Dimension.Rows, table.Columns["NumEventsWarning"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_DETECTED_EVENTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumEventsWarning"].Position + 1, sheet.Dimension.Rows, table.Columns["NumEventsWarning"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumEventsError"].Position + 1, sheet.Dimension.Rows, table.Columns["NumEventsError"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_DETECTED_EVENTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumEventsError"].Position + 1, sheet.Dimension.Rows, table.Columns["NumEventsError"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumHRViolations"].Position + 1, sheet.Dimension.Rows, table.Columns["NumHRViolations"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_DETECTED_EVENTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumHRViolations"].Position + 1, sheet.Dimension.Rows, table.Columns["NumHRViolations"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumHRViolationsWarning"].Position + 1, sheet.Dimension.Rows, table.Columns["NumHRViolationsWarning"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_DETECTED_EVENTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumHRViolationsWarning"].Position + 1, sheet.Dimension.Rows, table.Columns["NumHRViolationsWarning"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumHRViolationsCritical"].Position + 1, sheet.Dimension.Rows, table.Columns["NumHRViolationsCritical"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_DETECTED_EVENTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumHRViolationsCritical"].Position + 1, sheet.Dimension.Rows, table.Columns["NumHRViolationsCritical"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
}
@@ -10720,7 +10833,7 @@ private static bool stepReportEventsAndHealthRuleViolations(ProgramOptions progr
}
}
range = sheet.Cells[1, 1, sheet.Dimension.Rows, sheet.Dimension.Columns];
- table = sheet.Tables.Add(range, REPORT_DETECTED_ENTITIES_TABLE_TOC);
+ table = sheet.Tables.Add(range, REPORT_DETECTED_EVENTS_TABLE_TOC);
table.ShowHeader = true;
table.TableStyle = TableStyles.Medium2;
table.ShowFilter = true;
@@ -10824,7 +10937,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
// Parameters sheet
ExcelWorksheet sheet = excelReport.Workbook.Worksheets.Add(REPORT_SHEET_PARAMETERS);
-
+
var hyperLinkStyle = sheet.Workbook.Styles.CreateNamedStyle("HyperLinkStyle");
hyperLinkStyle.Style.Font.UnderLineType = ExcelUnderLineType.Single;
hyperLinkStyle.Style.Font.Color.SetColor(colorBlueForHyperlinks);
@@ -10886,7 +10999,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
ApplicationID = jobTarget.ApplicationID,
Status = jobTarget.Status.ToString()
}, true);
- ExcelTable table = sheet.Tables.Add(range, REPORT_DETECTED_ENTITIES_TABLE_PARAMETERS_TARGETS);
+ ExcelTable table = sheet.Tables.Add(range, REPORT_SNAPSHOTS_TABLE_PARAMETERS_TARGETS);
table.ShowHeader = true;
table.TableStyle = TableStyles.Medium2;
table.ShowFilter = true;
@@ -10981,13 +11094,13 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
sheet.Cells[2, 1].Value = "See Table";
sheet.Cells[2, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SNAPSHOTS_SHEET_EXIT_CALLS);
sheet.Cells[2, 2].StyleName = "HyperLinkStyle";
+ sheet.View.FreezePanes(REPORT_SNAPSHOTS_PIVOT_SHEET_START_PIVOT_AT + REPORT_SNAPSHOTS_PIVOT_SHEET_CHART_HEIGHT + 2, 1);
sheet = excelReport.Workbook.Worksheets.Add(REPORT_SNAPSHOTS_SHEET_SERVICE_ENDPOINT_CALLS);
sheet.Cells[1, 1].Value = "Table of Contents";
sheet.Cells[1, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SHEET_TOC);
sheet.Cells[1, 2].StyleName = "HyperLinkStyle";
sheet.View.FreezePanes(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, 1);
- sheet.View.FreezePanes(REPORT_SNAPSHOTS_PIVOT_SHEET_START_PIVOT_AT + REPORT_SNAPSHOTS_PIVOT_SHEET_CHART_HEIGHT + 2, 1);
sheet = excelReport.Workbook.Worksheets.Add(REPORT_SNAPSHOTS_SHEET_DETECTED_ERRORS);
sheet.Cells[1, 1].Value = "Table of Contents";
@@ -11052,8 +11165,8 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
loggerConsole.Info("List of Controllers");
- sheet = excelReport.Workbook.Worksheets[REPORT_DETECTED_ENTITIES_SHEET_CONTROLLERS];
- readCSVFileIntoExcelRange(controllersAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ sheet = excelReport.Workbook.Worksheets[REPORT_DETECTED_EVENTS_SHEET_CONTROLLERS];
+ readCSVFileIntoExcelRange(controllersAllReportFilePath, 0, sheet, REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -11062,7 +11175,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
loggerConsole.Info("List of Applications");
sheet = excelReport.Workbook.Worksheets[REPORT_DETECTED_EVENTS_SHEET_APPLICATIONS];
- readCSVFileIntoExcelRange(applicationSnapshotsSummaryAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(applicationSnapshotsSummaryAllReportFilePath, 0, sheet, REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -11071,7 +11184,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
loggerConsole.Info("List of Snapshots");
sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_SNAPSHOTS];
- readCSVFileIntoExcelRange(snapshotsAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(snapshotsAllReportFilePath, 0, sheet, REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -11079,7 +11192,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
loggerConsole.Info("List of Segments");
sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_SEGMENTS];
- readCSVFileIntoExcelRange(segmentsAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(segmentsAllReportFilePath, 0, sheet, REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -11088,7 +11201,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
loggerConsole.Info("List of Exit Calls");
sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_EXIT_CALLS];
- readCSVFileIntoExcelRange(callExitsAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(callExitsAllReportFilePath, 0, sheet, REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -11097,7 +11210,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
loggerConsole.Info("List of Service Endpoint Calls");
sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_SERVICE_ENDPOINT_CALLS];
- readCSVFileIntoExcelRange(serviceEndpointCallsAllReporFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(serviceEndpointCallsAllReporFilePath, 0, sheet, REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -11106,7 +11219,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
loggerConsole.Info("List of Detected Errors");
sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_DETECTED_ERRORS];
- readCSVFileIntoExcelRange(detectedErrorsAllReporFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(detectedErrorsAllReporFilePath, 0, sheet, REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -11115,7 +11228,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
loggerConsole.Info("List of Business Data");
sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_BUSINESS_DATA];
- readCSVFileIntoExcelRange(businessDataAllReportFilePath, 0, sheet, REPORT_DETECTED_ENTITIES_LIST_SHEET_START_TABLE_AT, 1);
+ readCSVFileIntoExcelRange(businessDataAllReportFilePath, 0, sheet, REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT, 1);
#endregion
@@ -11159,22 +11272,22 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
adjustColumnsOfEntityRowTableInMetricReport(APPLICATION_TYPE_SHORT, sheet, table);
- ExcelAddress cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshots"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshots"].Position + 1);
+ ExcelAddress cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshots"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshots"].Position + 1);
var cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshotsNormal"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshotsNormal"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshotsNormal"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshotsNormal"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshotsVerySlow"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshotsVerySlow"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshotsVerySlow"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshotsVerySlow"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshotsStall"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshotsStall"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshotsStall"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshotsStall"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshotsSlow"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshotsSlow"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshotsSlow"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshotsSlow"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshotsError"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshotsError"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshotsError"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshotsError"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
}
@@ -11206,7 +11319,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
sheet.Column(table.Columns["OccuredUtc"].Position + 1).Width = 20;
sheet.Column(table.Columns["DetailLink"].Position + 1).Width = 25;
- ExcelAddress cfAddressUserExperience = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["UserExperience"].Position + 1, sheet.Dimension.Rows, table.Columns["UserExperience"].Position + 1);
+ ExcelAddress cfAddressUserExperience = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["UserExperience"].Position + 1, sheet.Dimension.Rows, table.Columns["UserExperience"].Position + 1);
var cfUserExperience = sheet.ConditionalFormatting.AddEqual(cfAddressUserExperience);
cfUserExperience.Style.Font.Color.Color = Color.White;
cfUserExperience.Style.Fill.BackgroundColor.Color = colorGreenForNormalSnapshots;
@@ -11232,7 +11345,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
cfUserExperience.Style.Fill.BackgroundColor.Color = colorRedForErrorSnapshots;
cfUserExperience.Formula = @"=""ERROR""";
- ExcelAddress cfAddressDuration = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["Duration"].Position + 1, sheet.Dimension.Rows, table.Columns["Duration"].Position + 1);
+ ExcelAddress cfAddressDuration = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["Duration"].Position + 1, sheet.Dimension.Rows, table.Columns["Duration"].Position + 1);
var cfDuration = sheet.ConditionalFormatting.AddThreeColorScale(cfAddressDuration);
cfDuration.LowValue.Color = colorGreenFor3ColorScales;
cfDuration.MiddleValue.Type = eExcelConditionalFormattingValueObjectType.Percentile;
@@ -11240,43 +11353,44 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
cfDuration.MiddleValue.Color = colorYellowFor3ColorScales;
cfDuration.HighValue.Color = colorRedFor3ColorScales;
- ExcelAddress cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumErrors"].Position + 1, sheet.Dimension.Rows, table.Columns["NumErrors"].Position + 1);
+ ExcelAddress cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumErrors"].Position + 1, sheet.Dimension.Rows, table.Columns["NumErrors"].Position + 1);
var cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCallGraphs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCallGraphs"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCallGraphs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCallGraphs"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCalledBackends"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCalledBackends"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCalledBackends"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCalledBackends"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCalledTiers"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCalledTiers"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCalledTiers"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCalledTiers"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCalledApplications"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCalledApplications"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCalledApplications"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCalledApplications"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCallsToBackends"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCallsToBackends"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCallsToBackends"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCallsToBackends"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCallsToTiers"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCallsToTiers"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCallsToTiers"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCallsToTiers"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCallsToApplications"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCallsToApplications"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCallsToApplications"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCallsToApplications"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSEPs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSEPs"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSEPs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSEPs"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumHTTPDCs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumHTTPDCs"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumHTTPDCs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumHTTPDCs"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumMIDCs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumMIDCs"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumMIDCs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumMIDCs"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_SNAPSHOTS_PIVOT];
ExcelPivotTable pivot = sheet.PivotTables.Add(sheet.Cells[REPORT_SNAPSHOTS_PIVOT_SHEET_START_PIVOT_AT + REPORT_SNAPSHOTS_PIVOT_SHEET_CHART_HEIGHT, 1], range, REPORT_SNAPSHOTS_PIVOT_SNAPSHOTS);
ExcelPivotTableField fieldF = pivot.PageFields.Add(pivot.Fields["HasErrors"]);
fieldF = pivot.PageFields.Add(pivot.Fields["CallGraphType"]);
+ fieldF = pivot.PageFields.Add(pivot.Fields["DurationRange"]);
ExcelPivotTableField fieldR = pivot.RowFields.Add(pivot.Fields["Controller"]);
fieldR.Compact = false;
fieldR.Outline = false;
@@ -11324,13 +11438,13 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
sheet.Column(table.Columns["BTName"].Position + 1).Width = 20;
sheet.Column(table.Columns["UserExperience"].Position + 1).Width = 10;
sheet.Column(table.Columns["RequestID"].Position + 1).Width = 15;
- sheet.Column(table.Columns["SegmentID"].Position + 1).Width = 15;
- sheet.Column(table.Columns["ParentSegmentID"].Position + 1).Width = 15;
- sheet.Column(table.Columns["ParentTierName"].Position + 1).Width = 20;
+ sheet.Column(table.Columns["SegmentID"].Position + 1).Width = 10;
+ sheet.Column(table.Columns["FromSegmentID"].Position + 1).Width = 15;
+ sheet.Column(table.Columns["FromTierName"].Position + 1).Width = 20;
sheet.Column(table.Columns["Occured"].Position + 1).Width = 20;
sheet.Column(table.Columns["OccuredUtc"].Position + 1).Width = 20;
- ExcelAddress cfAddressUserExperience = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["UserExperience"].Position + 1, sheet.Dimension.Rows, table.Columns["UserExperience"].Position + 1);
+ ExcelAddress cfAddressUserExperience = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["UserExperience"].Position + 1, sheet.Dimension.Rows, table.Columns["UserExperience"].Position + 1);
var cfUserExperience = sheet.ConditionalFormatting.AddEqual(cfAddressUserExperience);
cfUserExperience.Style.Font.Color.Color = Color.White;
cfUserExperience.Style.Fill.BackgroundColor.Color = colorGreenForNormalSnapshots;
@@ -11356,7 +11470,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
cfUserExperience.Style.Fill.BackgroundColor.Color = colorRedForErrorSnapshots;
cfUserExperience.Formula = @"=""ERROR""";
- ExcelAddress cfAddressDuration = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["Duration"].Position + 1, sheet.Dimension.Rows, table.Columns["Duration"].Position + 1);
+ ExcelAddress cfAddressDuration = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["Duration"].Position + 1, sheet.Dimension.Rows, table.Columns["Duration"].Position + 1);
var cfDuration = sheet.ConditionalFormatting.AddThreeColorScale(cfAddressDuration);
cfDuration.LowValue.Color = colorGreenFor3ColorScales;
cfDuration.MiddleValue.Type = eExcelConditionalFormattingValueObjectType.Percentile;
@@ -11364,40 +11478,41 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
cfDuration.MiddleValue.Color = colorYellowFor3ColorScales;
cfDuration.HighValue.Color = colorRedFor3ColorScales;
- ExcelAddress cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumErrors"].Position + 1, sheet.Dimension.Rows, table.Columns["NumErrors"].Position + 1);
+ ExcelAddress cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumErrors"].Position + 1, sheet.Dimension.Rows, table.Columns["NumErrors"].Position + 1);
var cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCalledBackends"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCalledBackends"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCalledBackends"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCalledBackends"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCalledTiers"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCalledTiers"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCalledTiers"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCalledTiers"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCalledApplications"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCalledApplications"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCalledApplications"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCalledApplications"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCallsToBackends"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCallsToBackends"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCallsToBackends"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCallsToBackends"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCallsToTiers"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCallsToTiers"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCallsToTiers"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCallsToTiers"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCallsToApplications"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCallsToApplications"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumCallsToApplications"].Position + 1, sheet.Dimension.Rows, table.Columns["NumCallsToApplications"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSEPs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSEPs"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSEPs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSEPs"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumHTTPDCs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumHTTPDCs"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumHTTPDCs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumHTTPDCs"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- cfAddressNum = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumMIDCs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumMIDCs"].Position + 1);
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumMIDCs"].Position + 1, sheet.Dimension.Rows, table.Columns["NumMIDCs"].Position + 1);
cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_SEGMENTS_PIVOT];
ExcelPivotTable pivot = sheet.PivotTables.Add(sheet.Cells[REPORT_SNAPSHOTS_PIVOT_SHEET_START_PIVOT_AT + REPORT_SNAPSHOTS_PIVOT_SHEET_CHART_HEIGHT, 1], range, REPORT_SNAPSHOTS_PIVOT_SEGMENTS);
ExcelPivotTableField fieldF = pivot.PageFields.Add(pivot.Fields["HasErrors"]);
fieldF = pivot.PageFields.Add(pivot.Fields["CallGraphType"]);
+ fieldF = pivot.PageFields.Add(pivot.Fields["DurationRange"]);
ExcelPivotTableField fieldR = pivot.RowFields.Add(pivot.Fields["Controller"]);
fieldR.Compact = false;
fieldR.Outline = false;
@@ -11444,15 +11559,16 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
sheet.Column(table.Columns["NodeName"].Position + 1).Width = 20;
sheet.Column(table.Columns["BTName"].Position + 1).Width = 20;
sheet.Column(table.Columns["RequestID"].Position + 1).Width = 15;
- sheet.Column(table.Columns["SegmentID"].Position + 1).Width = 15;
+ sheet.Column(table.Columns["SegmentID"].Position + 1).Width = 10;
sheet.Column(table.Columns["ToEntityName"].Position + 1).Width = 15;
sheet.Column(table.Columns["ExitType"].Position + 1).Width = 10;
sheet.Column(table.Columns["Detail"].Position + 1).Width = 20;
sheet.Column(table.Columns["Method"].Position + 1).Width = 20;
+ sheet.Column(table.Columns["ToSegmentID"].Position + 1).Width = 15;
sheet.Column(table.Columns["Occured"].Position + 1).Width = 20;
sheet.Column(table.Columns["OccuredUtc"].Position + 1).Width = 20;
- ExcelAddress cfAddressDuration = new ExcelAddress(REPORT_METRICS_ALL_ENTITIES_LIST_SHEET_START_TABLE_AT + 1, table.Columns["Duration"].Position + 1, sheet.Dimension.Rows, table.Columns["Duration"].Position + 1);
+ ExcelAddress cfAddressDuration = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["Duration"].Position + 1, sheet.Dimension.Rows, table.Columns["Duration"].Position + 1);
var cfDuration = sheet.ConditionalFormatting.AddThreeColorScale(cfAddressDuration);
cfDuration.LowValue.Color = colorGreenFor3ColorScales;
cfDuration.MiddleValue.Type = eExcelConditionalFormattingValueObjectType.Percentile;
@@ -11461,17 +11577,18 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
cfDuration.HighValue.Color = colorRedFor3ColorScales;
sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_EXIT_CALLS_PIVOT];
- ExcelPivotTable pivot = sheet.PivotTables.Add(sheet.Cells[REPORT_SNAPSHOTS_PIVOT_SHEET_START_PIVOT_AT + REPORT_SNAPSHOTS_PIVOT_SHEET_CHART_HEIGHT, 1], range, REPORT_SNAPSHOTS_PIVOT_EXIT_CALLS);
+ ExcelPivotTable pivot = sheet.PivotTables.Add(sheet.Cells[REPORT_SNAPSHOTS_PIVOT_SHEET_START_PIVOT_AT + REPORT_SNAPSHOTS_PIVOT_SHEET_CHART_HEIGHT + 1, 1], range, REPORT_SNAPSHOTS_PIVOT_EXIT_CALLS);
ExcelPivotTableField fieldF = pivot.PageFields.Add(pivot.Fields["ToEntityType"]);
fieldF = pivot.PageFields.Add(pivot.Fields["ToEntityName"]);
fieldF = pivot.PageFields.Add(pivot.Fields["RequestID"]);
- ExcelPivotTableField fieldR = pivot.RowFields.Add(pivot.Fields["Controller"]);
+ fieldF = pivot.PageFields.Add(pivot.Fields["DurationRange"]);
+ ExcelPivotTableField fieldR = pivot.RowFields.Add(pivot.Fields["ExitType"]);
fieldR.Compact = false;
fieldR.Outline = false;
- fieldR = pivot.RowFields.Add(pivot.Fields["ExitType"]);
+ fieldR = pivot.RowFields.Add(pivot.Fields["Detail"]);
fieldR.Compact = false;
fieldR.Outline = false;
- fieldR = pivot.RowFields.Add(pivot.Fields["Detail"]);
+ fieldR = pivot.RowFields.Add(pivot.Fields["Controller"]);
fieldR.Compact = false;
fieldR.Outline = false;
fieldR = pivot.RowFields.Add(pivot.Fields["ApplicationName"]);
@@ -11501,6 +11618,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
pivot = sheet.PivotTables.Add(sheet.Cells[REPORT_SNAPSHOTS_PIVOT_SHEET_START_PIVOT_AT + REPORT_SNAPSHOTS_PIVOT_SHEET_CHART_HEIGHT, 1], range, REPORT_SNAPSHOTS_PIVOT_EXIT_CALLS_DETAILS_DURATION);
fieldF = pivot.PageFields.Add(pivot.Fields["ExitType"]);
fieldF = pivot.PageFields.Add(pivot.Fields["Detail"]);
+ fieldF = pivot.PageFields.Add(pivot.Fields["DurationRange"]);
fieldR = pivot.RowFields.Add(pivot.Fields["Occured"]);
fieldR.AddDateGrouping(eDateGroupBy.Hours | eDateGroupBy.Minutes);
fieldR.Compact = false;
@@ -11537,7 +11655,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
sheet.Column(table.Columns["NodeName"].Position + 1).Width = 20;
sheet.Column(table.Columns["BTName"].Position + 1).Width = 20;
sheet.Column(table.Columns["RequestID"].Position + 1).Width = 15;
- sheet.Column(table.Columns["SegmentID"].Position + 1).Width = 15;
+ sheet.Column(table.Columns["SegmentID"].Position + 1).Width = 10;
sheet.Column(table.Columns["SepName"].Position + 1).Width = 20;
}
@@ -11564,7 +11682,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
sheet.Column(table.Columns["NodeName"].Position + 1).Width = 20;
sheet.Column(table.Columns["BTName"].Position + 1).Width = 20;
sheet.Column(table.Columns["RequestID"].Position + 1).Width = 15;
- sheet.Column(table.Columns["SegmentID"].Position + 1).Width = 15;
+ sheet.Column(table.Columns["SegmentID"].Position + 1).Width = 10;
sheet.Column(table.Columns["ErrorName"].Position + 1).Width = 20;
sheet.Column(table.Columns["ErrorMessage"].Position + 1).Width = 20;
sheet.Column(table.Columns["ErrorDetail"].Position + 1).Width = 20;
@@ -11617,7 +11735,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
sheet.Column(table.Columns["NodeName"].Position + 1).Width = 20;
sheet.Column(table.Columns["BTName"].Position + 1).Width = 20;
sheet.Column(table.Columns["RequestID"].Position + 1).Width = 15;
- sheet.Column(table.Columns["SegmentID"].Position + 1).Width = 15;
+ sheet.Column(table.Columns["SegmentID"].Position + 1).Width = 10;
sheet.Column(table.Columns["DataName"].Position + 1).Width = 20;
sheet.Column(table.Columns["DataValue"].Position + 1).Width = 20;
sheet.Column(table.Columns["DataType"].Position + 1).Width = 10;
@@ -11673,7 +11791,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
}
}
range = sheet.Cells[1, 1, sheet.Dimension.Rows, sheet.Dimension.Columns];
- table = sheet.Tables.Add(range, REPORT_DETECTED_ENTITIES_TABLE_TOC);
+ table = sheet.Tables.Add(range, REPORT_SNAPSHOTS_TABLE_TOC);
table.ShowHeader = true;
table.TableStyle = TableStyles.Medium2;
table.ShowFilter = true;
@@ -11743,7 +11861,7 @@ private static bool stepReportSnapshots(ProgramOptions programOptions, JobConfig
}
}
- private static bool stepReportIndividualApplicationAndEntityDetails(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobStatus jobStatus)
+ private static bool stepReportSnapshotsMethodCallLines(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobStatus jobStatus)
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
@@ -11759,584 +11877,565 @@ private static bool stepReportIndividualApplicationAndEntityDetails(ProgramOptio
try
{
- // Process each target
- for (int i = 0; i < jobConfiguration.Target.Count; i++)
- {
- Stopwatch stopWatchTarget = new Stopwatch();
- stopWatchTarget.Start();
+ loggerConsole.Info("Prepare Snapshots Method Calls Report File");
- JobTarget jobTarget = jobConfiguration.Target[i];
+ #region Prepare the report package
- StepTiming stepTimingTarget = new StepTiming();
- stepTimingTarget.Controller = jobTarget.Controller;
- stepTimingTarget.ApplicationName = jobTarget.Application;
- stepTimingTarget.ApplicationID = jobTarget.ApplicationID;
- stepTimingTarget.JobFileName = programOptions.OutputJobFilePath;
- stepTimingTarget.StepName = jobStatus.ToString();
- stepTimingTarget.StepID = (int)jobStatus;
- stepTimingTarget.StartTime = DateTime.Now;
+ // Prepare package
+ ExcelPackage excelReport = new ExcelPackage();
+ excelReport.Workbook.Properties.Author = String.Format("AppDynamics DEXTER {0}", Assembly.GetEntryAssembly().GetName().Version);
+ excelReport.Workbook.Properties.Title = "AppDynamics DEXTER Snapshots Method Call Lines Report";
+ excelReport.Workbook.Properties.Subject = programOptions.JobName;
- try
- {
- #region Output status
+ excelReport.Workbook.Properties.Comments = String.Format("Targets={0}\nFrom={1:o}\nTo={2:o}", jobConfiguration.Target.Count, jobConfiguration.Input.TimeRange.From, jobConfiguration.Input.TimeRange.To);
- logger.Info("{0}({0:d}): [{1}/{2}], {3} {4}({5})", jobStatus, i + 1, jobConfiguration.Target.Count, jobTarget.Controller, jobTarget.Application, jobTarget.ApplicationID);
- loggerConsole.Trace("{0}({0:d}): [{1}/{2}], {3} {4}({5})", jobStatus, i + 1, jobConfiguration.Target.Count, jobTarget.Controller, jobTarget.Application, jobTarget.ApplicationID);
+ #endregion
- #endregion
+ #region Parameters sheet
- #region Target state check
+ // Parameters sheet
+ ExcelWorksheet sheet = excelReport.Workbook.Worksheets.Add(REPORT_SHEET_PARAMETERS);
- if (jobTarget.Status != JobTargetStatus.ConfigurationValid)
- {
- loggerConsole.Trace("Target in invalid state {0}, skipping", jobTarget.Status);
+ var hyperLinkStyle = sheet.Workbook.Styles.CreateNamedStyle("HyperLinkStyle");
+ hyperLinkStyle.Style.Font.UnderLineType = ExcelUnderLineType.Single;
+ hyperLinkStyle.Style.Font.Color.SetColor(colorBlueForHyperlinks);
- continue;
- }
+ int l = 1;
+ sheet.Cells[l, 1].Value = "Table of Contents";
+ sheet.Cells[l, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SHEET_TOC);
+ sheet.Cells[1, 2].StyleName = "HyperLinkStyle";
+ l++; l++;
+ sheet.Cells[l, 1].Value = "AppDynamics DEXTER Snapshots Method Call Lines Report";
+ l++;
+ sheet.Cells[l, 1].Value = "Version";
+ sheet.Cells[l, 2].Value = Assembly.GetEntryAssembly().GetName().Version;
+ l++; l++;
+ sheet.Cells[l, 1].Value = "From";
+ sheet.Cells[l, 2].Value = jobConfiguration.Input.TimeRange.From.ToString("G");
+ l++;
+ sheet.Cells[l, 1].Value = "To";
+ sheet.Cells[l, 2].Value = jobConfiguration.Input.TimeRange.To.ToString("G");
+ l++;
+ sheet.Cells[l, 1].Value = "Expanded From (UTC)";
+ sheet.Cells[l, 2].Value = jobConfiguration.Input.ExpandedTimeRange.From.ToString("G");
+ l++;
+ sheet.Cells[l, 1].Value = "Expanded From (Local)";
+ sheet.Cells[l, 2].Value = jobConfiguration.Input.ExpandedTimeRange.From.ToLocalTime().ToString("G");
+ l++;
+ sheet.Cells[l, 1].Value = "Expanded To (UTC)";
+ sheet.Cells[l, 2].Value = jobConfiguration.Input.ExpandedTimeRange.To.ToString("G");
+ l++;
+ sheet.Cells[l, 1].Value = "Expanded To (Local)";
+ sheet.Cells[l, 2].Value = jobConfiguration.Input.ExpandedTimeRange.To.ToLocalTime().ToString("G");
+ l++;
+ sheet.Cells[l, 1].Value = "Number of Hours Intervals";
+ sheet.Cells[l, 2].Value = jobConfiguration.Input.HourlyTimeRanges.Count;
+ l++;
+ sheet.Cells[l, 1].Value = "Export Metrics";
+ sheet.Cells[l, 2].Value = jobConfiguration.Input.Metrics;
+ l++;
+ sheet.Cells[l, 1].Value = "Export Snapshots";
+ sheet.Cells[l, 2].Value = jobConfiguration.Input.Snapshots;
+ l++;
+ sheet.Cells[l, 1].Value = "Export Flowmaps";
+ sheet.Cells[l, 2].Value = jobConfiguration.Input.Flowmaps;
+ l++;
+ sheet.Cells[l, 1].Value = "Export Configuration";
+ sheet.Cells[l, 2].Value = jobConfiguration.Input.Configuration;
+ l++;
+ sheet.Cells[l, 1].Value = "Export Events";
+ sheet.Cells[l, 2].Value = jobConfiguration.Input.Events;
+ l++;
+ sheet.Cells[l, 1].Value = "Targets:";
+ l++; l++;
+ ExcelRangeBase range = sheet.Cells[l, 1].LoadFromCollection(from jobTarget in jobConfiguration.Target
+ select new
+ {
+ Controller = jobTarget.Controller,
+ UserName = jobTarget.UserName,
+ Application = jobTarget.Application,
+ ApplicationID = jobTarget.ApplicationID,
+ Status = jobTarget.Status.ToString()
+ }, true);
+ ExcelTable table = sheet.Tables.Add(range, REPORT_SNAPSHOTS_TABLE_PARAMETERS_TARGETS);
+ table.ShowHeader = true;
+ table.TableStyle = TableStyles.Medium2;
+ table.ShowFilter = true;
+ table.ShowTotal = false;
- #endregion
+ sheet.Column(1).Width = 25;
+ sheet.Column(2).Width = 25;
+ sheet.Column(3).Width = 25;
- #region Target step variables
+ #endregion
- // Various folders
- string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
- string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
- string metricsFolderPath = Path.Combine(applicationFolderPath, METRICS_FOLDER_NAME);
- string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
- string eventsFolderPath = Path.Combine(applicationFolderPath, EVENTS_FOLDER_NAME);
- string snapshotsFolderPath = Path.Combine(applicationFolderPath, SNAPSHOTS_FOLDER_NAME);
+ #region TOC sheet
- // Report files
- string applicationReportFilePath = Path.Combine(applicationFolderPath, CONVERT_ENTITY_APPLICATION_FILE_NAME);
- string tiersReportFilePath = Path.Combine(entitiesFolderPath, CONVERT_ENTITY_TIERS_FILE_NAME);
- string nodesReportFilePath = Path.Combine(entitiesFolderPath, CONVERT_ENTITY_NODES_FILE_NAME);
- string backendsReportFilePath = Path.Combine(entitiesFolderPath, CONVERT_ENTITY_BACKENDS_FILE_NAME);
- string businessTransactionsReportFilePath = Path.Combine(entitiesFolderPath, CONVERT_ENTITY_BUSINESS_TRANSACTIONS_FILE_NAME);
- string serviceEndpointsReportFilePath = Path.Combine(entitiesFolderPath, CONVERT_ENTITY_SERVICE_ENDPOINTS_FILE_NAME);
- string errorsReportFilePath = Path.Combine(entitiesFolderPath, CONVERT_ENTITY_ERRORS_FILE_NAME);
+ // Navigation sheet with link to other sheets
+ sheet = excelReport.Workbook.Worksheets.Add(REPORT_SHEET_TOC);
- string eventsFilePath = Path.Combine(eventsFolderPath, CONVERT_EVENTS_FILE_NAME);
- string healthRuleViolationEventsFilePath = Path.Combine(eventsFolderPath, CONVERT_HEALTH_RULE_EVENTS_FILE_NAME);
- string snapshotsFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_FILE_NAME);
- string segmentsFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_FILE_NAME);
- string exitCallsFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_EXIT_CALLS_FILE_NAME);
- string serviceEndpointCallsFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_SERVICE_ENDPOINTS_CALLS_FILE_NAME);
- string detectedErrorsFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_DETECTED_ERRORS_FILE_NAME);
- string businessDataFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_BUSINESS_DATA_FILE_NAME);
+ #endregion
- string metricsEntityFolderPath = String.Empty;
- string entitiesFullRangeReportFilePath = String.Empty;
+ #region Entity sheets and their associated pivot
- #endregion
+ // Entity sheets
+ sheet = excelReport.Workbook.Worksheets.Add(REPORT_SNAPSHOTS_SHEET_CONTROLLERS);
+ sheet.Cells[1, 1].Value = "Table of Contents";
+ sheet.Cells[1, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SHEET_TOC);
+ sheet.Cells[1, 2].StyleName = "HyperLinkStyle";
+ sheet.View.FreezePanes(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, 1);
- #region Preload all the reports that will be filtered by the subsequent entities
+ sheet = excelReport.Workbook.Worksheets.Add(REPORT_SNAPSHOTS_SHEET_APPLICATIONS);
+ sheet.Cells[1, 1].Value = "Table of Contents";
+ sheet.Cells[1, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SHEET_TOC);
+ sheet.Cells[1, 2].StyleName = "HyperLinkStyle";
+ sheet.View.FreezePanes(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, 1);
- loggerConsole.Info("Entity Details Data Preloading");
+ sheet = excelReport.Workbook.Worksheets.Add(REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES);
+ sheet.Cells[1, 1].Value = "Table of Contents";
+ sheet.Cells[1, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SHEET_TOC);
+ sheet.Cells[1, 2].StyleName = "HyperLinkStyle";
+ sheet.Cells[2, 1].Value = "See Pivot Type";
+ sheet.Cells[2, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_TYPE_PIVOT);
+ sheet.Cells[2, 2].StyleName = "HyperLinkStyle";
+ sheet.Cells[3, 1].Value = "See Pivot Location";
+ sheet.Cells[3, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_LOCATION_PIVOT);
+ sheet.Cells[3, 2].StyleName = "HyperLinkStyle";
+ sheet.View.FreezePanes(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, 1);
- List eventsAllList = FileIOHelper.readListFromCSVFile(eventsFilePath, new EventReportMap());
- List healthRuleViolationEventsAllList = FileIOHelper.readListFromCSVFile(healthRuleViolationEventsFilePath, new HealthRuleViolationEventReportMap());
- List snapshotsAllList = FileIOHelper.readListFromCSVFile(snapshotsFilePath, new SnapshotReportMap());
- List segmentsAllList = FileIOHelper.readListFromCSVFile(segmentsFilePath, new SegmentReportMap());
- List exitCallsAllList = FileIOHelper.readListFromCSVFile(exitCallsFilePath, new ExitCallReportMap());
- List serviceEndpointCallsAllList = FileIOHelper.readListFromCSVFile(serviceEndpointCallsFilePath, new ServiceEndpointCallReportMap());
- List detectedErrorsAllList = FileIOHelper.readListFromCSVFile(detectedErrorsFilePath, new DetectedErrorReportMap());
- List businessDataAllList = FileIOHelper.readListFromCSVFile(businessDataFilePath, new BusinessDataReportMap());
+ sheet = excelReport.Workbook.Worksheets.Add(REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_TYPE_PIVOT);
+ sheet.Cells[1, 1].Value = "Table of Contents";
+ sheet.Cells[1, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SHEET_TOC);
+ sheet.Cells[1, 2].StyleName = "HyperLinkStyle";
+ sheet.Cells[2, 1].Value = "See Table";
+ sheet.Cells[2, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES);
+ sheet.Cells[2, 2].StyleName = "HyperLinkStyle";
+ sheet.View.FreezePanes(REPORT_SNAPSHOTS_PIVOT_SHEET_START_PIVOT_AT + REPORT_SNAPSHOTS_PIVOT_SHEET_CHART_HEIGHT + 5, 1);
- #endregion
+ sheet = excelReport.Workbook.Worksheets.Add(REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_LOCATION_PIVOT);
+ sheet.Cells[1, 1].Value = "Table of Contents";
+ sheet.Cells[1, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SHEET_TOC);
+ sheet.Cells[1, 2].StyleName = "HyperLinkStyle";
+ sheet.Cells[2, 1].Value = "See Table";
+ sheet.Cells[2, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES);
+ sheet.Cells[2, 2].StyleName = "HyperLinkStyle";
+ sheet.View.FreezePanes(REPORT_SNAPSHOTS_PIVOT_SHEET_START_PIVOT_AT + REPORT_SNAPSHOTS_PIVOT_SHEET_CHART_HEIGHT + 3, 1);
- #region Application
+ sheet = excelReport.Workbook.Worksheets.Add(REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_OCCURRENCES);
+ sheet.Cells[1, 1].Value = "Table of Contents";
+ sheet.Cells[1, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SHEET_TOC);
+ sheet.Cells[1, 2].StyleName = "HyperLinkStyle";
+ sheet.Cells[2, 1].Value = "See Pivot Type";
+ sheet.Cells[2, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_OCCURRENCES_TYPE_PIVOT);
+ sheet.Cells[2, 2].StyleName = "HyperLinkStyle";
+ sheet.Cells[3, 1].Value = "See Pivot Location";
+ sheet.Cells[3, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_OCCURRENCES_LOCATION_PIVOT);
+ sheet.Cells[3, 2].StyleName = "HyperLinkStyle";
+ sheet.View.FreezePanes(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, 1);
- List applicationList = FileIOHelper.readListFromCSVFile(applicationReportFilePath, new ApplicationEntityReportMap());
+ sheet = excelReport.Workbook.Worksheets.Add(REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_OCCURRENCES_TYPE_PIVOT);
+ sheet.Cells[1, 1].Value = "Table of Contents";
+ sheet.Cells[1, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SHEET_TOC);
+ sheet.Cells[1, 2].StyleName = "HyperLinkStyle";
+ sheet.Cells[2, 1].Value = "See Table";
+ sheet.Cells[2, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_OCCURRENCES);
+ sheet.Cells[2, 2].StyleName = "HyperLinkStyle";
+ sheet.View.FreezePanes(REPORT_SNAPSHOTS_PIVOT_SHEET_START_PIVOT_AT + REPORT_SNAPSHOTS_PIVOT_SHEET_CHART_HEIGHT + 5, 1);
- metricsEntityFolderPath = Path.Combine(metricsFolderPath, APPLICATION_TYPE_SHORT);
- entitiesFullRangeReportFilePath = Path.Combine(metricsEntityFolderPath, CONVERT_ENTITY_METRICS_FULLRANGE_FILE_NAME);
- List applicationMetricsList = FileIOHelper.readListFromCSVFile(entitiesFullRangeReportFilePath, new ApplicationMetricReportMap());
+ sheet = excelReport.Workbook.Worksheets.Add(REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_OCCURRENCES_LOCATION_PIVOT);
+ sheet.Cells[1, 1].Value = "Table of Contents";
+ sheet.Cells[1, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SHEET_TOC);
+ sheet.Cells[1, 2].StyleName = "HyperLinkStyle";
+ sheet.Cells[2, 1].Value = "See Table";
+ sheet.Cells[2, 2].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_OCCURRENCES);
+ sheet.Cells[2, 2].StyleName = "HyperLinkStyle";
+ sheet.View.FreezePanes(REPORT_SNAPSHOTS_PIVOT_SHEET_START_PIVOT_AT + REPORT_SNAPSHOTS_PIVOT_SHEET_CHART_HEIGHT + 4, 1);
- if (applicationList != null && applicationList.Count > 0)
- {
- loggerConsole.Info("Entity Details for Application");
+ #endregion
- stepTimingTarget.NumEntities = stepTimingTarget.NumEntities + 1;
+ #region Report file variables
- reportMetricDetailApplication(
- programOptions,
- jobConfiguration,
- jobTarget,
- applicationList[0],
- (applicationMetricsList != null && applicationMetricsList.Count > 0) ? applicationMetricsList[0] : null,
- eventsAllList,
- healthRuleViolationEventsAllList,
- snapshotsAllList,
- segmentsAllList,
- exitCallsAllList,
- serviceEndpointCallsAllList,
- detectedErrorsAllList,
- businessDataAllList);
- }
+ // Various folders
+ string reportFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
+ string entitiesAllFolderPath = Path.Combine(reportFolderPath, ENTITIES_FOLDER_NAME);
+ string snapshotsAllFolderPath = Path.Combine(reportFolderPath, SNAPSHOTS_FOLDER_NAME);
- #endregion
+ // Report files for All
+ string controllersAllReportFilePath = Path.Combine(entitiesAllFolderPath, CONVERT_ENTITY_CONTROLLERS_FILE_NAME);
+ string methodCallLinesAllReportFilePath = Path.Combine(snapshotsAllFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_METHOD_CALL_LINES_FILE_NAME);
+ string methodCallLinesOccurrencesAllReportFilePath = Path.Combine(snapshotsAllFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_METHOD_CALL_LINES_OCCURRENCES_FILE_NAME);
+ string applicationSnapshotsSummaryAllReportFilePath = Path.Combine(snapshotsAllFolderPath, CONVERT_APPLICATION_SNAPSHOTS_FILE_NAME);
- #region Tier
+ #endregion
- List tiersList = FileIOHelper.readListFromCSVFile(tiersReportFilePath, new TierEntityReportMap());
+ loggerConsole.Info("Fill Snapshots Method Call Lines Report File");
- metricsEntityFolderPath = Path.Combine(metricsFolderPath, TIERS_TYPE_SHORT);
- entitiesFullRangeReportFilePath = Path.Combine(metricsEntityFolderPath, CONVERT_ENTITIES_METRICS_FULLRANGE_FILE_NAME);
- List tiersMetricsList = FileIOHelper.readListFromCSVFile(entitiesFullRangeReportFilePath, new TierMetricReportMap());
+ #region Controllers
- if (tiersList != null)
- {
- loggerConsole.Info("Entity Details for Tiers ({0} entities)", tiersList.Count);
+ loggerConsole.Info("List of Controllers");
- stepTimingTarget.NumEntities = stepTimingTarget.NumEntities + tiersList.Count;
+ sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_CONTROLLERS];
+ readCSVFileIntoExcelRange(controllersAllReportFilePath, 0, sheet, REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT, 1);
- int j = 0;
+ #endregion
- if (programOptions.ProcessSequentially == false)
- {
- var tiersListChunks = tiersList.BreakListIntoChunks(METRIC_DETAILS_REPORT_NUMBER_OF_ENTITIES_TO_PROCESS_PER_THREAD);
+ #region Applications
- Parallel.ForEach, int>(
- tiersListChunks,
- () => 0,
- (tiersListChunk, loop, subtotal) =>
- {
- subtotal += reportMetricDetailTiers(
- programOptions,
- jobConfiguration,
- jobTarget,
- tiersListChunk,
- tiersMetricsList,
- eventsAllList,
- healthRuleViolationEventsAllList,
- snapshotsAllList,
- segmentsAllList,
- exitCallsAllList,
- serviceEndpointCallsAllList,
- detectedErrorsAllList,
- businessDataAllList,
- false);
- return subtotal;
- },
- (finalResult) =>
- {
- j = Interlocked.Add(ref j, finalResult);
- Console.Write("[{0}].", j);
- }
- );
- }
- else
- {
- j = reportMetricDetailTiers(
- programOptions,
- jobConfiguration,
- jobTarget,
- tiersList,
- tiersMetricsList,
- eventsAllList,
- healthRuleViolationEventsAllList,
- snapshotsAllList,
- segmentsAllList,
- exitCallsAllList,
- serviceEndpointCallsAllList,
- detectedErrorsAllList,
- businessDataAllList,
- true);
- }
+ loggerConsole.Info("List of Applications");
- loggerConsole.Info("{0} entities", j);
- }
+ sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_APPLICATIONS];
+ readCSVFileIntoExcelRange(applicationSnapshotsSummaryAllReportFilePath, 0, sheet, REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT, 1);
- #endregion
+ #endregion
- #region Nodes
+ #region Method Call Lines
- List nodesList = FileIOHelper.readListFromCSVFile(nodesReportFilePath, new NodeEntityReportMap());
+ loggerConsole.Info("List of Method Call Lines");
- metricsEntityFolderPath = Path.Combine(metricsFolderPath, NODES_TYPE_SHORT);
- entitiesFullRangeReportFilePath = Path.Combine(metricsEntityFolderPath, CONVERT_ENTITIES_METRICS_FULLRANGE_FILE_NAME);
- List nodesMetricsList = FileIOHelper.readListFromCSVFile(entitiesFullRangeReportFilePath, new NodeMetricReportMap());
+ sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES];
+ readCSVFileIntoExcelRange(methodCallLinesAllReportFilePath, 0, sheet, REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT, 1);
- if (nodesList != null)
- {
- loggerConsole.Info("Entity Details for Nodes ({0} entities)", nodesList.Count);
+ #endregion
- stepTimingTarget.NumEntities = stepTimingTarget.NumEntities + nodesList.Count;
+ #region Method Call Occurrences
- int j = 0;
+ loggerConsole.Info("List of Method Call Occurrences");
- if (programOptions.ProcessSequentially == false)
- {
- var nodesListChunks = nodesList.BreakListIntoChunks(METRIC_DETAILS_REPORT_NUMBER_OF_ENTITIES_TO_PROCESS_PER_THREAD);
+ sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_OCCURRENCES];
+ readCSVFileIntoExcelRange(methodCallLinesOccurrencesAllReportFilePath, 0, sheet, REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT, 1);
- Parallel.ForEach, int>(
- nodesListChunks,
- () => 0,
- (nodesListChunk, loop, subtotal) =>
- {
- subtotal += reportMetricDetailNodes(
- programOptions,
- jobConfiguration,
- jobTarget,
- nodesListChunk,
- nodesMetricsList,
- eventsAllList,
- healthRuleViolationEventsAllList,
- snapshotsAllList,
- segmentsAllList,
- exitCallsAllList,
- serviceEndpointCallsAllList,
- detectedErrorsAllList,
- businessDataAllList,
- false);
- return subtotal;
- },
- (finalResult) =>
- {
- j = Interlocked.Add(ref j, finalResult);
- Console.Write("[{0}].", j);
- }
- );
- }
- else
- {
- j = reportMetricDetailNodes(
- programOptions,
- jobConfiguration,
- jobTarget,
- nodesList,
- nodesMetricsList,
- eventsAllList,
- healthRuleViolationEventsAllList,
- snapshotsAllList,
- segmentsAllList,
- exitCallsAllList,
- serviceEndpointCallsAllList,
- detectedErrorsAllList,
- businessDataAllList,
- true);
- }
+ #endregion
- loggerConsole.Info("{0} entities", j);
- }
+ loggerConsole.Info("Finalize Snapshots Method Call Lines Report File");
- #endregion
+ #region Controllers sheet
- #region Backends
+ // Make table
+ sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_CONTROLLERS];
+ logger.Info("Controllers Sheet ({0} rows)", sheet.Dimension.Rows);
+ loggerConsole.Info("Controllers Sheet ({0} rows)", sheet.Dimension.Rows);
+ if (sheet.Dimension.Rows > REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT)
+ {
+ range = sheet.Cells[REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT, 1, sheet.Dimension.Rows, sheet.Dimension.Columns];
+ table = sheet.Tables.Add(range, REPORT_SNAPSHOTS_TABLE_CONTROLLERS);
+ table.ShowHeader = true;
+ table.TableStyle = TableStyles.Medium2;
+ table.ShowFilter = true;
+ table.ShowTotal = false;
- List backendsList = FileIOHelper.readListFromCSVFile(backendsReportFilePath, new BackendEntityReportMap());
+ sheet.Column(table.Columns["Controller"].Position + 1).Width = 25;
+ sheet.Column(table.Columns["UserName"].Position + 1).Width = 25;
+ }
- metricsEntityFolderPath = Path.Combine(metricsFolderPath, BACKENDS_TYPE_SHORT);
- entitiesFullRangeReportFilePath = Path.Combine(metricsEntityFolderPath, CONVERT_ENTITIES_METRICS_FULLRANGE_FILE_NAME);
- List backendsMetricsList = FileIOHelper.readListFromCSVFile(entitiesFullRangeReportFilePath, new BackendMetricReportMap());
+ #endregion
- if (backendsList != null)
- {
- loggerConsole.Info("Entity Details for Backends ({0} entities)", backendsList.Count);
+ #region Applications
- stepTimingTarget.NumEntities = stepTimingTarget.NumEntities + backendsList.Count;
+ // Make table
+ sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_APPLICATIONS];
+ logger.Info("Applications Sheet ({0} rows)", sheet.Dimension.Rows);
+ loggerConsole.Info("Applications Sheet ({0} rows)", sheet.Dimension.Rows);
+ if (sheet.Dimension.Rows > REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT)
+ {
+ range = sheet.Cells[REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT, 1, sheet.Dimension.Rows, sheet.Dimension.Columns];
+ table = sheet.Tables.Add(range, REPORT_SNAPSHOTS_TABLE_APPLICATIONS);
+ table.ShowHeader = true;
+ table.TableStyle = TableStyles.Medium2;
+ table.ShowFilter = true;
+ table.ShowTotal = false;
- int j = 0;
+ adjustColumnsOfEntityRowTableInMetricReport(APPLICATION_TYPE_SHORT, sheet, table);
- if (programOptions.ProcessSequentially == false)
- {
- var backendsListChunks = backendsList.BreakListIntoChunks(METRIC_DETAILS_REPORT_NUMBER_OF_ENTITIES_TO_PROCESS_PER_THREAD);
+ ExcelAddress cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshots"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshots"].Position + 1);
+ var cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- Parallel.ForEach, int>(
- backendsListChunks,
- () => 0,
- (backendsListChunk, loop, subtotal) =>
- {
- subtotal += reportMetricDetailBackends(
- programOptions,
- jobConfiguration,
- jobTarget,
- backendsListChunk,
- backendsMetricsList,
- eventsAllList,
- healthRuleViolationEventsAllList,
- snapshotsAllList,
- segmentsAllList,
- exitCallsAllList,
- serviceEndpointCallsAllList,
- detectedErrorsAllList,
- businessDataAllList,
- false);
- return subtotal;
- },
- (finalResult) =>
- {
- j = Interlocked.Add(ref j, finalResult);
- Console.Write("[{0}].", j);
- }
- );
- }
- else
- {
- j = reportMetricDetailBackends(
- programOptions,
- jobConfiguration,
- jobTarget,
- backendsList,
- backendsMetricsList,
- eventsAllList,
- healthRuleViolationEventsAllList,
- snapshotsAllList,
- segmentsAllList,
- exitCallsAllList,
- serviceEndpointCallsAllList,
- detectedErrorsAllList,
- businessDataAllList,
- true);
- }
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshotsNormal"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshotsNormal"].Position + 1);
+ cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- loggerConsole.Info("{0} entities", j);
- }
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshotsVerySlow"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshotsVerySlow"].Position + 1);
+ cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- #endregion
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshotsStall"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshotsStall"].Position + 1);
+ cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- #region Business Transactions
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshotsSlow"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshotsSlow"].Position + 1);
+ cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
- List businessTransactionsList = FileIOHelper.readListFromCSVFile(businessTransactionsReportFilePath, new BusinessTransactionEntityReportMap());
+ cfAddressNum = new ExcelAddress(REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT + 1, table.Columns["NumSnapshotsError"].Position + 1, sheet.Dimension.Rows, table.Columns["NumSnapshotsError"].Position + 1);
+ cfNum = sheet.ConditionalFormatting.AddDatabar(cfAddressNum, colorLightBlueForDatabars);
+ }
- metricsEntityFolderPath = Path.Combine(metricsFolderPath, BUSINESS_TRANSACTIONS_TYPE_SHORT);
- entitiesFullRangeReportFilePath = Path.Combine(metricsEntityFolderPath, CONVERT_ENTITIES_METRICS_FULLRANGE_FILE_NAME);
- List businessTransactionsMetricsList = FileIOHelper.readListFromCSVFile(entitiesFullRangeReportFilePath, new BusinessTransactionMetricReportMap());
+ #endregion
- if (businessTransactionsList != null)
- {
- loggerConsole.Info("Entity Details for Business Transactions ({0} entities)", businessTransactionsList.Count);
+ #region Method Call Lines
- stepTimingTarget.NumEntities = stepTimingTarget.NumEntities + businessTransactionsList.Count;
+ // Make table
+ sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES];
+ logger.Info("Method Call Lines Sheet ({0} rows)", sheet.Dimension.Rows);
+ loggerConsole.Info("Method Call Lines Sheet ({0} rows)", sheet.Dimension.Rows);
+ if (sheet.Dimension.Rows > REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT)
+ {
+ range = sheet.Cells[REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT, 1, sheet.Dimension.Rows, sheet.Dimension.Columns];
+ table = sheet.Tables.Add(range, REPORT_SNAPSHOTS_TABLE_METHOD_CALL_LINES);
+ table.ShowHeader = true;
+ table.TableStyle = TableStyles.Medium2;
+ table.ShowFilter = true;
+ table.ShowTotal = false;
+
+ sheet.Column(table.Columns["Controller"].Position + 1).Width = 20;
+ sheet.Column(table.Columns["ApplicationName"].Position + 1).Width = 20;
+ sheet.Column(table.Columns["TierName"].Position + 1).Width = 20;
+ sheet.Column(table.Columns["NodeName"].Position + 1).Width = 20;
+ sheet.Column(table.Columns["BTName"].Position + 1).Width = 20;
+ sheet.Column(table.Columns["RequestID"].Position + 1).Width = 20;
+ sheet.Column(table.Columns["SegmentID"].Position + 1).Width = 10;
+ sheet.Column(table.Columns["Type"].Position + 1).Width = 15;
+ sheet.Column(table.Columns["Framework"].Position + 1).Width = 15;
+ sheet.Column(table.Columns["FullNameIndent"].Position + 1).Width = 45;
+ sheet.Column(table.Columns["ExitCalls"].Position + 1).Width = 15;
+
+ sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_TYPE_PIVOT];
+ ExcelPivotTable pivot = sheet.PivotTables.Add(sheet.Cells[REPORT_SNAPSHOTS_PIVOT_SHEET_START_PIVOT_AT + REPORT_SNAPSHOTS_PIVOT_SHEET_CHART_HEIGHT + 2, 1], range, REPORT_SNAPSHOTS_PIVOT_METHOD_CALL_LINES_TYPE);
+ ExcelPivotTableField fieldF = pivot.PageFields.Add(pivot.Fields["ElementType"]);
+ fieldF = pivot.PageFields.Add(pivot.Fields["NumChildren"]);
+ fieldF = pivot.PageFields.Add(pivot.Fields["NumExits"]);
+ fieldF = pivot.PageFields.Add(pivot.Fields["Depth"]);
+ fieldF = pivot.PageFields.Add(pivot.Fields["ExecRange"]);
+ ExcelPivotTableField fieldR = pivot.RowFields.Add(pivot.Fields["Controller"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["ApplicationName"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["TierName"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["BTName"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["FullName"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ ExcelPivotTableField fieldC = pivot.ColumnFields.Add(pivot.Fields["Type"]);
+ fieldC.Compact = false;
+ fieldC.Outline = false;
+ fieldC = pivot.ColumnFields.Add(pivot.Fields["Framework"]);
+ fieldC.Compact = false;
+ fieldC.Outline = false;
+ ExcelPivotTableDataField fieldD = pivot.DataFields.Add(pivot.Fields["Exec"]);
+ fieldD.Function = DataFieldFunctions.Average;
- int j = 0;
+ ExcelChart chart = sheet.Drawings.AddChart(REPORT_SNAPSHOTS_PIVOT_METHOD_CALL_LINES_GRAPH_TYPE, eChartType.ColumnClustered, pivot);
+ chart.SetPosition(2, 0, 0, 0);
+ chart.SetSize(800, 300);
- if (programOptions.ProcessSequentially == false)
- {
- var businessTransactionsListChunks = businessTransactionsList.BreakListIntoChunks(METRIC_DETAILS_REPORT_NUMBER_OF_ENTITIES_TO_PROCESS_PER_THREAD);
+ sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_LOCATION_PIVOT];
+ pivot = sheet.PivotTables.Add(sheet.Cells[REPORT_SNAPSHOTS_PIVOT_SHEET_START_PIVOT_AT + REPORT_SNAPSHOTS_PIVOT_SHEET_CHART_HEIGHT + 2, 1], range, REPORT_SNAPSHOTS_PIVOT_METHOD_CALL_LINES_LOCATION);
+ fieldF = pivot.PageFields.Add(pivot.Fields["ElementType"]);
+ fieldF = pivot.PageFields.Add(pivot.Fields["NumChildren"]);
+ fieldF = pivot.PageFields.Add(pivot.Fields["NumExits"]);
+ fieldF = pivot.PageFields.Add(pivot.Fields["Depth"]);
+ fieldF = pivot.PageFields.Add(pivot.Fields["ExecRange"]);
+ fieldR = pivot.RowFields.Add(pivot.Fields["Type"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["Framework"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["FullName"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["Controller"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["ApplicationName"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["TierName"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["BTName"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldD = pivot.DataFields.Add(pivot.Fields["Exec"]);
+ fieldD.Function = DataFieldFunctions.Count;
+ fieldD.Name = "Number of Items";
+ fieldD = pivot.DataFields.Add(pivot.Fields["Exec"]);
+ fieldD.Function = DataFieldFunctions.Average;
+ fieldD.Name = "Average Duration";
+ fieldD = pivot.DataFields.Add(pivot.Fields["Exec"]);
+ fieldD.Function = DataFieldFunctions.Sum;
+ fieldD.Name = "Total Duration";
- Parallel.ForEach, int>(
- businessTransactionsListChunks,
- () => 0,
- (businessTransactionsListChunk, loop, subtotal) =>
- {
- subtotal += reportMetricDetailBusinessTransactions(
- programOptions,
- jobConfiguration,
- jobTarget,
- businessTransactionsListChunk,
- businessTransactionsMetricsList,
- eventsAllList,
- healthRuleViolationEventsAllList,
- snapshotsAllList,
- segmentsAllList,
- exitCallsAllList,
- serviceEndpointCallsAllList,
- detectedErrorsAllList,
- businessDataAllList,
- false);
- return subtotal;
- },
- (finalResult) =>
- {
- j = Interlocked.Add(ref j, finalResult);
- Console.Write("[{0}].", j);
- }
- );
- }
- else
- {
- j = reportMetricDetailBusinessTransactions(
- programOptions,
- jobConfiguration,
- jobTarget,
- businessTransactionsList,
- businessTransactionsMetricsList,
- eventsAllList,
- healthRuleViolationEventsAllList,
- snapshotsAllList,
- segmentsAllList,
- exitCallsAllList,
- serviceEndpointCallsAllList,
- detectedErrorsAllList,
- businessDataAllList,
- true);
- }
+ chart = sheet.Drawings.AddChart(REPORT_SNAPSHOTS_PIVOT_METHOD_CALL_LINES_GRAPH_LOCATION, eChartType.ColumnClustered, pivot);
+ chart.SetPosition(2, 0, 0, 0);
+ chart.SetSize(800, 300);
+ }
- loggerConsole.Info("{0} entities", j);
- }
+ #endregion
- #endregion
+ #region Method Call Occurrences
- #region Service Endpoints
+ // Make table
+ sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_OCCURRENCES];
+ logger.Info("Method Call Occurrences Sheet ({0} rows)", sheet.Dimension.Rows);
+ loggerConsole.Info("Method Call Occurrences Sheet ({0} rows)", sheet.Dimension.Rows);
+ if (sheet.Dimension.Rows > REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT)
+ {
+ range = sheet.Cells[REPORT_SNAPSHOTS_LIST_SHEET_START_TABLE_AT, 1, sheet.Dimension.Rows, sheet.Dimension.Columns];
+ table = sheet.Tables.Add(range, REPORT_SNAPSHOTS_TABLE_METHOD_CALL_LINES_OCCURRENCES);
+ table.ShowHeader = true;
+ table.TableStyle = TableStyles.Medium2;
+ table.ShowFilter = true;
+ table.ShowTotal = false;
- List serviceEndpointsList = FileIOHelper.readListFromCSVFile(serviceEndpointsReportFilePath, new ServiceEndpointEntityReportMap());
+ sheet.Column(table.Columns["Controller"].Position + 1).Width = 20;
+ sheet.Column(table.Columns["ApplicationName"].Position + 1).Width = 20;
+ sheet.Column(table.Columns["TierName"].Position + 1).Width = 20;
+ sheet.Column(table.Columns["NodeName"].Position + 1).Width = 20;
+ sheet.Column(table.Columns["BTName"].Position + 1).Width = 20;
+ sheet.Column(table.Columns["RequestID"].Position + 1).Width = 20;
+ sheet.Column(table.Columns["SegmentID"].Position + 1).Width = 10;
+ sheet.Column(table.Columns["Type"].Position + 1).Width = 15;
+ sheet.Column(table.Columns["Framework"].Position + 1).Width = 15;
+ sheet.Column(table.Columns["FullName"].Position + 1).Width = 45;
+
+ sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_OCCURRENCES_TYPE_PIVOT];
+ ExcelPivotTable pivot = sheet.PivotTables.Add(sheet.Cells[REPORT_SNAPSHOTS_PIVOT_SHEET_START_PIVOT_AT + REPORT_SNAPSHOTS_PIVOT_SHEET_CHART_HEIGHT + 2, 1], range, REPORT_SNAPSHOTS_PIVOT_METHOD_CALL_LINES_OCCURRENCES_TYPE);
+ ExcelPivotTableField fieldF = pivot.PageFields.Add(pivot.Fields["NumChildren"]);
+ fieldF = pivot.PageFields.Add(pivot.Fields["NumExits"]);
+ fieldF = pivot.PageFields.Add(pivot.Fields["ExecRange"]);
+ ExcelPivotTableField fieldR = pivot.RowFields.Add(pivot.Fields["Controller"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["ApplicationName"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["TierName"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["BTName"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["FullName"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ ExcelPivotTableField fieldC = pivot.ColumnFields.Add(pivot.Fields["Type"]);
+ fieldC.Compact = false;
+ fieldC.Outline = false;
+ fieldC = pivot.ColumnFields.Add(pivot.Fields["Framework"]);
+ fieldC.Compact = false;
+ fieldC.Outline = false;
+ ExcelPivotTableDataField fieldD = pivot.DataFields.Add(pivot.Fields["NumCalls"]);
+ fieldD.Function = DataFieldFunctions.Sum;
- metricsEntityFolderPath = Path.Combine(metricsFolderPath, SERVICE_ENDPOINTS_TYPE_SHORT);
- entitiesFullRangeReportFilePath = Path.Combine(metricsEntityFolderPath, CONVERT_ENTITIES_METRICS_FULLRANGE_FILE_NAME);
- List serviceEndpointsMetricsList = FileIOHelper.readListFromCSVFile(entitiesFullRangeReportFilePath, new ServiceEndpointMetricReportMap());
+ ExcelChart chart = sheet.Drawings.AddChart(REPORT_SNAPSHOTS_PIVOT_METHOD_CALL_LINES_GRAPH_TYPE, eChartType.ColumnClustered, pivot);
+ chart.SetPosition(2, 0, 0, 0);
+ chart.SetSize(800, 300);
- if (serviceEndpointsList != null)
- {
- loggerConsole.Info("Entity Details for Service Endpoints ({0} entities)", serviceEndpointsList.Count);
+ sheet = excelReport.Workbook.Worksheets[REPORT_SNAPSHOTS_SHEET_METHOD_CALL_LINES_OCCURRENCES_LOCATION_PIVOT];
+ pivot = sheet.PivotTables.Add(sheet.Cells[REPORT_SNAPSHOTS_PIVOT_SHEET_START_PIVOT_AT + REPORT_SNAPSHOTS_PIVOT_SHEET_CHART_HEIGHT + 2, 1], range, REPORT_SNAPSHOTS_PIVOT_METHOD_CALL_LINES_OCCURRENCES_LOCATION);
+ fieldF = pivot.PageFields.Add(pivot.Fields["NumChildren"]);
+ fieldF = pivot.PageFields.Add(pivot.Fields["NumExits"]);
+ fieldR = pivot.RowFields.Add(pivot.Fields["Type"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["Framework"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["FullName"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["Controller"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["ApplicationName"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["TierName"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldR = pivot.RowFields.Add(pivot.Fields["BTName"]);
+ fieldR.Compact = false;
+ fieldR.Outline = false;
+ fieldC = pivot.ColumnFields.Add(pivot.Fields["ExecRange"]);
+ fieldC.Compact = false;
+ fieldC.Outline = false;
+ fieldD = pivot.DataFields.Add(pivot.Fields["NumCalls"]);
+ fieldD.Function = DataFieldFunctions.Sum;
- stepTimingTarget.NumEntities = stepTimingTarget.NumEntities + serviceEndpointsList.Count;
+ chart = sheet.Drawings.AddChart(REPORT_SNAPSHOTS_PIVOT_METHOD_CALL_LINES_OCCURRENCES_GRAPH_LOCATION, eChartType.ColumnClustered, pivot);
+ chart.SetPosition(2, 0, 0, 0);
+ chart.SetSize(800, 300);
+ }
- int j = 0;
+ #endregion
- if (programOptions.ProcessSequentially == false)
- {
- var serviceEndpointsListChunks = serviceEndpointsList.BreakListIntoChunks(METRIC_DETAILS_REPORT_NUMBER_OF_ENTITIES_TO_PROCESS_PER_THREAD);
+ #region TOC sheet
- Parallel.ForEach, int>(
- serviceEndpointsListChunks,
- () => 0,
- (serviceEndpointsListChunk, loop, subtotal) =>
- {
- subtotal += reportMetricDetailServiceEndpoints(
- programOptions,
- jobConfiguration,
- jobTarget,
- serviceEndpointsListChunk,
- serviceEndpointsMetricsList,
- eventsAllList,
- healthRuleViolationEventsAllList,
- snapshotsAllList,
- segmentsAllList,
- exitCallsAllList,
- serviceEndpointCallsAllList,
- detectedErrorsAllList,
- businessDataAllList,
- false);
- return subtotal;
- },
- (finalResult) =>
- {
- j = Interlocked.Add(ref j, finalResult);
- Console.Write("[{0}].", j);
- }
- );
- }
- else
- {
- j = reportMetricDetailServiceEndpoints(
- programOptions,
- jobConfiguration,
- jobTarget,
- serviceEndpointsList,
- serviceEndpointsMetricsList,
- eventsAllList,
- healthRuleViolationEventsAllList,
- snapshotsAllList,
- segmentsAllList,
- exitCallsAllList,
- serviceEndpointCallsAllList,
- detectedErrorsAllList,
- businessDataAllList,
- true);
- }
-
- loggerConsole.Info("{0} entities", j);
- }
-
- #endregion
-
- #region Errors
-
- List errorsList = FileIOHelper.readListFromCSVFile(errorsReportFilePath, new ErrorEntityReportMap());
-
- metricsEntityFolderPath = Path.Combine(metricsFolderPath, ERRORS_TYPE_SHORT);
- entitiesFullRangeReportFilePath = Path.Combine(metricsEntityFolderPath, CONVERT_ENTITIES_METRICS_FULLRANGE_FILE_NAME);
- List errorsMetricsList = FileIOHelper.readListFromCSVFile(entitiesFullRangeReportFilePath, new ErrorMetricReportMap());
-
- if (errorsList != null)
- {
- loggerConsole.Info("Entity Details for Errors ({0} entities)", errorsList.Count);
-
- stepTimingTarget.NumEntities = stepTimingTarget.NumEntities + errorsList.Count;
-
- int j = 0;
-
- if (programOptions.ProcessSequentially == false)
- {
- var errorsListChunks = errorsList.BreakListIntoChunks(METRIC_DETAILS_REPORT_NUMBER_OF_ENTITIES_TO_PROCESS_PER_THREAD);
+ // TOC sheet again
+ sheet = excelReport.Workbook.Worksheets[REPORT_SHEET_TOC];
+ sheet.Cells[1, 1].Value = "Sheet Name";
+ sheet.Cells[1, 2].Value = "# Entities";
+ sheet.Cells[1, 3].Value = "Link";
+ int rowNum = 1;
+ foreach (ExcelWorksheet s in excelReport.Workbook.Worksheets)
+ {
+ rowNum++;
+ sheet.Cells[rowNum, 1].Value = s.Name;
+ sheet.Cells[rowNum, 3].Formula = String.Format(@"=HYPERLINK(""#'{0}'!A1"", """")", s.Name);
+ sheet.Cells[rowNum, 3].StyleName = "HyperLinkStyle";
+ if (s.Tables.Count > 0)
+ {
+ table = s.Tables[0];
+ sheet.Cells[rowNum, 2].Value = table.Address.Rows - 1;
+ }
+ }
+ range = sheet.Cells[1, 1, sheet.Dimension.Rows, sheet.Dimension.Columns];
+ table = sheet.Tables.Add(range, REPORT_SNAPSHOTS_TABLE_TOC);
+ table.ShowHeader = true;
+ table.TableStyle = TableStyles.Medium2;
+ table.ShowFilter = true;
+ table.ShowTotal = false;
- Parallel.ForEach, int>(
- errorsListChunks,
- () => 0,
- (errorsListChunk, loop, subtotal) =>
- {
- subtotal += reportMetricDetailErrors(
- programOptions,
- jobConfiguration,
- jobTarget,
- errorsListChunk,
- errorsMetricsList,
- eventsAllList,
- healthRuleViolationEventsAllList,
- snapshotsAllList,
- segmentsAllList,
- exitCallsAllList,
- serviceEndpointCallsAllList,
- detectedErrorsAllList,
- businessDataAllList,
- false);
- return subtotal;
- },
- (finalResult) =>
- {
- j = Interlocked.Add(ref j, finalResult);
- Console.Write("[{0}].", j);
- }
- );
- }
- else
- {
- j = reportMetricDetailErrors(
- programOptions,
- jobConfiguration,
- jobTarget,
- errorsList,
- errorsMetricsList,
- eventsAllList,
- healthRuleViolationEventsAllList,
- snapshotsAllList,
- segmentsAllList,
- exitCallsAllList,
- serviceEndpointCallsAllList,
- detectedErrorsAllList,
- businessDataAllList,
- true);
- }
+ sheet.Column(table.Columns["Sheet Name"].Position + 1).Width = 25;
+ sheet.Column(table.Columns["# Entities"].Position + 1).Width = 25;
- loggerConsole.Info("{0} entities", j);
- }
+ #endregion
- #endregion
+ #region Save file
- }
- catch (Exception ex)
- {
- logger.Warn(ex);
- loggerConsole.Warn(ex);
- }
- finally
- {
- stopWatchTarget.Stop();
+ // Report files
+ string reportFileName = String.Format(
+ REPORT_SNAPSHOTS_METHOD_CALL_LINES_FILE_NAME,
+ programOptions.JobName,
+ jobConfiguration.Input.ExpandedTimeRange.From,
+ jobConfiguration.Input.ExpandedTimeRange.To);
+ string reportFilePath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME, reportFileName);
- logger.Info("{0}({0:d}): [{1}/{2}], {3} {4} duration {5:c} ({6} ms)", jobStatus, i + 1, jobConfiguration.Target.Count, jobTarget.Controller, jobTarget.Application, stopWatchTarget.Elapsed, stopWatchTarget.ElapsedMilliseconds);
- loggerConsole.Trace("{0}({0:d}): [{1}/{2}], {3} {4} duration {5:c} ({6} ms)", jobStatus, i + 1, jobConfiguration.Target.Count, jobTarget.Controller, jobTarget.Application, stopWatchTarget.Elapsed, stopWatchTarget.ElapsedMilliseconds);
+ string folderPath = Path.GetDirectoryName(reportFilePath);
+ if (Directory.Exists(folderPath) == false)
+ {
+ Directory.CreateDirectory(folderPath);
+ }
- stepTimingTarget.EndTime = DateTime.Now;
- stepTimingTarget.Duration = stopWatchTarget.Elapsed;
- stepTimingTarget.DurationMS = stopWatchTarget.ElapsedMilliseconds;
+ logger.Info("Saving Excel report {0}", reportFilePath);
+ loggerConsole.Info("Saving Excel report {0}", reportFilePath);
- List stepTimings = new List(1);
- stepTimings.Add(stepTimingTarget);
- FileIOHelper.writeListToCSVFile(stepTimings, new StepTimingReportMap(), stepTimingReportFilePath, true);
- }
+ try
+ {
+ // Save full report Excel files
+ excelReport.SaveAs(new FileInfo(reportFilePath));
+ }
+ catch (InvalidOperationException ex)
+ {
+ logger.Warn("Unable to save Excel file {0}", reportFilePath);
+ logger.Warn(ex);
+ loggerConsole.Warn("Unable to save Excel file {0}", reportFilePath);
}
+ #endregion
+
return true;
}
catch (Exception ex)
@@ -12363,3303 +12462,3253 @@ private static bool stepReportIndividualApplicationAndEntityDetails(ProgramOptio
}
}
- #endregion
-
-
- #region Metric extraction functions
-
- private static void getMetricDataForMetricForAllRanges(ControllerApi controllerApi, JobTarget jobTarget, string metricPath, string metricName, JobConfiguration jobConfiguration, string metricsEntityFolderPath, bool progressToConsole)
+ private static bool stepReportIndividualApplicationAndEntityDetails(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobStatus jobStatus)
{
- string metricEntitySubFolderName = metricNameToShortMetricNameMapping[metricName];
-
- // Get the full range
- JobTimeRange jobTimeRange = jobConfiguration.Input.ExpandedTimeRange;
+ Stopwatch stopWatch = new Stopwatch();
+ stopWatch.Start();
- logger.Info("Retrieving metric for Application {0}({1}), Metric='{2}', From {3:o}, To {4:o}", jobTarget.Application, jobTarget.ApplicationID, metricPath, jobTimeRange.From, jobTimeRange.To);
+ StepTiming stepTimingFunction = new StepTiming();
+ stepTimingFunction.JobFileName = programOptions.OutputJobFilePath;
+ stepTimingFunction.StepName = jobStatus.ToString();
+ stepTimingFunction.StepID = (int)jobStatus;
+ stepTimingFunction.StartTime = DateTime.Now;
+ stepTimingFunction.NumEntities = jobConfiguration.Target.Count;
- string metricsJson = String.Empty;
+ string stepTimingReportFilePath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME, TIMING_REPORT_FILE_NAME);
- string metricsDataFilePath = Path.Combine(metricsEntityFolderPath, metricEntitySubFolderName, String.Format(EXTRACT_METRIC_FULL_FILE_NAME, jobTimeRange.From, jobTimeRange.To));
- if (File.Exists(metricsDataFilePath) == false)
+ try
{
- if (progressToConsole == true)
+ // Process each target
+ for (int i = 0; i < jobConfiguration.Target.Count; i++)
{
- Console.Write(".");
- }
+ Stopwatch stopWatchTarget = new Stopwatch();
+ stopWatchTarget.Start();
- // First range is the whole thing
- metricsJson = controllerApi.GetMetricData(
- jobTarget.ApplicationID,
- metricPath,
- convertToUnixTimestamp(jobTimeRange.From),
- convertToUnixTimestamp(jobTimeRange.To),
- true);
+ JobTarget jobTarget = jobConfiguration.Target[i];
- if (metricsJson != String.Empty) FileIOHelper.saveFileToFolder(metricsJson, metricsDataFilePath);
- }
+ StepTiming stepTimingTarget = new StepTiming();
+ stepTimingTarget.Controller = jobTarget.Controller;
+ stepTimingTarget.ApplicationName = jobTarget.Application;
+ stepTimingTarget.ApplicationID = jobTarget.ApplicationID;
+ stepTimingTarget.JobFileName = programOptions.OutputJobFilePath;
+ stepTimingTarget.StepName = jobStatus.ToString();
+ stepTimingTarget.StepID = (int)jobStatus;
+ stepTimingTarget.StartTime = DateTime.Now;
- // Get the hourly time ranges
- for (int j = 0; j < jobConfiguration.Input.HourlyTimeRanges.Count; j++)
- {
- if (progressToConsole == true)
- {
- Console.Write(".");
- }
+ try
+ {
+ #region Output status
- jobTimeRange = jobConfiguration.Input.HourlyTimeRanges[j];
+ logger.Info("{0}({0:d}): [{1}/{2}], {3} {4}({5})", jobStatus, i + 1, jobConfiguration.Target.Count, jobTarget.Controller, jobTarget.Application, jobTarget.ApplicationID);
+ loggerConsole.Trace("{0}({0:d}): [{1}/{2}], {3} {4}({5})", jobStatus, i + 1, jobConfiguration.Target.Count, jobTarget.Controller, jobTarget.Application, jobTarget.ApplicationID);
- logger.Info("Retrieving metric for Application {0}({1}), Metric='{2}', From {3:o}, To {4:o}", jobTarget.Application, jobTarget.ApplicationID, metricPath, jobTimeRange.From, jobTimeRange.To);
+ #endregion
- metricsDataFilePath = Path.Combine(metricsEntityFolderPath, metricEntitySubFolderName, String.Format(EXTRACT_METRIC_HOUR_FILE_NAME, jobTimeRange.From, jobTimeRange.To));
+ #region Target state check
- if (File.Exists(metricsDataFilePath) == false)
- {
- // Subsequent ones are details
- metricsJson = controllerApi.GetMetricData(
- jobTarget.ApplicationID,
- metricPath,
- convertToUnixTimestamp(jobTimeRange.From),
- convertToUnixTimestamp(jobTimeRange.To),
- false);
+ if (jobTarget.Status != JobTargetStatus.ConfigurationValid)
+ {
+ loggerConsole.Trace("Target in invalid state {0}, skipping", jobTarget.Status);
- if (metricsJson != String.Empty) FileIOHelper.saveFileToFolder(metricsJson, metricsDataFilePath);
- }
- }
- }
+ continue;
+ }
- #endregion
+ #endregion
- #region Flowmap extraction functions
+ #region Target step variables
- private static int extractFlowmapsApplication(JobConfiguration jobConfiguration, JobTarget jobTarget, ControllerApi controllerApi, string metricsFolderPath, long fromTimeUnix, long toTimeUnix, long differenceInMinutes)
- {
- logger.Info("Retrieving flowmap for Application {0}, From {1:o}, To {2:o}", jobTarget.Application, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To);
+ // Various folders
+ string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
+ string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
+ string metricsFolderPath = Path.Combine(applicationFolderPath, METRICS_FOLDER_NAME);
+ string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
+ string eventsFolderPath = Path.Combine(applicationFolderPath, EVENTS_FOLDER_NAME);
+ string snapshotsFolderPath = Path.Combine(applicationFolderPath, SNAPSHOTS_FOLDER_NAME);
- string flowmapDataFilePath = Path.Combine(
- metricsFolderPath,
- APPLICATION_TYPE_SHORT,
- String.Format(EXTRACT_ENTITY_FLOWMAP_FILE_NAME, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To));
+ // Report files
+ string applicationReportFilePath = Path.Combine(applicationFolderPath, CONVERT_ENTITY_APPLICATION_FILE_NAME);
+ string tiersReportFilePath = Path.Combine(entitiesFolderPath, CONVERT_ENTITY_TIERS_FILE_NAME);
+ string nodesReportFilePath = Path.Combine(entitiesFolderPath, CONVERT_ENTITY_NODES_FILE_NAME);
+ string backendsReportFilePath = Path.Combine(entitiesFolderPath, CONVERT_ENTITY_BACKENDS_FILE_NAME);
+ string businessTransactionsReportFilePath = Path.Combine(entitiesFolderPath, CONVERT_ENTITY_BUSINESS_TRANSACTIONS_FILE_NAME);
+ string serviceEndpointsReportFilePath = Path.Combine(entitiesFolderPath, CONVERT_ENTITY_SERVICE_ENDPOINTS_FILE_NAME);
+ string errorsReportFilePath = Path.Combine(entitiesFolderPath, CONVERT_ENTITY_ERRORS_FILE_NAME);
- string flowmapJson = String.Empty;
+ string eventsFilePath = Path.Combine(eventsFolderPath, CONVERT_EVENTS_FILE_NAME);
+ string healthRuleViolationEventsFilePath = Path.Combine(eventsFolderPath, CONVERT_HEALTH_RULE_EVENTS_FILE_NAME);
+ string snapshotsFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_FILE_NAME);
+ string segmentsFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_FILE_NAME);
+ string exitCallsFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_EXIT_CALLS_FILE_NAME);
+ string serviceEndpointCallsFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_SERVICE_ENDPOINTS_CALLS_FILE_NAME);
+ string detectedErrorsFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_DETECTED_ERRORS_FILE_NAME);
+ string businessDataFilePath = Path.Combine(snapshotsFolderPath, CONVERT_SNAPSHOTS_SEGMENTS_BUSINESS_DATA_FILE_NAME);
- if (File.Exists(flowmapDataFilePath) == false)
- {
- flowmapJson = controllerApi.GetFlowmapApplication(jobTarget.ApplicationID, fromTimeUnix, toTimeUnix, differenceInMinutes);
- if (flowmapJson != String.Empty) FileIOHelper.saveFileToFolder(flowmapJson, flowmapDataFilePath);
- }
+ string metricsEntityFolderPath = String.Empty;
+ string entitiesFullRangeReportFilePath = String.Empty;
- return 1;
- }
+ #endregion
- private static int extractFlowmapsTiers(JobConfiguration jobConfiguration, JobTarget jobTarget, ControllerApi controllerApi, List entityList, string metricsFolderPath, long fromTimeUnix, long toTimeUnix, long differenceInMinutes, bool progressToConsole)
- {
- int j = 0;
+ #region Preload all the reports that will be filtered by the subsequent entities
- foreach (AppDRESTTier tier in entityList)
- {
- logger.Info("Retrieving flowmap for Application {0}, Tier {1}, From {2:o}, To {3:o}", jobTarget.Application, tier.name, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To);
+ loggerConsole.Info("Entity Details Data Preloading");
- string flowmapDataFilePath = Path.Combine(
- metricsFolderPath,
- TIERS_TYPE_SHORT,
- getShortenedEntityNameForFileSystem(tier.name, tier.id),
- String.Format(EXTRACT_ENTITY_FLOWMAP_FILE_NAME, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To));
+ List eventsAllList = FileIOHelper.readListFromCSVFile(eventsFilePath, new EventReportMap());
+ List healthRuleViolationEventsAllList = FileIOHelper.readListFromCSVFile(healthRuleViolationEventsFilePath, new HealthRuleViolationEventReportMap());
+ List snapshotsAllList = FileIOHelper.readListFromCSVFile(snapshotsFilePath, new SnapshotReportMap());
+ List segmentsAllList = FileIOHelper.readListFromCSVFile(segmentsFilePath, new SegmentReportMap());
+ List exitCallsAllList = FileIOHelper.readListFromCSVFile(exitCallsFilePath, new ExitCallReportMap());
+ List serviceEndpointCallsAllList = FileIOHelper.readListFromCSVFile(serviceEndpointCallsFilePath, new ServiceEndpointCallReportMap());
+ List detectedErrorsAllList = FileIOHelper.readListFromCSVFile(detectedErrorsFilePath, new DetectedErrorReportMap());
+ List businessDataAllList = FileIOHelper.readListFromCSVFile(businessDataFilePath, new BusinessDataReportMap());
- if (File.Exists(flowmapDataFilePath) == false)
- {
- string flowmapJson = controllerApi.GetFlowmapTier(tier.id, fromTimeUnix, toTimeUnix, differenceInMinutes);
- if (flowmapJson != String.Empty) FileIOHelper.saveFileToFolder(flowmapJson, flowmapDataFilePath);
- }
+ #endregion
- if (progressToConsole == true)
- {
- j++;
- if (j % 10 == 0)
- {
- Console.Write("[{0}].", j);
- }
- }
- }
+ #region Application
- return entityList.Count;
- }
+ List applicationList = FileIOHelper.readListFromCSVFile(applicationReportFilePath, new ApplicationEntityReportMap());
- private static int extractFlowmapsNodes(JobConfiguration jobConfiguration, JobTarget jobTarget, ControllerApi controllerApi, List entityList, string metricsFolderPath, long fromTimeUnix, long toTimeUnix, long differenceInMinutes, bool progressToConsole)
- {
- int j = 0;
+ metricsEntityFolderPath = Path.Combine(metricsFolderPath, APPLICATION_TYPE_SHORT);
+ entitiesFullRangeReportFilePath = Path.Combine(metricsEntityFolderPath, CONVERT_ENTITY_METRICS_FULLRANGE_FILE_NAME);
+ List applicationMetricsList = FileIOHelper.readListFromCSVFile(entitiesFullRangeReportFilePath, new ApplicationMetricReportMap());
- foreach (AppDRESTNode node in entityList)
- {
- logger.Info("Retrieving flowmap for Application {0}, Tier {1}, Node {2}, From {3:o}, To {4:o}", jobTarget.Application, node.tierName, node.name, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To);
+ if (applicationList != null && applicationList.Count > 0)
+ {
+ loggerConsole.Info("Entity Details for Application");
- string flowmapDataFilePath = Path.Combine(
- metricsFolderPath,
- NODES_TYPE_SHORT,
- getShortenedEntityNameForFileSystem(node.tierName, node.tierId),
- getShortenedEntityNameForFileSystem(node.name, node.id),
- String.Format(EXTRACT_ENTITY_FLOWMAP_FILE_NAME, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To));
+ stepTimingTarget.NumEntities = stepTimingTarget.NumEntities + 1;
- if (File.Exists(flowmapDataFilePath) == false)
- {
- string flowmapJson = controllerApi.GetFlowmapNode(node.id, fromTimeUnix, toTimeUnix, differenceInMinutes);
- if (flowmapJson != String.Empty) FileIOHelper.saveFileToFolder(flowmapJson, flowmapDataFilePath);
- }
+ reportMetricDetailApplication(
+ programOptions,
+ jobConfiguration,
+ jobTarget,
+ applicationList[0],
+ (applicationMetricsList != null && applicationMetricsList.Count > 0) ? applicationMetricsList[0] : null,
+ eventsAllList,
+ healthRuleViolationEventsAllList,
+ snapshotsAllList,
+ segmentsAllList,
+ exitCallsAllList,
+ serviceEndpointCallsAllList,
+ detectedErrorsAllList,
+ businessDataAllList);
+ }
- if (progressToConsole == true)
- {
- j++;
- if (j % 10 == 0)
- {
- Console.Write("[{0}].", j);
- }
- }
- }
+ #endregion
- return entityList.Count;
- }
+ #region Tier
- private static int extractFlowmapsBackends(JobConfiguration jobConfiguration, JobTarget jobTarget, ControllerApi controllerApi, List entityList, string metricsFolderPath, long fromTimeUnix, long toTimeUnix, long differenceInMinutes, bool progressToConsole)
- {
- int j = 0;
+ List tiersList = FileIOHelper.readListFromCSVFile(tiersReportFilePath, new TierEntityReportMap());
- foreach (AppDRESTBackend backend in entityList)
- {
- logger.Info("Retrieving flowmap for Application {0}, Backend {1}, From {2:o}, To {3:o}", jobTarget.Application, backend.name, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To);
+ metricsEntityFolderPath = Path.Combine(metricsFolderPath, TIERS_TYPE_SHORT);
+ entitiesFullRangeReportFilePath = Path.Combine(metricsEntityFolderPath, CONVERT_ENTITIES_METRICS_FULLRANGE_FILE_NAME);
+ List tiersMetricsList = FileIOHelper.readListFromCSVFile(entitiesFullRangeReportFilePath, new TierMetricReportMap());
- string flowmapDataFilePath = Path.Combine(
- metricsFolderPath,
- BACKENDS_TYPE_SHORT,
- getShortenedEntityNameForFileSystem(backend.name, backend.id),
- String.Format(EXTRACT_ENTITY_FLOWMAP_FILE_NAME, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To));
+ if (tiersList != null)
+ {
+ loggerConsole.Info("Entity Details for Tiers ({0} entities)", tiersList.Count);
- if (File.Exists(flowmapDataFilePath) == false)
- {
- string flowmapJson = controllerApi.GetFlowmapBackend(backend.id, fromTimeUnix, toTimeUnix, differenceInMinutes);
- if (flowmapJson != String.Empty) FileIOHelper.saveFileToFolder(flowmapJson, flowmapDataFilePath);
- }
+ stepTimingTarget.NumEntities = stepTimingTarget.NumEntities + tiersList.Count;
- if (progressToConsole == true)
- {
- j++;
- if (j % 10 == 0)
- {
- Console.Write("[{0}].", j);
- }
- }
- }
+ int j = 0;
- return entityList.Count;
- }
+ if (programOptions.ProcessSequentially == false)
+ {
+ var tiersListChunks = tiersList.BreakListIntoChunks(METRIC_DETAILS_REPORT_NUMBER_OF_ENTITIES_TO_PROCESS_PER_THREAD);
- private static int extractFlowmapsBusinessTransactions(JobConfiguration jobConfiguration, JobTarget jobTarget, ControllerApi controllerApi, List entityList, string metricsFolderPath, long fromTimeUnix, long toTimeUnix, long differenceInMinutes, bool progressToConsole)
- {
- int j = 0;
+ Parallel.ForEach, int>(
+ tiersListChunks,
+ () => 0,
+ (tiersListChunk, loop, subtotal) =>
+ {
+ subtotal += reportMetricDetailTiers(
+ programOptions,
+ jobConfiguration,
+ jobTarget,
+ tiersListChunk,
+ tiersMetricsList,
+ eventsAllList,
+ healthRuleViolationEventsAllList,
+ snapshotsAllList,
+ segmentsAllList,
+ exitCallsAllList,
+ serviceEndpointCallsAllList,
+ detectedErrorsAllList,
+ businessDataAllList,
+ false);
+ return subtotal;
+ },
+ (finalResult) =>
+ {
+ j = Interlocked.Add(ref j, finalResult);
+ Console.Write("[{0}].", j);
+ }
+ );
+ }
+ else
+ {
+ j = reportMetricDetailTiers(
+ programOptions,
+ jobConfiguration,
+ jobTarget,
+ tiersList,
+ tiersMetricsList,
+ eventsAllList,
+ healthRuleViolationEventsAllList,
+ snapshotsAllList,
+ segmentsAllList,
+ exitCallsAllList,
+ serviceEndpointCallsAllList,
+ detectedErrorsAllList,
+ businessDataAllList,
+ true);
+ }
- foreach (AppDRESTBusinessTransaction businessTransaction in entityList)
- {
- logger.Info("Retrieving flowmap for Application {0}, Tier {1}, Business Transaction {2}, From {3:o}, To {4:o}", jobTarget.Application, businessTransaction.tierName, businessTransaction.name, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To);
+ loggerConsole.Info("{0} entities", j);
+ }
- string flowmapDataFilePath = Path.Combine(
- metricsFolderPath,
- BUSINESS_TRANSACTIONS_TYPE_SHORT,
- getShortenedEntityNameForFileSystem(businessTransaction.tierName, businessTransaction.tierId),
- getShortenedEntityNameForFileSystem(businessTransaction.name, businessTransaction.id),
- String.Format(EXTRACT_ENTITY_FLOWMAP_FILE_NAME, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To));
+ #endregion
- if (File.Exists(flowmapDataFilePath) == false)
- {
- string flowmapJson = controllerApi.GetFlowmapBusinessTransaction(jobTarget.ApplicationID, businessTransaction.id, fromTimeUnix, toTimeUnix, differenceInMinutes);
- if (flowmapJson != String.Empty) FileIOHelper.saveFileToFolder(flowmapJson, flowmapDataFilePath);
- }
+ #region Nodes
- if (progressToConsole == true)
- {
- j++;
- if (j % 10 == 0)
- {
- Console.Write("[{0}].", j);
- }
- }
- }
+ List nodesList = FileIOHelper.readListFromCSVFile(nodesReportFilePath, new NodeEntityReportMap());
- return entityList.Count;
- }
+ metricsEntityFolderPath = Path.Combine(metricsFolderPath, NODES_TYPE_SHORT);
+ entitiesFullRangeReportFilePath = Path.Combine(metricsEntityFolderPath, CONVERT_ENTITIES_METRICS_FULLRANGE_FILE_NAME);
+ List nodesMetricsList = FileIOHelper.readListFromCSVFile(entitiesFullRangeReportFilePath, new NodeMetricReportMap());
- #endregion
+ if (nodesList != null)
+ {
+ loggerConsole.Info("Entity Details for Nodes ({0} entities)", nodesList.Count);
- #region Event extraction functions
-
- private static int extractEvents(JobConfiguration jobConfiguration, JobTarget jobTarget, ControllerApi controllerApi, string eventsFolderPath, string eventType, bool progressToConsole)
- {
- if (progressToConsole == true)
- {
- loggerConsole.Info("Extract {0} events ({1} time ranges)", eventType, jobConfiguration.Input.HourlyTimeRanges.Count);
- }
-
- JArray listOfEvents = new JArray();
- int totalEventsFound = 0;
- foreach (JobTimeRange jobTimeRange in jobConfiguration.Input.HourlyTimeRanges)
- {
- long fromTimeUnix = convertToUnixTimestamp(jobTimeRange.From);
- long toTimeUnix = convertToUnixTimestamp(jobTimeRange.To);
-
- string eventsJSON = controllerApi.GetEvents(jobTarget.ApplicationID, eventType, fromTimeUnix, toTimeUnix);
- if (eventsJSON != String.Empty)
- {
- // Load events
- JArray eventsInHour = JArray.Parse(eventsJSON);
- foreach (JObject interestingEvent in eventsInHour)
- {
- listOfEvents.Add(interestingEvent);
- }
- totalEventsFound = totalEventsFound + eventsInHour.Count;
-
- if (progressToConsole == true)
- {
- Console.Write("+{0}", eventsInHour.Count);
- }
- }
- }
-
- if (listOfEvents.Count > 0)
- {
- string eventsFilePath = Path.Combine(
- eventsFolderPath,
- String.Format(EVENTS_FILE_NAME, eventType, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To));
-
- FileIOHelper.writeJArrayToFile(listOfEvents, eventsFilePath);
-
- logger.Info("{0} events from {1:o} to {2:o}", listOfEvents.Count, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To);
- if (progressToConsole == true)
- {
- Console.Write("=");
- loggerConsole.Info("{0} {1} events", listOfEvents.Count, eventType);
- }
- }
- else
- {
- if (progressToConsole == true)
- {
- Console.WriteLine();
- }
- }
-
- return listOfEvents.Count;
- }
-
- #endregion
+ stepTimingTarget.NumEntities = stepTimingTarget.NumEntities + nodesList.Count;
- #region Snapshot extraction functions
+ int j = 0;
- private static int extractSnapshots(JobConfiguration jobConfiguration, JobTarget jobTarget, ControllerApi controllerApi, List entityList, string snapshotsFolderPath, bool progressToConsole)
- {
- int j = 0;
+ if (programOptions.ProcessSequentially == false)
+ {
+ var nodesListChunks = nodesList.BreakListIntoChunks(METRIC_DETAILS_REPORT_NUMBER_OF_ENTITIES_TO_PROCESS_PER_THREAD);
- foreach (JToken snapshot in entityList)
- {
- // Only do first in chain
- if ((bool)snapshot["firstInChain"] == true)
- {
- logger.Info("Retrieving snapshot for Application {0}, Tier {1}, Business Transaction {2}, RequestGUID {3}", jobTarget.Application, snapshot["applicationComponentName"], snapshot["businessTransactionName"], snapshot["requestGUID"]);
+ Parallel.ForEach, int>(
+ nodesListChunks,
+ () => 0,
+ (nodesListChunk, loop, subtotal) =>
+ {
+ subtotal += reportMetricDetailNodes(
+ programOptions,
+ jobConfiguration,
+ jobTarget,
+ nodesListChunk,
+ nodesMetricsList,
+ eventsAllList,
+ healthRuleViolationEventsAllList,
+ snapshotsAllList,
+ segmentsAllList,
+ exitCallsAllList,
+ serviceEndpointCallsAllList,
+ detectedErrorsAllList,
+ businessDataAllList,
+ false);
+ return subtotal;
+ },
+ (finalResult) =>
+ {
+ j = Interlocked.Add(ref j, finalResult);
+ Console.Write("[{0}].", j);
+ }
+ );
+ }
+ else
+ {
+ j = reportMetricDetailNodes(
+ programOptions,
+ jobConfiguration,
+ jobTarget,
+ nodesList,
+ nodesMetricsList,
+ eventsAllList,
+ healthRuleViolationEventsAllList,
+ snapshotsAllList,
+ segmentsAllList,
+ exitCallsAllList,
+ serviceEndpointCallsAllList,
+ detectedErrorsAllList,
+ businessDataAllList,
+ true);
+ }
- #region Target step variables
+ loggerConsole.Info("{0} entities", j);
+ }
- DateTime snapshotTime = convertFromUnixTimestamp((long)snapshot["serverStartTime"]);
+ #endregion
- string snapshotFolderPath = Path.Combine(
- snapshotsFolderPath,
- getShortenedEntityNameForFileSystem(snapshot["applicationComponentName"].ToString(), (long)snapshot["applicationComponentId"]),
- getShortenedEntityNameForFileSystem(snapshot["businessTransactionName"].ToString(), (long)snapshot["businessTransactionId"]),
- String.Format("{0:yyyyMMddHH}", snapshotTime),
- userExperienceFolderNameMapping[snapshot["userExperience"].ToString()],
- String.Format(SNAPSHOT_FOLDER_NAME, snapshot["requestGUID"], snapshotTime));
+ #region Backends
- // Must strip out the milliseconds, because the segment list retrieval doesn't seem to like them in the datetimes
- DateTime snapshotTimeFrom = snapshotTime.AddMinutes(-30).AddMilliseconds(snapshotTime.Millisecond * -1);
- DateTime snapshotTimeTo = snapshotTime.AddMinutes(30).AddMilliseconds(snapshotTime.Millisecond * -1);
+ List backendsList = FileIOHelper.readListFromCSVFile(backendsReportFilePath, new BackendEntityReportMap());
- long fromTimeUnix = convertToUnixTimestamp(snapshotTimeFrom);
- long toTimeUnix = convertToUnixTimestamp(snapshotTimeTo);
- int differenceInMinutes = (int)(snapshotTimeTo - snapshotTimeFrom).TotalMinutes;
+ metricsEntityFolderPath = Path.Combine(metricsFolderPath, BACKENDS_TYPE_SHORT);
+ entitiesFullRangeReportFilePath = Path.Combine(metricsEntityFolderPath, CONVERT_ENTITIES_METRICS_FULLRANGE_FILE_NAME);
+ List backendsMetricsList = FileIOHelper.readListFromCSVFile(entitiesFullRangeReportFilePath, new BackendMetricReportMap());
- #endregion
+ if (backendsList != null)
+ {
+ loggerConsole.Info("Entity Details for Backends ({0} entities)", backendsList.Count);
- #region Get Snapshot Flowmap
+ stepTimingTarget.NumEntities = stepTimingTarget.NumEntities + backendsList.Count;
- // Get snapshot flow map
- string snapshotFlowmapDataFilePath = Path.Combine(snapshotFolderPath, EXTRACT_SNAPSHOT_FLOWMAP_FILE_NAME);
+ int j = 0;
- if (File.Exists(snapshotFlowmapDataFilePath) == false)
- {
- string snapshotFlowmapJson = controllerApi.GetFlowmapSnapshot(jobTarget.ApplicationID, (int)snapshot["businessTransactionId"], snapshot["requestGUID"].ToString(), fromTimeUnix, toTimeUnix, differenceInMinutes);
- if (snapshotFlowmapJson != String.Empty) FileIOHelper.saveFileToFolder(snapshotFlowmapJson, snapshotFlowmapDataFilePath);
- }
+ if (programOptions.ProcessSequentially == false)
+ {
+ var backendsListChunks = backendsList.BreakListIntoChunks(METRIC_DETAILS_REPORT_NUMBER_OF_ENTITIES_TO_PROCESS_PER_THREAD);
- #endregion
+ Parallel.ForEach, int>(
+ backendsListChunks,
+ () => 0,
+ (backendsListChunk, loop, subtotal) =>
+ {
+ subtotal += reportMetricDetailBackends(
+ programOptions,
+ jobConfiguration,
+ jobTarget,
+ backendsListChunk,
+ backendsMetricsList,
+ eventsAllList,
+ healthRuleViolationEventsAllList,
+ snapshotsAllList,
+ segmentsAllList,
+ exitCallsAllList,
+ serviceEndpointCallsAllList,
+ detectedErrorsAllList,
+ businessDataAllList,
+ false);
+ return subtotal;
+ },
+ (finalResult) =>
+ {
+ j = Interlocked.Add(ref j, finalResult);
+ Console.Write("[{0}].", j);
+ }
+ );
+ }
+ else
+ {
+ j = reportMetricDetailBackends(
+ programOptions,
+ jobConfiguration,
+ jobTarget,
+ backendsList,
+ backendsMetricsList,
+ eventsAllList,
+ healthRuleViolationEventsAllList,
+ snapshotsAllList,
+ segmentsAllList,
+ exitCallsAllList,
+ serviceEndpointCallsAllList,
+ detectedErrorsAllList,
+ businessDataAllList,
+ true);
+ }
- #region Get List of Segments
+ loggerConsole.Info("{0} entities", j);
+ }
- // Get list of segments
- string snapshotSegmentsDataFilePath = Path.Combine(snapshotFolderPath, EXTRACT_SNAPSHOT_SEGMENT_FILE_NAME);
+ #endregion
- if (File.Exists(snapshotSegmentsDataFilePath) == false)
- {
- string snapshotSegmentsJson = controllerApi.GetSnapshotSegments(snapshot["requestGUID"].ToString(), snapshotTimeFrom, snapshotTimeTo, differenceInMinutes);
- if (snapshotSegmentsJson != String.Empty) FileIOHelper.saveFileToFolder(snapshotSegmentsJson, snapshotSegmentsDataFilePath);
- }
+ #region Business Transactions
- #endregion
+ List businessTransactionsList = FileIOHelper.readListFromCSVFile(businessTransactionsReportFilePath, new BusinessTransactionEntityReportMap());
- #region Get Details for Each Segment
+ metricsEntityFolderPath = Path.Combine(metricsFolderPath, BUSINESS_TRANSACTIONS_TYPE_SHORT);
+ entitiesFullRangeReportFilePath = Path.Combine(metricsEntityFolderPath, CONVERT_ENTITIES_METRICS_FULLRANGE_FILE_NAME);
+ List businessTransactionsMetricsList = FileIOHelper.readListFromCSVFile(entitiesFullRangeReportFilePath, new BusinessTransactionMetricReportMap());
- JArray snapshotSegmentsList = FileIOHelper.loadJArrayFromFile(snapshotSegmentsDataFilePath);
- if (snapshotSegmentsList != null)
- {
- // Get details for segment
- foreach (JToken snapshotSegment in snapshotSegmentsList)
+ if (businessTransactionsList != null)
{
- string snapshotSegmentDataFilePath = Path.Combine(snapshotFolderPath, String.Format(EXTRACT_SNAPSHOT_SEGMENT_DATA_FILE_NAME, snapshotSegment["id"]));
+ loggerConsole.Info("Entity Details for Business Transactions ({0} entities)", businessTransactionsList.Count);
- if (File.Exists(snapshotSegmentDataFilePath) == false)
- {
- string snapshotSegmentJson = controllerApi.GetSnapshotSegmentDetails((long)snapshotSegment["id"], fromTimeUnix, toTimeUnix, differenceInMinutes);
- if (snapshotSegmentJson != String.Empty) FileIOHelper.saveFileToFolder(snapshotSegmentJson, snapshotSegmentDataFilePath);
- }
- }
+ stepTimingTarget.NumEntities = stepTimingTarget.NumEntities + businessTransactionsList.Count;
- // Get errors for segment
- foreach (JToken snapshotSegment in snapshotSegmentsList)
- {
- string snapshotSegmentErrorFilePath = Path.Combine(snapshotFolderPath, String.Format(EXTRACT_SNAPSHOT_SEGMENT_ERROR_FILE_NAME, snapshotSegment["id"]));
+ int j = 0;
- if ((bool)snapshotSegment["errorOccurred"] == true && File.Exists(snapshotSegmentErrorFilePath) == false)
+ if (programOptions.ProcessSequentially == false)
{
- string snapshotSegmentJson = controllerApi.GetSnapshotSegmentErrors((long)snapshotSegment["id"], fromTimeUnix, toTimeUnix, differenceInMinutes);
- if (snapshotSegmentJson != String.Empty)
- {
- // "[ ]" == empty data. Don't create the file
- if (snapshotSegmentJson.Length > 3)
+ var businessTransactionsListChunks = businessTransactionsList.BreakListIntoChunks(METRIC_DETAILS_REPORT_NUMBER_OF_ENTITIES_TO_PROCESS_PER_THREAD);
+
+ Parallel.ForEach, int>(
+ businessTransactionsListChunks,
+ () => 0,
+ (businessTransactionsListChunk, loop, subtotal) =>
{
- FileIOHelper.saveFileToFolder(snapshotSegmentJson, snapshotSegmentErrorFilePath);
+ subtotal += reportMetricDetailBusinessTransactions(
+ programOptions,
+ jobConfiguration,
+ jobTarget,
+ businessTransactionsListChunk,
+ businessTransactionsMetricsList,
+ eventsAllList,
+ healthRuleViolationEventsAllList,
+ snapshotsAllList,
+ segmentsAllList,
+ exitCallsAllList,
+ serviceEndpointCallsAllList,
+ detectedErrorsAllList,
+ businessDataAllList,
+ false);
+ return subtotal;
+ },
+ (finalResult) =>
+ {
+ j = Interlocked.Add(ref j, finalResult);
+ Console.Write("[{0}].", j);
}
- }
+ );
+ }
+ else
+ {
+ j = reportMetricDetailBusinessTransactions(
+ programOptions,
+ jobConfiguration,
+ jobTarget,
+ businessTransactionsList,
+ businessTransactionsMetricsList,
+ eventsAllList,
+ healthRuleViolationEventsAllList,
+ snapshotsAllList,
+ segmentsAllList,
+ exitCallsAllList,
+ serviceEndpointCallsAllList,
+ detectedErrorsAllList,
+ businessDataAllList,
+ true);
}
+
+ loggerConsole.Info("{0} entities", j);
}
- // Get call graphs for segment
- foreach (JToken snapshotSegment in snapshotSegmentsList)
+ #endregion
+
+ #region Service Endpoints
+
+ List serviceEndpointsList = FileIOHelper.readListFromCSVFile(serviceEndpointsReportFilePath, new ServiceEndpointEntityReportMap());
+
+ metricsEntityFolderPath = Path.Combine(metricsFolderPath, SERVICE_ENDPOINTS_TYPE_SHORT);
+ entitiesFullRangeReportFilePath = Path.Combine(metricsEntityFolderPath, CONVERT_ENTITIES_METRICS_FULLRANGE_FILE_NAME);
+ List serviceEndpointsMetricsList = FileIOHelper.readListFromCSVFile(entitiesFullRangeReportFilePath, new ServiceEndpointMetricReportMap());
+
+ if (serviceEndpointsList != null)
{
- string snapshotSegmentCallGraphFilePath = Path.Combine(snapshotFolderPath, String.Format(EXTRACT_SNAPSHOT_SEGMENT_CALLGRAPH_FILE_NAME, snapshotSegment["id"]));
+ loggerConsole.Info("Entity Details for Service Endpoints ({0} entities)", serviceEndpointsList.Count);
- if (((bool)snapshotSegment["fullCallgraph"] == true || (bool)snapshotSegment["delayedCallGraph"] == true) && File.Exists(snapshotSegmentCallGraphFilePath) == false)
+ stepTimingTarget.NumEntities = stepTimingTarget.NumEntities + serviceEndpointsList.Count;
+
+ int j = 0;
+
+ if (programOptions.ProcessSequentially == false)
{
- string snapshotSegmentJson = controllerApi.GetSnapshotSegmentCallGraph((long)snapshotSegment["id"], fromTimeUnix, toTimeUnix, differenceInMinutes);
- if (snapshotSegmentJson != String.Empty) FileIOHelper.saveFileToFolder(snapshotSegmentJson, snapshotSegmentCallGraphFilePath);
+ var serviceEndpointsListChunks = serviceEndpointsList.BreakListIntoChunks(METRIC_DETAILS_REPORT_NUMBER_OF_ENTITIES_TO_PROCESS_PER_THREAD);
+
+ Parallel.ForEach, int>(
+ serviceEndpointsListChunks,
+ () => 0,
+ (serviceEndpointsListChunk, loop, subtotal) =>
+ {
+ subtotal += reportMetricDetailServiceEndpoints(
+ programOptions,
+ jobConfiguration,
+ jobTarget,
+ serviceEndpointsListChunk,
+ serviceEndpointsMetricsList,
+ eventsAllList,
+ healthRuleViolationEventsAllList,
+ snapshotsAllList,
+ segmentsAllList,
+ exitCallsAllList,
+ serviceEndpointCallsAllList,
+ detectedErrorsAllList,
+ businessDataAllList,
+ false);
+ return subtotal;
+ },
+ (finalResult) =>
+ {
+ j = Interlocked.Add(ref j, finalResult);
+ Console.Write("[{0}].", j);
+ }
+ );
+ }
+ else
+ {
+ j = reportMetricDetailServiceEndpoints(
+ programOptions,
+ jobConfiguration,
+ jobTarget,
+ serviceEndpointsList,
+ serviceEndpointsMetricsList,
+ eventsAllList,
+ healthRuleViolationEventsAllList,
+ snapshotsAllList,
+ segmentsAllList,
+ exitCallsAllList,
+ serviceEndpointCallsAllList,
+ detectedErrorsAllList,
+ businessDataAllList,
+ true);
}
+
+ loggerConsole.Info("{0} entities", j);
}
- }
- #endregion
+ #endregion
- }
+ #region Errors
- if (progressToConsole == true)
- {
- j++;
- if (j % 10 == 0)
+ List errorsList = FileIOHelper.readListFromCSVFile(errorsReportFilePath, new ErrorEntityReportMap());
+
+ metricsEntityFolderPath = Path.Combine(metricsFolderPath, ERRORS_TYPE_SHORT);
+ entitiesFullRangeReportFilePath = Path.Combine(metricsEntityFolderPath, CONVERT_ENTITIES_METRICS_FULLRANGE_FILE_NAME);
+ List errorsMetricsList = FileIOHelper.readListFromCSVFile(entitiesFullRangeReportFilePath, new ErrorMetricReportMap());
+
+ if (errorsList != null)
+ {
+ loggerConsole.Info("Entity Details for Errors ({0} entities)", errorsList.Count);
+
+ stepTimingTarget.NumEntities = stepTimingTarget.NumEntities + errorsList.Count;
+
+ int j = 0;
+
+ if (programOptions.ProcessSequentially == false)
+ {
+ var errorsListChunks = errorsList.BreakListIntoChunks(METRIC_DETAILS_REPORT_NUMBER_OF_ENTITIES_TO_PROCESS_PER_THREAD);
+
+ Parallel.ForEach, int>(
+ errorsListChunks,
+ () => 0,
+ (errorsListChunk, loop, subtotal) =>
+ {
+ subtotal += reportMetricDetailErrors(
+ programOptions,
+ jobConfiguration,
+ jobTarget,
+ errorsListChunk,
+ errorsMetricsList,
+ eventsAllList,
+ healthRuleViolationEventsAllList,
+ snapshotsAllList,
+ segmentsAllList,
+ exitCallsAllList,
+ serviceEndpointCallsAllList,
+ detectedErrorsAllList,
+ businessDataAllList,
+ false);
+ return subtotal;
+ },
+ (finalResult) =>
+ {
+ j = Interlocked.Add(ref j, finalResult);
+ Console.Write("[{0}].", j);
+ }
+ );
+ }
+ else
+ {
+ j = reportMetricDetailErrors(
+ programOptions,
+ jobConfiguration,
+ jobTarget,
+ errorsList,
+ errorsMetricsList,
+ eventsAllList,
+ healthRuleViolationEventsAllList,
+ snapshotsAllList,
+ segmentsAllList,
+ exitCallsAllList,
+ serviceEndpointCallsAllList,
+ detectedErrorsAllList,
+ businessDataAllList,
+ true);
+ }
+
+ loggerConsole.Info("{0} entities", j);
+ }
+
+ #endregion
+
+ }
+ catch (Exception ex)
{
- Console.Write("[{0}].", j);
+ logger.Warn(ex);
+ loggerConsole.Warn(ex);
+ }
+ finally
+ {
+ stopWatchTarget.Stop();
+
+ logger.Info("{0}({0:d}): [{1}/{2}], {3} {4} duration {5:c} ({6} ms)", jobStatus, i + 1, jobConfiguration.Target.Count, jobTarget.Controller, jobTarget.Application, stopWatchTarget.Elapsed, stopWatchTarget.ElapsedMilliseconds);
+ loggerConsole.Trace("{0}({0:d}): [{1}/{2}], {3} {4} duration {5:c} ({6} ms)", jobStatus, i + 1, jobConfiguration.Target.Count, jobTarget.Controller, jobTarget.Application, stopWatchTarget.Elapsed, stopWatchTarget.ElapsedMilliseconds);
+
+ stepTimingTarget.EndTime = DateTime.Now;
+ stepTimingTarget.Duration = stopWatchTarget.Elapsed;
+ stepTimingTarget.DurationMS = stopWatchTarget.ElapsedMilliseconds;
+
+ List stepTimings = new List(1);
+ stepTimings.Add(stepTimingTarget);
+ FileIOHelper.writeListToCSVFile(stepTimings, new StepTimingReportMap(), stepTimingReportFilePath, true);
}
}
+
+ return true;
}
+ catch (Exception ex)
+ {
+ logger.Error(ex);
+ loggerConsole.Error(ex);
- return entityList.Count;
+ return false;
+ }
+ finally
+ {
+ stopWatch.Stop();
+
+ logger.Info("{0}({0:d}): total duration {1:c} ({2} ms)", jobStatus, stopWatch.Elapsed, stopWatch.ElapsedMilliseconds);
+ loggerConsole.Trace("{0}({0:d}): total duration {1:c} ({2} ms)", jobStatus, stopWatch.Elapsed, stopWatch.ElapsedMilliseconds);
+
+ stepTimingFunction.EndTime = DateTime.Now;
+ stepTimingFunction.Duration = stopWatch.Elapsed;
+ stepTimingFunction.DurationMS = stopWatch.ElapsedMilliseconds;
+
+ List stepTimings = new List(1);
+ stepTimings.Add(stepTimingFunction);
+ FileIOHelper.writeListToCSVFile(stepTimings, new StepTimingReportMap(), stepTimingReportFilePath, true);
+ }
}
#endregion
- #region Metric detail conversion functions
+ #region Metric extraction functions
- private static void fillFullRangeMetricEntityRow(
- EntityBase entityRow,
- JobTimeRange jobTimeRange,
- string entityMetricPathPrefix,
- string metricsEntityFolderPath,
- List metricDataART,
- List metricDataCPM,
- List metricDataEPM,
- List metricDataEXCPM,
- List metricDataHTTPEPM)
+ private static void getMetricDataForMetricForAllRanges(ControllerApi controllerApi, JobTarget jobTarget, string metricPath, string metricName, JobConfiguration jobConfiguration, string metricsEntityFolderPath, bool progressToConsole)
{
- entityRow.Duration = (int)(jobTimeRange.To - jobTimeRange.From).Duration().TotalMinutes;
- entityRow.From = jobTimeRange.From.ToLocalTime();
- entityRow.To = jobTimeRange.To.ToLocalTime();
- entityRow.FromUtc = jobTimeRange.From;
- entityRow.ToUtc = jobTimeRange.To;
+ string metricEntitySubFolderName = metricNameToShortMetricNameMapping[metricName];
- // Determine the entity ID to bve used in ensuring we get only one specific entity
- // This is to address identically named Entities
- // Backends can be named identically - see Azure Table exits
- // Errors can also occasionally be named identically
- long entityID = -1;
- if (entityRow is EntityApplication)
- {
- // Application level metrics don't need ever have anything unusual
- }
- else if (entityRow is EntityTier)
- {
- entityID = entityRow.TierID;
- }
- else if (entityRow is EntityNode)
- {
- entityID = entityRow.TierID;
- }
- else if (entityRow is EntityBackend)
- {
- entityID = ((EntityBackend)entityRow).BackendID;
- }
- else if (entityRow is EntityBusinessTransaction)
- {
- entityID = ((EntityBusinessTransaction)entityRow).BTID;
- }
- else if (entityRow is EntityServiceEndpoint)
- {
- entityID = ((EntityServiceEndpoint)entityRow).SEPID;
- }
- else if (entityRow is EntityError)
- {
- entityID = ((EntityError)entityRow).ErrorID;
- }
- else if (entityRow is EntityInformationPoint)
- {
- entityID = ((EntityInformationPoint)entityRow).IPID;
- }
- entityRow.MetricsIDs = new List(5);
+ // Get the full range
+ JobTimeRange jobTimeRange = jobConfiguration.Input.ExpandedTimeRange;
- AppDRESTMetric thisEntityMetricData = null;
+ logger.Info("Retrieving metric for Application {0}({1}), Metric='{2}', From {3:o}, To {4:o}", jobTarget.Application, jobTarget.ApplicationID, metricPath, jobTimeRange.From, jobTimeRange.To);
- #region Read and convert metrics
+ string metricsJson = String.Empty;
- // ART
- string metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_ART_SHORTNAME);
- string entityMetricSummaryReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_SUMMARY_FILE_NAME);
- if (metricDataART != null && metricDataART.Count > 0)
+ string metricsDataFilePath = Path.Combine(metricsEntityFolderPath, metricEntitySubFolderName, String.Format(EXTRACT_METRIC_FULL_FILE_NAME, jobTimeRange.From, jobTimeRange.To));
+ if (File.Exists(metricsDataFilePath) == false)
{
- if (entityID != -1)
- {
- thisEntityMetricData = metricDataART.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
- }
- else
+ if (progressToConsole == true)
{
- thisEntityMetricData = metricDataART.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
+ Console.Write(".");
}
- if (thisEntityMetricData != null)
- {
- if (thisEntityMetricData.metricValues.Count > 0)
- {
- entityRow.ART = thisEntityMetricData.metricValues[0].value;
- entityRow.TimeTotal = thisEntityMetricData.metricValues[0].sum;
- }
- if (File.Exists(entityMetricSummaryReportFilePath) == false)
- {
- List metricSummaries = convertMetricSummaryToTypedListForCSV(thisEntityMetricData, entityRow, jobTimeRange);
- FileIOHelper.writeListToCSVFile(metricSummaries, new MetricSummaryMetricReportMap(), entityMetricSummaryReportFilePath, false);
- }
+ // First range is the whole thing
+ metricsJson = controllerApi.GetMetricData(
+ jobTarget.ApplicationID,
+ metricPath,
+ convertToUnixTimestamp(jobTimeRange.From),
+ convertToUnixTimestamp(jobTimeRange.To),
+ true);
- entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
- }
+ if (metricsJson != String.Empty) FileIOHelper.saveFileToFolder(metricsJson, metricsDataFilePath);
}
- // CPM
- metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_CPM_SHORTNAME);
- entityMetricSummaryReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_SUMMARY_FILE_NAME);
- if (metricDataCPM != null && metricDataCPM.Count > 0)
+ // Get the hourly time ranges
+ for (int j = 0; j < jobConfiguration.Input.HourlyTimeRanges.Count; j++)
{
- if (entityID != -1)
+ if (progressToConsole == true)
{
- thisEntityMetricData = metricDataCPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
+ Console.Write(".");
}
- else
+
+ jobTimeRange = jobConfiguration.Input.HourlyTimeRanges[j];
+
+ logger.Info("Retrieving metric for Application {0}({1}), Metric='{2}', From {3:o}, To {4:o}", jobTarget.Application, jobTarget.ApplicationID, metricPath, jobTimeRange.From, jobTimeRange.To);
+
+ metricsDataFilePath = Path.Combine(metricsEntityFolderPath, metricEntitySubFolderName, String.Format(EXTRACT_METRIC_HOUR_FILE_NAME, jobTimeRange.From, jobTimeRange.To));
+
+ if (File.Exists(metricsDataFilePath) == false)
{
- thisEntityMetricData = metricDataCPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
+ // Subsequent ones are details
+ metricsJson = controllerApi.GetMetricData(
+ jobTarget.ApplicationID,
+ metricPath,
+ convertToUnixTimestamp(jobTimeRange.From),
+ convertToUnixTimestamp(jobTimeRange.To),
+ false);
+
+ if (metricsJson != String.Empty) FileIOHelper.saveFileToFolder(metricsJson, metricsDataFilePath);
}
- if (thisEntityMetricData != null)
- {
- if (thisEntityMetricData.metricValues.Count > 0)
- {
- entityRow.CPM = thisEntityMetricData.metricValues[0].value;
- entityRow.Calls = thisEntityMetricData.metricValues[0].sum;
- }
+ }
+ }
- if (File.Exists(entityMetricSummaryReportFilePath) == false)
- {
- List metricSummaries = convertMetricSummaryToTypedListForCSV(thisEntityMetricData, entityRow, jobTimeRange);
- FileIOHelper.writeListToCSVFile(metricSummaries, new MetricSummaryMetricReportMap(), entityMetricSummaryReportFilePath, false);
- }
+ #endregion
- entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
- }
+ #region Flowmap extraction functions
+
+ private static int extractFlowmapsApplication(JobConfiguration jobConfiguration, JobTarget jobTarget, ControllerApi controllerApi, string metricsFolderPath, long fromTimeUnix, long toTimeUnix, long differenceInMinutes)
+ {
+ logger.Info("Retrieving flowmap for Application {0}, From {1:o}, To {2:o}", jobTarget.Application, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To);
+
+ string flowmapDataFilePath = Path.Combine(
+ metricsFolderPath,
+ APPLICATION_TYPE_SHORT,
+ String.Format(EXTRACT_ENTITY_FLOWMAP_FILE_NAME, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To));
+
+ string flowmapJson = String.Empty;
+
+ if (File.Exists(flowmapDataFilePath) == false)
+ {
+ flowmapJson = controllerApi.GetFlowmapApplication(jobTarget.ApplicationID, fromTimeUnix, toTimeUnix, differenceInMinutes);
+ if (flowmapJson != String.Empty) FileIOHelper.saveFileToFolder(flowmapJson, flowmapDataFilePath);
}
- // EPM
- metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_EPM_SHORTNAME);
- entityMetricSummaryReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_SUMMARY_FILE_NAME);
- if (metricDataEPM != null && metricDataEPM.Count > 0)
+ return 1;
+ }
+
+ private static int extractFlowmapsTiers(JobConfiguration jobConfiguration, JobTarget jobTarget, ControllerApi controllerApi, List entityList, string metricsFolderPath, long fromTimeUnix, long toTimeUnix, long differenceInMinutes, bool progressToConsole)
+ {
+ int j = 0;
+
+ foreach (AppDRESTTier tier in entityList)
{
- if (entityID != -1)
- {
- thisEntityMetricData = metricDataEPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
- }
- else
+ logger.Info("Retrieving flowmap for Application {0}, Tier {1}, From {2:o}, To {3:o}", jobTarget.Application, tier.name, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To);
+
+ string flowmapDataFilePath = Path.Combine(
+ metricsFolderPath,
+ TIERS_TYPE_SHORT,
+ getShortenedEntityNameForFileSystem(tier.name, tier.id),
+ String.Format(EXTRACT_ENTITY_FLOWMAP_FILE_NAME, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To));
+
+ if (File.Exists(flowmapDataFilePath) == false)
{
- thisEntityMetricData = metricDataEPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
+ string flowmapJson = controllerApi.GetFlowmapTier(tier.id, fromTimeUnix, toTimeUnix, differenceInMinutes);
+ if (flowmapJson != String.Empty) FileIOHelper.saveFileToFolder(flowmapJson, flowmapDataFilePath);
}
- if (thisEntityMetricData != null)
- {
- if (thisEntityMetricData.metricValues.Count > 0)
- {
- entityRow.EPM = thisEntityMetricData.metricValues[0].value;
- entityRow.Errors = thisEntityMetricData.metricValues[0].sum;
- entityRow.ErrorsPercentage = Math.Round((double)(double)entityRow.Errors / (double)entityRow.Calls * 100, 2);
- if (Double.IsNaN(entityRow.ErrorsPercentage) == true) entityRow.ErrorsPercentage = 0;
- }
- if (File.Exists(entityMetricSummaryReportFilePath) == false)
+ if (progressToConsole == true)
+ {
+ j++;
+ if (j % 10 == 0)
{
- List metricSummaries = convertMetricSummaryToTypedListForCSV(thisEntityMetricData, entityRow, jobTimeRange);
- FileIOHelper.writeListToCSVFile(metricSummaries, new MetricSummaryMetricReportMap(), entityMetricSummaryReportFilePath, false);
+ Console.Write("[{0}].", j);
}
-
- entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
}
}
- // EXCPM
- metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_EXCPM_SHORTNAME);
- entityMetricSummaryReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_SUMMARY_FILE_NAME);
- if (metricDataEXCPM != null && metricDataEXCPM.Count > 0)
+ return entityList.Count;
+ }
+
+ private static int extractFlowmapsNodes(JobConfiguration jobConfiguration, JobTarget jobTarget, ControllerApi controllerApi, List entityList, string metricsFolderPath, long fromTimeUnix, long toTimeUnix, long differenceInMinutes, bool progressToConsole)
+ {
+ int j = 0;
+
+ foreach (AppDRESTNode node in entityList)
{
- if (entityID != -1)
- {
- thisEntityMetricData = metricDataEXCPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
- }
- else
+ logger.Info("Retrieving flowmap for Application {0}, Tier {1}, Node {2}, From {3:o}, To {4:o}", jobTarget.Application, node.tierName, node.name, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To);
+
+ string flowmapDataFilePath = Path.Combine(
+ metricsFolderPath,
+ NODES_TYPE_SHORT,
+ getShortenedEntityNameForFileSystem(node.tierName, node.tierId),
+ getShortenedEntityNameForFileSystem(node.name, node.id),
+ String.Format(EXTRACT_ENTITY_FLOWMAP_FILE_NAME, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To));
+
+ if (File.Exists(flowmapDataFilePath) == false)
{
- thisEntityMetricData = metricDataEXCPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
+ string flowmapJson = controllerApi.GetFlowmapNode(node.id, fromTimeUnix, toTimeUnix, differenceInMinutes);
+ if (flowmapJson != String.Empty) FileIOHelper.saveFileToFolder(flowmapJson, flowmapDataFilePath);
}
- if (thisEntityMetricData != null)
- {
- if (thisEntityMetricData.metricValues.Count > 0)
- {
- entityRow.EXCPM = thisEntityMetricData.metricValues[0].value;
- entityRow.Exceptions = thisEntityMetricData.metricValues[0].sum;
- }
- if (File.Exists(entityMetricSummaryReportFilePath) == false)
+ if (progressToConsole == true)
+ {
+ j++;
+ if (j % 10 == 0)
{
- List metricSummaries = convertMetricSummaryToTypedListForCSV(thisEntityMetricData, entityRow, jobTimeRange);
- FileIOHelper.writeListToCSVFile(metricSummaries, new MetricSummaryMetricReportMap(), entityMetricSummaryReportFilePath, false);
+ Console.Write("[{0}].", j);
}
-
- entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
}
}
- // HTTPEPM
- metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_HTTPEPM_SHORTNAME);
- entityMetricSummaryReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_SUMMARY_FILE_NAME);
- if (metricDataHTTPEPM != null && metricDataHTTPEPM.Count > 0)
- {
- if (entityID != -1)
- {
- thisEntityMetricData = metricDataHTTPEPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
- }
- else
+ return entityList.Count;
+ }
+
+ private static int extractFlowmapsBackends(JobConfiguration jobConfiguration, JobTarget jobTarget, ControllerApi controllerApi, List entityList, string metricsFolderPath, long fromTimeUnix, long toTimeUnix, long differenceInMinutes, bool progressToConsole)
+ {
+ int j = 0;
+
+ foreach (AppDRESTBackend backend in entityList)
+ {
+ logger.Info("Retrieving flowmap for Application {0}, Backend {1}, From {2:o}, To {3:o}", jobTarget.Application, backend.name, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To);
+
+ string flowmapDataFilePath = Path.Combine(
+ metricsFolderPath,
+ BACKENDS_TYPE_SHORT,
+ getShortenedEntityNameForFileSystem(backend.name, backend.id),
+ String.Format(EXTRACT_ENTITY_FLOWMAP_FILE_NAME, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To));
+
+ if (File.Exists(flowmapDataFilePath) == false)
{
- thisEntityMetricData = metricDataHTTPEPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
+ string flowmapJson = controllerApi.GetFlowmapBackend(backend.id, fromTimeUnix, toTimeUnix, differenceInMinutes);
+ if (flowmapJson != String.Empty) FileIOHelper.saveFileToFolder(flowmapJson, flowmapDataFilePath);
}
- if (thisEntityMetricData != null)
- {
- if (thisEntityMetricData.metricValues.Count > 0)
- {
- entityRow.HTTPEPM = thisEntityMetricData.metricValues[0].value;
- entityRow.HttpErrors = thisEntityMetricData.metricValues[0].sum;
- }
- if (File.Exists(entityMetricSummaryReportFilePath) == false)
+ if (progressToConsole == true)
+ {
+ j++;
+ if (j % 10 == 0)
{
- List metricSummaries = convertMetricSummaryToTypedListForCSV(thisEntityMetricData, entityRow, jobTimeRange);
- FileIOHelper.writeListToCSVFile(metricSummaries, new MetricSummaryMetricReportMap(), entityMetricSummaryReportFilePath, false);
+ Console.Write("[{0}].", j);
}
-
- entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
}
}
- #endregion
-
- if (entityRow.ART == 0 && entityRow.TimeTotal == 0 &&
- entityRow.CPM == 0 && entityRow.Calls == 0 &&
- entityRow.EPM == 0 && entityRow.Errors == 0 &&
- entityRow.EXCPM == 0 && entityRow.Exceptions == 0 &&
- entityRow.HTTPEPM == 0 && entityRow.HttpErrors == 0)
- {
- entityRow.HasActivity = false;
- }
- else
- {
- entityRow.HasActivity = true;
- }
-
- // Add link to the metrics
- updateEntityWithDeeplinks(entityRow, jobTimeRange);
-
- return;
+ return entityList.Count;
}
- private static void fillHourlyRangeMetricEntityRowAndConvertMetricsToCSV(
- EntityBase entityRow,
- JobTimeRange jobTimeRange,
- string entityMetricPathPrefix,
- string metricsEntityFolderPath,
- int timeRangeIndex,
- List metricDataART,
- List metricDataCPM,
- List metricDataEPM,
- List metricDataEXCPM,
- List metricDataHTTPEPM)
+ private static int extractFlowmapsBusinessTransactions(JobConfiguration jobConfiguration, JobTarget jobTarget, ControllerApi controllerApi, List entityList, string metricsFolderPath, long fromTimeUnix, long toTimeUnix, long differenceInMinutes, bool progressToConsole)
{
- entityRow.Duration = (int)(jobTimeRange.To - jobTimeRange.From).Duration().TotalMinutes;
- entityRow.From = jobTimeRange.From.ToLocalTime();
- entityRow.To = jobTimeRange.To.ToLocalTime();
- entityRow.FromUtc = jobTimeRange.From;
- entityRow.ToUtc = jobTimeRange.To;
+ int j = 0;
- // Determine the entity ID to bve used in ensuring we get only one specific entity
- // This is to address identically named Entities
- // Backends can be named identically - see Azure Table exits
- // Errors can also occasionally be named identically
- long entityID = -1;
- if (entityRow is EntityApplication)
- {
- // Application level metrics don't need ever have anything unusual
- }
- else if (entityRow is EntityTier)
- {
- entityID = entityRow.TierID;
- }
- else if (entityRow is EntityNode)
- {
- entityID = entityRow.TierID;
- }
- else if (entityRow is EntityBackend)
- {
- entityID = ((EntityBackend)entityRow).BackendID;
- }
- else if (entityRow is EntityBusinessTransaction)
- {
- entityID = ((EntityBusinessTransaction)entityRow).BTID;
- }
- else if (entityRow is EntityServiceEndpoint)
- {
- entityID = ((EntityServiceEndpoint)entityRow).SEPID;
- }
- else if (entityRow is EntityError)
- {
- entityID = ((EntityError)entityRow).ErrorID;
- }
- else if (entityRow is EntityInformationPoint)
+ foreach (AppDRESTBusinessTransaction businessTransaction in entityList)
{
- entityID = ((EntityInformationPoint)entityRow).IPID;
- }
-
- if (entityRow.MetricsIDs == null) { entityRow.MetricsIDs = new List(5); }
-
- bool appendRecordsToExistingFile = true;
- if (timeRangeIndex == 0) { appendRecordsToExistingFile = false; }
-
- AppDRESTMetric thisEntityMetricData = null;
+ logger.Info("Retrieving flowmap for Application {0}, Tier {1}, Business Transaction {2}, From {3:o}, To {4:o}", jobTarget.Application, businessTransaction.tierName, businessTransaction.name, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To);
- #region Read and convert metrics
+ string flowmapDataFilePath = Path.Combine(
+ metricsFolderPath,
+ BUSINESS_TRANSACTIONS_TYPE_SHORT,
+ getShortenedEntityNameForFileSystem(businessTransaction.tierName, businessTransaction.tierId),
+ getShortenedEntityNameForFileSystem(businessTransaction.name, businessTransaction.id),
+ String.Format(EXTRACT_ENTITY_FLOWMAP_FILE_NAME, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To));
- // ART
- string metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_ART_SHORTNAME);
- string entityMetricReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_VALUES_FILE_NAME);
- if (metricDataART != null && metricDataART.Count > 0)
- {
- if (entityID != -1)
- {
- thisEntityMetricData = metricDataART.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
- }
- else
+ if (File.Exists(flowmapDataFilePath) == false)
{
- thisEntityMetricData = metricDataART.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
+ string flowmapJson = controllerApi.GetFlowmapBusinessTransaction(jobTarget.ApplicationID, businessTransaction.id, fromTimeUnix, toTimeUnix, differenceInMinutes);
+ if (flowmapJson != String.Empty) FileIOHelper.saveFileToFolder(flowmapJson, flowmapDataFilePath);
}
- if (thisEntityMetricData != null)
+
+ if (progressToConsole == true)
{
- if (thisEntityMetricData.metricValues.Count > 0)
+ j++;
+ if (j % 10 == 0)
{
- double intermediateART = (double)thisEntityMetricData.metricValues.Sum(mv => mv.sum) / (double)thisEntityMetricData.metricValues.Sum(mv => mv.count);
- if (Double.IsNaN(intermediateART) == true)
- {
- entityRow.ART = 0;
- }
- else
- {
- entityRow.ART = (long)Math.Round(intermediateART, 0);
- }
- entityRow.TimeTotal = thisEntityMetricData.metricValues.Sum(mv => mv.sum);
+ Console.Write("[{0}].", j);
}
+ }
+ }
- List metricValues = convertMetricValueToTypedListForCSV(thisEntityMetricData);
- FileIOHelper.writeListToCSVFile(metricValues, new MetricValueMetricReportMap(), entityMetricReportFilePath, appendRecordsToExistingFile);
+ return entityList.Count;
+ }
- entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
- }
+ #endregion
+
+ #region Event extraction functions
+
+ private static int extractEvents(JobConfiguration jobConfiguration, JobTarget jobTarget, ControllerApi controllerApi, string eventsFolderPath, string eventType, bool progressToConsole)
+ {
+ if (progressToConsole == true)
+ {
+ loggerConsole.Info("Extract {0} events ({1} time ranges)", eventType, jobConfiguration.Input.HourlyTimeRanges.Count);
}
- // CPM
- metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_CPM_SHORTNAME);
- entityMetricReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_VALUES_FILE_NAME);
- if (metricDataCPM != null && metricDataCPM.Count > 0)
+ JArray listOfEvents = new JArray();
+ int totalEventsFound = 0;
+ foreach (JobTimeRange jobTimeRange in jobConfiguration.Input.HourlyTimeRanges)
{
- if (entityID != -1)
- {
- thisEntityMetricData = metricDataCPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
- }
- else
- {
- thisEntityMetricData = metricDataCPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
- }
- if (thisEntityMetricData != null)
+ long fromTimeUnix = convertToUnixTimestamp(jobTimeRange.From);
+ long toTimeUnix = convertToUnixTimestamp(jobTimeRange.To);
+
+ string eventsJSON = controllerApi.GetEvents(jobTarget.ApplicationID, eventType, fromTimeUnix, toTimeUnix);
+ if (eventsJSON != String.Empty)
{
- if (thisEntityMetricData.metricValues.Count > 0)
+ // Load events
+ JArray eventsInHour = JArray.Parse(eventsJSON);
+ foreach (JObject interestingEvent in eventsInHour)
{
- entityRow.CPM = (long)Math.Round((double)((double)thisEntityMetricData.metricValues.Sum(mv => mv.sum) / (double)entityRow.Duration), 0);
- entityRow.Calls = thisEntityMetricData.metricValues.Sum(mv => mv.sum);
+ listOfEvents.Add(interestingEvent);
}
+ totalEventsFound = totalEventsFound + eventsInHour.Count;
- List metricValues = convertMetricValueToTypedListForCSV(thisEntityMetricData);
- FileIOHelper.writeListToCSVFile(metricValues, new MetricValueMetricReportMap(), entityMetricReportFilePath, appendRecordsToExistingFile);
-
- entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
+ if (progressToConsole == true)
+ {
+ Console.Write("+{0}", eventsInHour.Count);
+ }
}
}
- // EPM
- metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_EPM_SHORTNAME);
- entityMetricReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_VALUES_FILE_NAME);
- if (metricDataEPM != null && metricDataEPM.Count > 0)
+ if (listOfEvents.Count > 0)
{
- if (entityID != -1)
- {
- thisEntityMetricData = metricDataEPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
- }
- else
+ string eventsFilePath = Path.Combine(
+ eventsFolderPath,
+ String.Format(EVENTS_FILE_NAME, eventType, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To));
+
+ FileIOHelper.writeJArrayToFile(listOfEvents, eventsFilePath);
+
+ logger.Info("{0} events from {1:o} to {2:o}", listOfEvents.Count, jobConfiguration.Input.ExpandedTimeRange.From, jobConfiguration.Input.ExpandedTimeRange.To);
+ if (progressToConsole == true)
{
- thisEntityMetricData = metricDataEPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
+ Console.Write("=");
+ loggerConsole.Info("{0} {1} events", listOfEvents.Count, eventType);
}
- if (thisEntityMetricData != null)
+ }
+ else
+ {
+ if (progressToConsole == true)
{
- if (thisEntityMetricData.metricValues.Count > 0)
- {
- entityRow.EPM = (long)Math.Round((double)((double)thisEntityMetricData.metricValues.Sum(mv => mv.sum) / (double)entityRow.Duration), 0);
- entityRow.Errors = thisEntityMetricData.metricValues.Sum(mv => mv.sum);
- entityRow.ErrorsPercentage = Math.Round((double)(double)entityRow.Errors / (double)entityRow.Calls * 100, 2);
- if (Double.IsNaN(entityRow.ErrorsPercentage) == true) entityRow.ErrorsPercentage = 0;
- }
-
- List metricValues = convertMetricValueToTypedListForCSV(thisEntityMetricData);
- FileIOHelper.writeListToCSVFile(metricValues, new MetricValueMetricReportMap(), entityMetricReportFilePath, appendRecordsToExistingFile);
-
- entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
+ Console.WriteLine();
}
}
- // EXCPM
- metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_EXCPM_SHORTNAME);
- entityMetricReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_VALUES_FILE_NAME);
- if (metricDataEXCPM != null && metricDataEXCPM.Count > 0)
+ return listOfEvents.Count;
+ }
+
+ #endregion
+
+ #region Snapshot extraction functions
+
+ private static int extractSnapshots(JobConfiguration jobConfiguration, JobTarget jobTarget, ControllerApi controllerApi, List entityList, string snapshotsFolderPath, bool progressToConsole)
+ {
+ int j = 0;
+
+ foreach (JToken snapshot in entityList)
{
- if (entityID != -1)
- {
- thisEntityMetricData = metricDataEXCPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
- }
- else
- {
- thisEntityMetricData = metricDataEXCPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
- }
- if (thisEntityMetricData != null)
+ // Only do first in chain
+ if ((bool)snapshot["firstInChain"] == true)
{
- if (thisEntityMetricData.metricValues.Count > 0)
+ logger.Info("Retrieving snapshot for Application {0}, Tier {1}, Business Transaction {2}, RequestGUID {3}", jobTarget.Application, snapshot["applicationComponentName"], snapshot["businessTransactionName"], snapshot["requestGUID"]);
+
+ #region Target step variables
+
+ DateTime snapshotTime = convertFromUnixTimestamp((long)snapshot["serverStartTime"]);
+
+ string snapshotFolderPath = Path.Combine(
+ snapshotsFolderPath,
+ getShortenedEntityNameForFileSystem(snapshot["applicationComponentName"].ToString(), (long)snapshot["applicationComponentId"]),
+ getShortenedEntityNameForFileSystem(snapshot["businessTransactionName"].ToString(), (long)snapshot["businessTransactionId"]),
+ String.Format("{0:yyyyMMddHH}", snapshotTime),
+ userExperienceFolderNameMapping[snapshot["userExperience"].ToString()],
+ String.Format(SNAPSHOT_FOLDER_NAME, snapshot["requestGUID"], snapshotTime));
+
+ // Must strip out the milliseconds, because the segment list retrieval doesn't seem to like them in the datetimes
+ DateTime snapshotTimeFrom = snapshotTime.AddMinutes(-30).AddMilliseconds(snapshotTime.Millisecond * -1);
+ DateTime snapshotTimeTo = snapshotTime.AddMinutes(30).AddMilliseconds(snapshotTime.Millisecond * -1);
+
+ long fromTimeUnix = convertToUnixTimestamp(snapshotTimeFrom);
+ long toTimeUnix = convertToUnixTimestamp(snapshotTimeTo);
+ int differenceInMinutes = (int)(snapshotTimeTo - snapshotTimeFrom).TotalMinutes;
+
+ #endregion
+
+ #region Get Snapshot Flowmap
+
+ // Get snapshot flow map
+ string snapshotFlowmapDataFilePath = Path.Combine(snapshotFolderPath, EXTRACT_SNAPSHOT_FLOWMAP_FILE_NAME);
+
+ if (File.Exists(snapshotFlowmapDataFilePath) == false)
{
- entityRow.EXCPM = (long)Math.Round((double)((double)thisEntityMetricData.metricValues.Sum(mv => mv.sum) / (double)entityRow.Duration), 0);
- entityRow.Exceptions = thisEntityMetricData.metricValues.Sum(mv => mv.sum);
+ string snapshotFlowmapJson = controllerApi.GetFlowmapSnapshot(jobTarget.ApplicationID, (int)snapshot["businessTransactionId"], snapshot["requestGUID"].ToString(), fromTimeUnix, toTimeUnix, differenceInMinutes);
+ if (snapshotFlowmapJson != String.Empty) FileIOHelper.saveFileToFolder(snapshotFlowmapJson, snapshotFlowmapDataFilePath);
}
- List metricValues = convertMetricValueToTypedListForCSV(thisEntityMetricData);
- FileIOHelper.writeListToCSVFile(metricValues, new MetricValueMetricReportMap(), entityMetricReportFilePath, appendRecordsToExistingFile);
+ #endregion
- entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
- }
- }
+ #region Get List of Segments
- // HTTPEPM
- metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_HTTPEPM_SHORTNAME);
- entityMetricReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_VALUES_FILE_NAME);
- if (metricDataHTTPEPM != null && metricDataHTTPEPM.Count > 0)
- {
- if (entityID != -1)
- {
- thisEntityMetricData = metricDataHTTPEPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
- }
- else
- {
- thisEntityMetricData = metricDataHTTPEPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
- }
- if (thisEntityMetricData != null)
- {
- if (thisEntityMetricData.metricValues.Count > 0)
+ // Get list of segments
+ string snapshotSegmentsDataFilePath = Path.Combine(snapshotFolderPath, EXTRACT_SNAPSHOT_SEGMENT_FILE_NAME);
+
+ if (File.Exists(snapshotSegmentsDataFilePath) == false)
{
- entityRow.HTTPEPM = (long)Math.Round((double)((double)thisEntityMetricData.metricValues.Sum(mv => mv.sum) / (double)entityRow.Duration), 0);
- entityRow.HttpErrors = thisEntityMetricData.metricValues.Sum(mv => mv.sum);
+ string snapshotSegmentsJson = controllerApi.GetSnapshotSegments(snapshot["requestGUID"].ToString(), snapshotTimeFrom, snapshotTimeTo, differenceInMinutes);
+ if (snapshotSegmentsJson != String.Empty) FileIOHelper.saveFileToFolder(snapshotSegmentsJson, snapshotSegmentsDataFilePath);
}
- List metricValues = convertMetricValueToTypedListForCSV(thisEntityMetricData);
- FileIOHelper.writeListToCSVFile(metricValues, new MetricValueMetricReportMap(), entityMetricReportFilePath, appendRecordsToExistingFile);
+ #endregion
+
+ #region Get Details for Each Segment
+
+ JArray snapshotSegmentsList = FileIOHelper.loadJArrayFromFile(snapshotSegmentsDataFilePath);
+ if (snapshotSegmentsList != null)
+ {
+ // Get details for segment
+ foreach (JToken snapshotSegment in snapshotSegmentsList)
+ {
+ string snapshotSegmentDataFilePath = Path.Combine(snapshotFolderPath, String.Format(EXTRACT_SNAPSHOT_SEGMENT_DATA_FILE_NAME, snapshotSegment["id"]));
+
+ if (File.Exists(snapshotSegmentDataFilePath) == false)
+ {
+ string snapshotSegmentJson = controllerApi.GetSnapshotSegmentDetails((long)snapshotSegment["id"], fromTimeUnix, toTimeUnix, differenceInMinutes);
+ if (snapshotSegmentJson != String.Empty) FileIOHelper.saveFileToFolder(snapshotSegmentJson, snapshotSegmentDataFilePath);
+ }
+ }
+
+ // Get errors for segment
+ foreach (JToken snapshotSegment in snapshotSegmentsList)
+ {
+ string snapshotSegmentErrorFilePath = Path.Combine(snapshotFolderPath, String.Format(EXTRACT_SNAPSHOT_SEGMENT_ERROR_FILE_NAME, snapshotSegment["id"]));
+
+ if ((bool)snapshotSegment["errorOccurred"] == true && File.Exists(snapshotSegmentErrorFilePath) == false)
+ {
+ string snapshotSegmentJson = controllerApi.GetSnapshotSegmentErrors((long)snapshotSegment["id"], fromTimeUnix, toTimeUnix, differenceInMinutes);
+ if (snapshotSegmentJson != String.Empty)
+ {
+ // "[ ]" == empty data. Don't create the file
+ if (snapshotSegmentJson.Length > 3)
+ {
+ FileIOHelper.saveFileToFolder(snapshotSegmentJson, snapshotSegmentErrorFilePath);
+ }
+ }
+ }
+ }
+
+ // Get call graphs for segment
+ foreach (JToken snapshotSegment in snapshotSegmentsList)
+ {
+ string snapshotSegmentCallGraphFilePath = Path.Combine(snapshotFolderPath, String.Format(EXTRACT_SNAPSHOT_SEGMENT_CALLGRAPH_FILE_NAME, snapshotSegment["id"]));
+
+ if (((bool)snapshotSegment["fullCallgraph"] == true || (bool)snapshotSegment["delayedCallGraph"] == true) && File.Exists(snapshotSegmentCallGraphFilePath) == false)
+ {
+ string snapshotSegmentJson = controllerApi.GetSnapshotSegmentCallGraph((long)snapshotSegment["id"], fromTimeUnix, toTimeUnix, differenceInMinutes);
+ if (snapshotSegmentJson != String.Empty) FileIOHelper.saveFileToFolder(snapshotSegmentJson, snapshotSegmentCallGraphFilePath);
+ }
+ }
+ }
+
+ #endregion
- entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
}
- }
- if (entityRow.ART == 0 && entityRow.TimeTotal == 0 &&
- entityRow.CPM == 0 && entityRow.Calls == 0 &&
- entityRow.EPM == 0 && entityRow.Errors == 0 &&
- entityRow.EXCPM == 0 && entityRow.Exceptions == 0 &&
- entityRow.HTTPEPM == 0 && entityRow.HttpErrors == 0)
- {
- entityRow.HasActivity = false;
- }
- else
- {
- entityRow.HasActivity = true;
+ if (progressToConsole == true)
+ {
+ j++;
+ if (j % 10 == 0)
+ {
+ Console.Write("[{0}].", j);
+ }
+ }
}
- #endregion
+ return entityList.Count;
+ }
- // Add link to the metrics
- updateEntityWithDeeplinks(entityRow, jobTimeRange);
+ #endregion
- return;
- }
- private static bool updateEntityWithDeeplinks(EntityBase entityRow)
- {
- return updateEntityWithDeeplinks(entityRow, null);
- }
+ #region Metric detail conversion functions
- private static bool updateEntityWithDeeplinks(EntityBase entityRow, JobTimeRange jobTimeRange)
+ private static void fillFullRangeMetricEntityRow(
+ EntityBase entityRow,
+ JobTimeRange jobTimeRange,
+ string entityMetricPathPrefix,
+ string metricsEntityFolderPath,
+ List metricDataART,
+ List metricDataCPM,
+ List metricDataEPM,
+ List metricDataEXCPM,
+ List metricDataHTTPEPM)
{
- // Decide what kind of timerange
- string DEEPLINK_THIS_TIMERANGE = DEEPLINK_TIMERANGE_LAST_15_MINUTES;
- if (jobTimeRange != null)
- {
- long fromTimeUnix = convertToUnixTimestamp(jobTimeRange.From);
- long toTimeUnix = convertToUnixTimestamp(jobTimeRange.To);
- long differenceInMinutes = (toTimeUnix - fromTimeUnix) / (60000);
- DEEPLINK_THIS_TIMERANGE = String.Format(DEEPLINK_TIMERANGE_BETWEEN_TIMES, toTimeUnix, fromTimeUnix, differenceInMinutes);
- }
+ entityRow.Duration = (int)(jobTimeRange.To - jobTimeRange.From).Duration().TotalMinutes;
+ entityRow.From = jobTimeRange.From.ToLocalTime();
+ entityRow.To = jobTimeRange.To.ToLocalTime();
+ entityRow.FromUtc = jobTimeRange.From;
+ entityRow.ToUtc = jobTimeRange.To;
- // Determine what kind of entity we are dealing with and adjust accordingly
- string deepLinkMetricTemplateInMetricBrowser = DEEPLINK_METRIC_APPLICATION_TARGET_METRIC_ID;
- long entityIdForMetricBrowser = entityRow.ApplicationID;
+ // Determine the entity ID to bve used in ensuring we get only one specific entity
+ // This is to address identically named Entities
+ // Backends can be named identically - see Azure Table exits
+ // Errors can also occasionally be named identically
+ long entityID = -1;
if (entityRow is EntityApplication)
{
- entityRow.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entityRow.Controller, DEEPLINK_THIS_TIMERANGE);
- entityRow.ApplicationLink = String.Format(DEEPLINK_APPLICATION, entityRow.Controller, entityRow.ApplicationID, DEEPLINK_THIS_TIMERANGE);
+ // Application level metrics don't need ever have anything unusual
}
else if (entityRow is EntityTier)
{
- entityRow.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entityRow.Controller, DEEPLINK_THIS_TIMERANGE);
- entityRow.ApplicationLink = String.Format(DEEPLINK_APPLICATION, entityRow.Controller, entityRow.ApplicationID, DEEPLINK_THIS_TIMERANGE);
- entityRow.TierLink = String.Format(DEEPLINK_TIER, entityRow.Controller, entityRow.ApplicationID, entityRow.TierID, DEEPLINK_THIS_TIMERANGE);
- deepLinkMetricTemplateInMetricBrowser = DEEPLINK_METRIC_TIER_TARGET_METRIC_ID;
- entityIdForMetricBrowser = entityRow.TierID;
+ entityID = entityRow.TierID;
}
else if (entityRow is EntityNode)
{
- entityRow.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entityRow.Controller, DEEPLINK_THIS_TIMERANGE);
- entityRow.ApplicationLink = String.Format(DEEPLINK_APPLICATION, entityRow.Controller, entityRow.ApplicationID, DEEPLINK_THIS_TIMERANGE);
- entityRow.TierLink = String.Format(DEEPLINK_TIER, entityRow.Controller, entityRow.ApplicationID, entityRow.TierID, DEEPLINK_THIS_TIMERANGE);
- entityRow.NodeLink = String.Format(DEEPLINK_NODE, entityRow.Controller, entityRow.ApplicationID, entityRow.NodeID, DEEPLINK_THIS_TIMERANGE);
- deepLinkMetricTemplateInMetricBrowser = DEEPLINK_METRIC_NODE_TARGET_METRIC_ID;
- entityIdForMetricBrowser = entityRow.NodeID;
+ entityID = entityRow.TierID;
}
else if (entityRow is EntityBackend)
{
- entityRow.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entityRow.Controller, DEEPLINK_THIS_TIMERANGE);
- entityRow.ApplicationLink = String.Format(DEEPLINK_APPLICATION, entityRow.Controller, entityRow.ApplicationID, DEEPLINK_THIS_TIMERANGE);
- ((EntityBackend)entityRow).BackendLink = String.Format(DEEPLINK_BACKEND, entityRow.Controller, entityRow.ApplicationID, ((EntityBackend)entityRow).BackendID, DEEPLINK_THIS_TIMERANGE);
+ entityID = ((EntityBackend)entityRow).BackendID;
}
else if (entityRow is EntityBusinessTransaction)
{
- entityRow.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entityRow.Controller, DEEPLINK_THIS_TIMERANGE);
- entityRow.ApplicationLink = String.Format(DEEPLINK_APPLICATION, entityRow.Controller, entityRow.ApplicationID, DEEPLINK_THIS_TIMERANGE);
- entityRow.TierLink = String.Format(DEEPLINK_TIER, entityRow.Controller, entityRow.ApplicationID, entityRow.TierID, DEEPLINK_THIS_TIMERANGE);
- ((EntityBusinessTransaction)entityRow).BTLink = String.Format(DEEPLINK_BUSINESS_TRANSACTION, entityRow.Controller, entityRow.ApplicationID, ((EntityBusinessTransaction)entityRow).BTID, DEEPLINK_THIS_TIMERANGE);
- deepLinkMetricTemplateInMetricBrowser = DEEPLINK_METRIC_TIER_TARGET_METRIC_ID;
- entityIdForMetricBrowser = entityRow.TierID;
+ entityID = ((EntityBusinessTransaction)entityRow).BTID;
}
else if (entityRow is EntityServiceEndpoint)
{
- entityRow.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entityRow.Controller, DEEPLINK_THIS_TIMERANGE);
- entityRow.ApplicationLink = String.Format(DEEPLINK_APPLICATION, entityRow.Controller, entityRow.ApplicationID, DEEPLINK_THIS_TIMERANGE);
- entityRow.TierLink = String.Format(DEEPLINK_TIER, entityRow.Controller, entityRow.ApplicationID, entityRow.TierID, DEEPLINK_THIS_TIMERANGE);
- ((EntityServiceEndpoint)entityRow).SEPLink = String.Format(DEEPLINK_SERVICE_ENDPOINT, entityRow.Controller, entityRow.ApplicationID, entityRow.TierID, ((EntityServiceEndpoint)entityRow).SEPID, DEEPLINK_THIS_TIMERANGE);
+ entityID = ((EntityServiceEndpoint)entityRow).SEPID;
}
else if (entityRow is EntityError)
{
- entityRow.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entityRow.Controller, DEEPLINK_THIS_TIMERANGE);
- entityRow.ApplicationLink = String.Format(DEEPLINK_APPLICATION, entityRow.Controller, entityRow.ApplicationID, DEEPLINK_THIS_TIMERANGE);
- entityRow.TierLink = String.Format(DEEPLINK_TIER, entityRow.Controller, entityRow.ApplicationID, entityRow.TierID, DEEPLINK_THIS_TIMERANGE);
- ((EntityError)entityRow).ErrorLink = String.Format(DEEPLINK_ERROR, entityRow.Controller, entityRow.ApplicationID, ((EntityError)entityRow).ErrorID, DEEPLINK_THIS_TIMERANGE);
+ entityID = ((EntityError)entityRow).ErrorID;
}
else if (entityRow is EntityInformationPoint)
{
- entityRow.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entityRow.Controller, DEEPLINK_THIS_TIMERANGE);
- entityRow.ApplicationLink = String.Format(DEEPLINK_APPLICATION, entityRow.Controller, entityRow.ApplicationID, DEEPLINK_THIS_TIMERANGE);
- ((EntityInformationPoint)entityRow).IPLink = String.Format(DEEPLINK_INFORMATION_POINT, entityRow.Controller, entityRow.ApplicationID, ((EntityInformationPoint)entityRow).IPID, DEEPLINK_THIS_TIMERANGE);
+ entityID = ((EntityInformationPoint)entityRow).IPID;
}
+ entityRow.MetricsIDs = new List(5);
- if (entityRow.MetricsIDs != null && entityRow.MetricsIDs.Count > 0)
- {
- StringBuilder sb = new StringBuilder(128);
- foreach (int metricID in entityRow.MetricsIDs)
+ AppDRESTMetric thisEntityMetricData = null;
+
+ #region Read and convert metrics
+
+ // ART
+ string metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_ART_SHORTNAME);
+ string entityMetricSummaryReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_SUMMARY_FILE_NAME);
+ if (metricDataART != null && metricDataART.Count > 0)
+ {
+ if (entityID != -1)
{
- sb.Append(String.Format(deepLinkMetricTemplateInMetricBrowser, entityIdForMetricBrowser, metricID));
- sb.Append(",");
+ thisEntityMetricData = metricDataART.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
}
- sb.Remove(sb.Length - 1, 1);
- entityRow.MetricLink = String.Format(DEEPLINK_METRIC, entityRow.Controller, entityRow.ApplicationID, sb.ToString(), DEEPLINK_THIS_TIMERANGE);
- }
+ else
+ {
+ thisEntityMetricData = metricDataART.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
+ }
+ if (thisEntityMetricData != null)
+ {
+ if (thisEntityMetricData.metricValues.Count > 0)
+ {
+ entityRow.ART = thisEntityMetricData.metricValues[0].value;
+ entityRow.TimeTotal = thisEntityMetricData.metricValues[0].sum;
+ }
- return true;
- }
+ if (File.Exists(entityMetricSummaryReportFilePath) == false)
+ {
+ List metricSummaries = convertMetricSummaryToTypedListForCSV(thisEntityMetricData, entityRow, jobTimeRange);
+ FileIOHelper.writeListToCSVFile(metricSummaries, new MetricSummaryMetricReportMap(), entityMetricSummaryReportFilePath, false);
+ }
- private static void updateEntitiesWithReportDetailLinksApplication(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobTarget jobTarget, List entityList)
- {
- string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
- string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
- string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
- string reportsFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
+ entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
+ }
+ }
- for (int i = 0; i < entityList.Count; i++)
+ // CPM
+ metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_CPM_SHORTNAME);
+ entityMetricSummaryReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_SUMMARY_FILE_NAME);
+ if (metricDataCPM != null && metricDataCPM.Count > 0)
{
- EntityBase entityRow = entityList[i];
- entityRow.DetailLink = String.Format(@"=HYPERLINK(""{0}"", """")", getEntityMetricReportFilePath(programOptions, jobConfiguration, jobTarget, entityRow).Substring(reportsFolderPath.Length + 1));
- }
- }
+ if (entityID != -1)
+ {
+ thisEntityMetricData = metricDataCPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
+ }
+ else
+ {
+ thisEntityMetricData = metricDataCPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
+ }
+ if (thisEntityMetricData != null)
+ {
+ if (thisEntityMetricData.metricValues.Count > 0)
+ {
+ entityRow.CPM = thisEntityMetricData.metricValues[0].value;
+ entityRow.Calls = thisEntityMetricData.metricValues[0].sum;
+ }
- private static void updateEntitiesWithReportDetailLinksTiers(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobTarget jobTarget, List entityList)
- {
- string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
- string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
- string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
- string reportsFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
+ if (File.Exists(entityMetricSummaryReportFilePath) == false)
+ {
+ List metricSummaries = convertMetricSummaryToTypedListForCSV(thisEntityMetricData, entityRow, jobTimeRange);
+ FileIOHelper.writeListToCSVFile(metricSummaries, new MetricSummaryMetricReportMap(), entityMetricSummaryReportFilePath, false);
+ }
- for (int i = 0; i < entityList.Count; i++)
- {
- EntityBase entityRow = entityList[i];
- entityRow.DetailLink = String.Format(@"=HYPERLINK(""{0}"", """")", getEntityMetricReportFilePath(programOptions, jobConfiguration, jobTarget, entityRow).Substring(reportsFolderPath.Length + 1));
+ entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
+ }
}
- }
-
- private static void updateEntitiesWithReportDetailLinksNodes(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobTarget jobTarget, List entityList)
- {
- string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
- string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
- string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
- string reportsFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
- for (int i = 0; i < entityList.Count; i++)
+ // EPM
+ metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_EPM_SHORTNAME);
+ entityMetricSummaryReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_SUMMARY_FILE_NAME);
+ if (metricDataEPM != null && metricDataEPM.Count > 0)
{
- EntityBase entityRow = entityList[i];
- entityRow.DetailLink = String.Format(@"=HYPERLINK(""{0}"", """")", getEntityMetricReportFilePath(programOptions, jobConfiguration, jobTarget, entityRow).Substring(reportsFolderPath.Length + 1));
- }
- }
+ if (entityID != -1)
+ {
+ thisEntityMetricData = metricDataEPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
+ }
+ else
+ {
+ thisEntityMetricData = metricDataEPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
+ }
+ if (thisEntityMetricData != null)
+ {
+ if (thisEntityMetricData.metricValues.Count > 0)
+ {
+ entityRow.EPM = thisEntityMetricData.metricValues[0].value;
+ entityRow.Errors = thisEntityMetricData.metricValues[0].sum;
+ entityRow.ErrorsPercentage = Math.Round((double)(double)entityRow.Errors / (double)entityRow.Calls * 100, 2);
+ if (Double.IsNaN(entityRow.ErrorsPercentage) == true) entityRow.ErrorsPercentage = 0;
+ }
- private static void updateEntitiesWithReportDetailLinksBackends(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobTarget jobTarget, List entityList)
- {
- string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
- string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
- string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
- string reportsFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
+ if (File.Exists(entityMetricSummaryReportFilePath) == false)
+ {
+ List metricSummaries = convertMetricSummaryToTypedListForCSV(thisEntityMetricData, entityRow, jobTimeRange);
+ FileIOHelper.writeListToCSVFile(metricSummaries, new MetricSummaryMetricReportMap(), entityMetricSummaryReportFilePath, false);
+ }
- for (int i = 0; i < entityList.Count; i++)
- {
- EntityBase entityRow = entityList[i];
- entityRow.DetailLink = String.Format(@"=HYPERLINK(""{0}"", """")", getEntityMetricReportFilePath(programOptions, jobConfiguration, jobTarget, entityRow).Substring(reportsFolderPath.Length + 1));
+ entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
+ }
}
- }
-
- private static void updateEntitiesWithReportDetailLinksBusinessTransactions(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobTarget jobTarget, List entityList)
- {
- string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
- string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
- string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
- string reportsFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
- for (int i = 0; i < entityList.Count; i++)
+ // EXCPM
+ metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_EXCPM_SHORTNAME);
+ entityMetricSummaryReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_SUMMARY_FILE_NAME);
+ if (metricDataEXCPM != null && metricDataEXCPM.Count > 0)
{
- EntityBase entityRow = entityList[i];
- entityRow.DetailLink = String.Format(@"=HYPERLINK(""{0}"", """")", getEntityMetricReportFilePath(programOptions, jobConfiguration, jobTarget, entityRow).Substring(reportsFolderPath.Length + 1));
- }
- }
+ if (entityID != -1)
+ {
+ thisEntityMetricData = metricDataEXCPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
+ }
+ else
+ {
+ thisEntityMetricData = metricDataEXCPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
+ }
+ if (thisEntityMetricData != null)
+ {
+ if (thisEntityMetricData.metricValues.Count > 0)
+ {
+ entityRow.EXCPM = thisEntityMetricData.metricValues[0].value;
+ entityRow.Exceptions = thisEntityMetricData.metricValues[0].sum;
+ }
- private static void updateEntitiesWithReportDetailLinksServiceEndpoints(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobTarget jobTarget, List entityList)
- {
- string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
- string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
- string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
- string reportsFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
+ if (File.Exists(entityMetricSummaryReportFilePath) == false)
+ {
+ List metricSummaries = convertMetricSummaryToTypedListForCSV(thisEntityMetricData, entityRow, jobTimeRange);
+ FileIOHelper.writeListToCSVFile(metricSummaries, new MetricSummaryMetricReportMap(), entityMetricSummaryReportFilePath, false);
+ }
- for (int i = 0; i < entityList.Count; i++)
- {
- EntityBase entityRow = entityList[i];
- entityRow.DetailLink = String.Format(@"=HYPERLINK(""{0}"", """")", getEntityMetricReportFilePath(programOptions, jobConfiguration, jobTarget, entityRow).Substring(reportsFolderPath.Length + 1));
+ entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
+ }
}
- }
-
- private static void updateEntitiesWithReportDetailLinksErrors(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobTarget jobTarget, List entityList)
- {
- string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
- string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
- string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
- string reportsFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
- for (int i = 0; i < entityList.Count; i++)
+ // HTTPEPM
+ metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_HTTPEPM_SHORTNAME);
+ entityMetricSummaryReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_SUMMARY_FILE_NAME);
+ if (metricDataHTTPEPM != null && metricDataHTTPEPM.Count > 0)
{
- EntityBase entityRow = entityList[i];
- entityRow.DetailLink = String.Format(@"=HYPERLINK(""{0}"", """")", getEntityMetricReportFilePath(programOptions, jobConfiguration, jobTarget, entityRow).Substring(reportsFolderPath.Length + 1));
+ if (entityID != -1)
+ {
+ thisEntityMetricData = metricDataHTTPEPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
+ }
+ else
+ {
+ thisEntityMetricData = metricDataHTTPEPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
+ }
+ if (thisEntityMetricData != null)
+ {
+ if (thisEntityMetricData.metricValues.Count > 0)
+ {
+ entityRow.HTTPEPM = thisEntityMetricData.metricValues[0].value;
+ entityRow.HttpErrors = thisEntityMetricData.metricValues[0].sum;
+ }
+
+ if (File.Exists(entityMetricSummaryReportFilePath) == false)
+ {
+ List metricSummaries = convertMetricSummaryToTypedListForCSV(thisEntityMetricData, entityRow, jobTimeRange);
+ FileIOHelper.writeListToCSVFile(metricSummaries, new MetricSummaryMetricReportMap(), entityMetricSummaryReportFilePath, false);
+ }
+
+ entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
+ }
}
- }
- private static void updateEntitiesWithReportDetailLinksInformationPoints(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobTarget jobTarget, List entityList)
- {
- string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
- string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
- string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
- string reportsFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
+ #endregion
- for (int i = 0; i < entityList.Count; i++)
+ if (entityRow.ART == 0 && entityRow.TimeTotal == 0 &&
+ entityRow.CPM == 0 && entityRow.Calls == 0 &&
+ entityRow.EPM == 0 && entityRow.Errors == 0 &&
+ entityRow.EXCPM == 0 && entityRow.Exceptions == 0 &&
+ entityRow.HTTPEPM == 0 && entityRow.HttpErrors == 0)
{
- EntityBase entityRow = entityList[i];
- entityRow.DetailLink = String.Format(@"=HYPERLINK(""{0}"", """")", getEntityMetricReportFilePath(programOptions, jobConfiguration, jobTarget, entityRow).Substring(reportsFolderPath.Length + 1));
+ entityRow.HasActivity = false;
+ }
+ else
+ {
+ entityRow.HasActivity = true;
}
+
+ // Add link to the metrics
+ updateEntityWithDeeplinks(entityRow, jobTimeRange);
+
+ return;
}
- private static List convertMetricValueToTypedListForCSV(AppDRESTMetric metricValueObject)
- {
- List metricValues = new List(metricValueObject.metricValues.Count);
- foreach (AppDRESTMetricValue mv in metricValueObject.metricValues)
- {
- MetricValue metricValue = new MetricValue();
- metricValue.EventTimeStampUtc = convertFromUnixTimestamp(mv.startTimeInMillis);
- metricValue.EventTimeStamp = metricValue.EventTimeStampUtc.ToLocalTime();
- metricValue.EventTime = metricValue.EventTimeStamp;
- metricValue.Count = mv.count;
- metricValue.Min = mv.min;
- metricValue.Max = mv.max;
- metricValue.Occurences = mv.occurrences;
- metricValue.Sum = mv.sum;
- metricValue.Value = mv.value;
-
- metricValue.MetricID = metricValueObject.metricId;
- switch (metricValueObject.frequency)
- {
- case "SIXTY_MIN":
- {
- metricValue.MetricResolution = MetricResolution.SIXTY_MIN;
- break;
- }
- case "TEN_MIN":
- {
- metricValue.MetricResolution = MetricResolution.TEN_MIN;
- break;
- }
- case "ONE_MIN":
- {
- metricValue.MetricResolution = MetricResolution.ONE_MIN;
- break;
- }
- default:
- {
- metricValue.MetricResolution = MetricResolution.ONE_MIN;
- break;
- }
- }
- metricValues.Add(metricValue);
- }
-
- return metricValues;
- }
-
- private static List convertMetricSummaryToTypedListForCSV(AppDRESTMetric metricValueObject, EntityBase entityRow, JobTimeRange jobTimeRange)
+ private static void fillHourlyRangeMetricEntityRowAndConvertMetricsToCSV(
+ EntityBase entityRow,
+ JobTimeRange jobTimeRange,
+ string entityMetricPathPrefix,
+ string metricsEntityFolderPath,
+ int timeRangeIndex,
+ List metricDataART,
+ List metricDataCPM,
+ List metricDataEPM,
+ List metricDataEXCPM,
+ List metricDataHTTPEPM)
{
- List metricSummaries = new List();
- metricSummaries.Add(new MetricSummary() {
- PropertyName = "Controller",
- PropertyValue = entityRow.Controller,
- Link = entityRow.ControllerLink });
- metricSummaries.Add(new MetricSummary() {
- PropertyName = "Application",
- PropertyValue = entityRow.ApplicationName,
- Link = entityRow.ApplicationLink });
+ entityRow.Duration = (int)(jobTimeRange.To - jobTimeRange.From).Duration().TotalMinutes;
+ entityRow.From = jobTimeRange.From.ToLocalTime();
+ entityRow.To = jobTimeRange.To.ToLocalTime();
+ entityRow.FromUtc = jobTimeRange.From;
+ entityRow.ToUtc = jobTimeRange.To;
- string deepLinkMetricTemplateInMetricBrowser = DEEPLINK_METRIC_APPLICATION_TARGET_METRIC_ID;
- long entityIdForMetricBrowser = entityRow.ApplicationID;
+ // Determine the entity ID to bve used in ensuring we get only one specific entity
+ // This is to address identically named Entities
+ // Backends can be named identically - see Azure Table exits
+ // Errors can also occasionally be named identically
+ long entityID = -1;
if (entityRow is EntityApplication)
{
- metricSummaries.Add(new MetricSummary() { PropertyName = "EntityType", PropertyValue = "Application" });
- metricSummaries.Add(new MetricSummary() { PropertyName = "ApplicationID", PropertyValue = entityRow.ApplicationID });
+ // Application level metrics don't need ever have anything unusual
}
else if (entityRow is EntityTier)
{
- metricSummaries.Add(new MetricSummary() { PropertyName = "EntityType", PropertyValue = "Tier" });
- metricSummaries.Add(new MetricSummary() {
- PropertyName = "Tier",
- PropertyValue = entityRow.TierName,
- Link = entityRow.TierLink });
- metricSummaries.Add(new MetricSummary() { PropertyName = "ApplicationID", PropertyValue = entityRow.ApplicationID });
- metricSummaries.Add(new MetricSummary() { PropertyName = "TierID", PropertyValue = entityRow.TierID });
- deepLinkMetricTemplateInMetricBrowser = DEEPLINK_METRIC_TIER_TARGET_METRIC_ID;
- entityIdForMetricBrowser = entityRow.TierID;
+ entityID = entityRow.TierID;
}
else if (entityRow is EntityNode)
{
- metricSummaries.Add(new MetricSummary() { PropertyName = "EntityType", PropertyValue = "Node" });
- metricSummaries.Add(new MetricSummary()
- {
- PropertyName = "Tier",
- PropertyValue = entityRow.TierName,
- Link = entityRow.TierLink
- });
- metricSummaries.Add(new MetricSummary()
- {
- PropertyName = "Node",
- PropertyValue = entityRow.NodeName,
- Link = entityRow.NodeLink
- });
- metricSummaries.Add(new MetricSummary() { PropertyName = "ApplicationID", PropertyValue = entityRow.ApplicationID });
- metricSummaries.Add(new MetricSummary() { PropertyName = "TierID", PropertyValue = entityRow.TierID });
- metricSummaries.Add(new MetricSummary() { PropertyName = "NodeID", PropertyValue = entityRow.NodeID });
- deepLinkMetricTemplateInMetricBrowser = DEEPLINK_METRIC_NODE_TARGET_METRIC_ID;
- entityIdForMetricBrowser = entityRow.NodeID;
+ entityID = entityRow.TierID;
}
else if (entityRow is EntityBackend)
{
- metricSummaries.Add(new MetricSummary() { PropertyName = "EntityType", PropertyValue = "Backend" });
- metricSummaries.Add(new MetricSummary()
- {
- PropertyName = "Tier",
- PropertyValue = entityRow.TierName,
- Link = entityRow.TierLink
- });
- metricSummaries.Add(new MetricSummary()
- {
- PropertyName = "Backend",
- PropertyValue = ((EntityBackend)entityRow).BackendName,
- Link = ((EntityBackend)entityRow).BackendLink
- });
- metricSummaries.Add(new MetricSummary() { PropertyName = "ApplicationID", PropertyValue = entityRow.ApplicationID });
- metricSummaries.Add(new MetricSummary() { PropertyName = "TierID", PropertyValue = entityRow.TierID });
- metricSummaries.Add(new MetricSummary() { PropertyName = "BackendID", PropertyValue = ((EntityBackend)entityRow).BackendID });
+ entityID = ((EntityBackend)entityRow).BackendID;
}
else if (entityRow is EntityBusinessTransaction)
{
- metricSummaries.Add(new MetricSummary() { PropertyName = "EntityType", PropertyValue = "Business Transaction" });
- metricSummaries.Add(new MetricSummary()
- {
- PropertyName = "Tier",
- PropertyValue = entityRow.TierName,
- Link = entityRow.TierLink
- });
- metricSummaries.Add(new MetricSummary()
- {
- PropertyName = "Business Transaction",
- PropertyValue = ((EntityBusinessTransaction)entityRow).BTName,
- Link = ((EntityBusinessTransaction)entityRow).BTLink
- });
- metricSummaries.Add(new MetricSummary() { PropertyName = "ApplicationID", PropertyValue = entityRow.ApplicationID });
- metricSummaries.Add(new MetricSummary() { PropertyName = "TierID", PropertyValue = entityRow.TierID });
- metricSummaries.Add(new MetricSummary() { PropertyName = "BTID", PropertyValue = ((EntityBusinessTransaction)entityRow).BTID });
- deepLinkMetricTemplateInMetricBrowser = DEEPLINK_METRIC_TIER_TARGET_METRIC_ID;
- entityIdForMetricBrowser = entityRow.TierID;
+ entityID = ((EntityBusinessTransaction)entityRow).BTID;
}
else if (entityRow is EntityServiceEndpoint)
{
- metricSummaries.Add(new MetricSummary() { PropertyName = "EntityType", PropertyValue = "Service Endpoint" });
- metricSummaries.Add(new MetricSummary()
- {
- PropertyName = "Tier",
- PropertyValue = entityRow.TierName,
- Link = entityRow.TierLink
- });
- metricSummaries.Add(new MetricSummary()
- {
- PropertyName = "Service Endpoint",
- PropertyValue = ((EntityServiceEndpoint)entityRow).SEPName,
- Link = ((EntityServiceEndpoint)entityRow).SEPLink
- });
- metricSummaries.Add(new MetricSummary() { PropertyName = "ApplicationID", PropertyValue = entityRow.ApplicationID });
- metricSummaries.Add(new MetricSummary() { PropertyName = "TierID", PropertyValue = entityRow.TierID });
- metricSummaries.Add(new MetricSummary() { PropertyName = "SEPID", PropertyValue = ((EntityServiceEndpoint)entityRow).SEPID });
+ entityID = ((EntityServiceEndpoint)entityRow).SEPID;
}
else if (entityRow is EntityError)
{
- metricSummaries.Add(new MetricSummary() { PropertyName = "EntityType", PropertyValue = "Error" });
- metricSummaries.Add(new MetricSummary()
- {
- PropertyName = "Tier",
- PropertyValue = entityRow.TierName,
- Link = entityRow.TierLink
- });
- metricSummaries.Add(new MetricSummary()
- {
- PropertyName = "Error",
- PropertyValue = ((EntityError)entityRow).ErrorName,
- Link = ((EntityError)entityRow).ErrorLink
- });
- metricSummaries.Add(new MetricSummary() { PropertyName = "ApplicationID", PropertyValue = entityRow.ApplicationID });
- metricSummaries.Add(new MetricSummary() { PropertyName = "TierID", PropertyValue = entityRow.TierID });
- metricSummaries.Add(new MetricSummary() { PropertyName = "ErrorID", PropertyValue = ((EntityError)entityRow).ErrorID });
+ entityID = ((EntityError)entityRow).ErrorID;
}
-
- // Decide what kind of timerange
- string DEEPLINK_THIS_TIMERANGE = DEEPLINK_TIMERANGE_LAST_15_MINUTES;
- if (jobTimeRange != null)
+ else if (entityRow is EntityInformationPoint)
{
- long fromTimeUnix = convertToUnixTimestamp(jobTimeRange.From);
- long toTimeUnix = convertToUnixTimestamp(jobTimeRange.To);
- long differenceInMinutes = (toTimeUnix - fromTimeUnix) / (60000);
- DEEPLINK_THIS_TIMERANGE = String.Format(DEEPLINK_TIMERANGE_BETWEEN_TIMES, toTimeUnix, fromTimeUnix, differenceInMinutes);
+ entityID = ((EntityInformationPoint)entityRow).IPID;
}
- metricSummaries.Add(new MetricSummary()
- {
- PropertyName = "Metric ID",
- PropertyValue = metricValueObject.metricId,
- Link = String.Format(DEEPLINK_METRIC, entityRow.Controller, entityRow.ApplicationID, String.Format(deepLinkMetricTemplateInMetricBrowser, entityIdForMetricBrowser, metricValueObject.metricId), DEEPLINK_THIS_TIMERANGE)
- });
+ if (entityRow.MetricsIDs == null) { entityRow.MetricsIDs = new List(5); }
- // Name of the metric is always the last one in the metric path
- string[] metricPathComponents = metricValueObject.metricPath.Split('|');
- string metricName = metricPathComponents[metricPathComponents.Length - 1];
- MetricSummary metricNameMetricSummary = new MetricSummary() { PropertyName = "Metric Name", PropertyValue = metricName };
- metricSummaries.Add(metricNameMetricSummary);
- metricSummaries.Add(new MetricSummary() { PropertyName = "Metric Name (Short)", PropertyValue = metricNameToShortMetricNameMapping[metricNameMetricSummary.PropertyValue.ToString()] });
- metricSummaries.Add(new MetricSummary() { PropertyName = "Metric Name (Full)", PropertyValue = metricValueObject.metricName });
- metricSummaries.Add(new MetricSummary() { PropertyName = "Metric Path", PropertyValue = metricValueObject.metricPath });
+ bool appendRecordsToExistingFile = true;
+ if (timeRangeIndex == 0) { appendRecordsToExistingFile = false; }
- // Only the metrics with Average Response Time (ms) are times
- // As long as we are not in Application Infrastructure Performance area
- if (metricName.IndexOf(METRIC_TIME_MS) > 0)
- {
- metricSummaries.Add(new MetricSummary() { PropertyName = "Rollup Type", PropertyValue = MetricType.Duration.ToString() });
- }
- else
- {
- metricSummaries.Add(new MetricSummary() { PropertyName = "Rollup Type", PropertyValue = MetricType.Count.ToString() });
- }
+ AppDRESTMetric thisEntityMetricData = null;
- return metricSummaries;
- }
+ #region Read and convert metrics
- #endregion
+ // ART
+ string metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_ART_SHORTNAME);
+ string entityMetricReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_VALUES_FILE_NAME);
+ if (metricDataART != null && metricDataART.Count > 0)
+ {
+ if (entityID != -1)
+ {
+ thisEntityMetricData = metricDataART.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
+ }
+ else
+ {
+ thisEntityMetricData = metricDataART.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
+ }
+ if (thisEntityMetricData != null)
+ {
+ if (thisEntityMetricData.metricValues.Count > 0)
+ {
+ double intermediateART = (double)thisEntityMetricData.metricValues.Sum(mv => mv.sum) / (double)thisEntityMetricData.metricValues.Sum(mv => mv.count);
+ if (Double.IsNaN(intermediateART) == true)
+ {
+ entityRow.ART = 0;
+ }
+ else
+ {
+ entityRow.ART = (long)Math.Round(intermediateART, 0);
+ }
+ entityRow.TimeTotal = thisEntityMetricData.metricValues.Sum(mv => mv.sum);
+ }
- #region Configuration detail conversion functions
+ List metricValues = convertMetricValueToTypedListForCSV(thisEntityMetricData);
+ FileIOHelper.writeListToCSVFile(metricValues, new MetricValueMetricReportMap(), entityMetricReportFilePath, appendRecordsToExistingFile);
- private static string getNameValueDetailsFromNameValueCollection(XmlNode xmlNodeWithNameValuePairs)
- {
- if (xmlNodeWithNameValuePairs == null) return String.Empty;
+ entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
+ }
+ }
- StringBuilder sb = new StringBuilder();
- foreach (XmlNode xmlNodeNameValue in xmlNodeWithNameValuePairs.SelectNodes("name-values"))
+ // CPM
+ metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_CPM_SHORTNAME);
+ entityMetricReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_VALUES_FILE_NAME);
+ if (metricDataCPM != null && metricDataCPM.Count > 0)
{
- sb.AppendFormat("{0}={1};", xmlNodeNameValue.SelectSingleNode("name").InnerText, xmlNodeNameValue.SelectSingleNode("value").InnerText);
- }
-
- return sb.ToString();
- }
+ if (entityID != -1)
+ {
+ thisEntityMetricData = metricDataCPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
+ }
+ else
+ {
+ thisEntityMetricData = metricDataCPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
+ }
+ if (thisEntityMetricData != null)
+ {
+ if (thisEntityMetricData.metricValues.Count > 0)
+ {
+ entityRow.CPM = (long)Math.Round((double)((double)thisEntityMetricData.metricValues.Sum(mv => mv.sum) / (double)entityRow.Duration), 0);
+ entityRow.Calls = thisEntityMetricData.metricValues.Sum(mv => mv.sum);
+ }
- private static string getNameValueDetailsFromParametersCollection(XmlNode xmlNodeWithParameters)
- {
- if (xmlNodeWithParameters == null) return String.Empty;
+ List metricValues = convertMetricValueToTypedListForCSV(thisEntityMetricData);
+ FileIOHelper.writeListToCSVFile(metricValues, new MetricValueMetricReportMap(), entityMetricReportFilePath, appendRecordsToExistingFile);
- StringBuilder sb = new StringBuilder();
- foreach (XmlNode xmlNodeNameValue in xmlNodeWithParameters.SelectNodes("parameter"))
- {
- sb.AppendFormat(
- "{0}:{1}/{2}={3}/{4};",
- xmlNodeNameValue.Attributes["match-type"].Value,
- xmlNodeNameValue.SelectSingleNode("name").Attributes["filter-value"].Value,
- xmlNodeNameValue.SelectSingleNode("name").Attributes["filter-type"].Value,
- xmlNodeNameValue.SelectSingleNode("value").Attributes["filter-value"].Value,
- xmlNodeNameValue.SelectSingleNode("value").Attributes["filter-type"].Value);
+ entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
+ }
}
- return sb.ToString();
- }
-
- private static int getIntegerValueFromXmlNode(XmlNode xmlNode)
- {
- if (xmlNode == null) return 0;
-
- if (((XmlElement)xmlNode).IsEmpty == true)
- {
- return 0;
- }
- else
+ // EPM
+ metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_EPM_SHORTNAME);
+ entityMetricReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_VALUES_FILE_NAME);
+ if (metricDataEPM != null && metricDataEPM.Count > 0)
{
- int value;
- if (Int32.TryParse(xmlNode.InnerText, out value) == true)
+ if (entityID != -1)
{
- return value;
+ thisEntityMetricData = metricDataEPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
}
else
{
- double value1;
- if (Double.TryParse(xmlNode.InnerText, out value1) == true)
- {
- return Convert.ToInt32(Math.Floor(value1));
- }
- else
+ thisEntityMetricData = metricDataEPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
+ }
+ if (thisEntityMetricData != null)
+ {
+ if (thisEntityMetricData.metricValues.Count > 0)
{
- return 0;
+ entityRow.EPM = (long)Math.Round((double)((double)thisEntityMetricData.metricValues.Sum(mv => mv.sum) / (double)entityRow.Duration), 0);
+ entityRow.Errors = thisEntityMetricData.metricValues.Sum(mv => mv.sum);
+ entityRow.ErrorsPercentage = Math.Round((double)(double)entityRow.Errors / (double)entityRow.Calls * 100, 2);
+ if (Double.IsNaN(entityRow.ErrorsPercentage) == true) entityRow.ErrorsPercentage = 0;
}
- }
- }
- }
- private static long getLongValueFromXmlNode(XmlNode xmlNode)
- {
- if (xmlNode == null) return 0;
+ List metricValues = convertMetricValueToTypedListForCSV(thisEntityMetricData);
+ FileIOHelper.writeListToCSVFile(metricValues, new MetricValueMetricReportMap(), entityMetricReportFilePath, appendRecordsToExistingFile);
- if (((XmlElement)xmlNode).IsEmpty == true)
- {
- return 0;
+ entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
+ }
}
- else
+
+ // EXCPM
+ metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_EXCPM_SHORTNAME);
+ entityMetricReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_VALUES_FILE_NAME);
+ if (metricDataEXCPM != null && metricDataEXCPM.Count > 0)
{
- long value;
- if (Int64.TryParse(xmlNode.InnerText, out value) == true)
+ if (entityID != -1)
{
- return value;
+ thisEntityMetricData = metricDataEXCPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
}
else
{
- double value1;
- if (Double.TryParse(xmlNode.InnerText, out value1) == true)
- {
- return Convert.ToInt64(Math.Floor(value1));
- }
- else
+ thisEntityMetricData = metricDataEXCPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
+ }
+ if (thisEntityMetricData != null)
+ {
+ if (thisEntityMetricData.metricValues.Count > 0)
{
- return 0;
+ entityRow.EXCPM = (long)Math.Round((double)((double)thisEntityMetricData.metricValues.Sum(mv => mv.sum) / (double)entityRow.Duration), 0);
+ entityRow.Exceptions = thisEntityMetricData.metricValues.Sum(mv => mv.sum);
}
- }
- }
- }
- private static bool getBoolValueFromXmlNode(XmlNode xmlNode)
- {
- if (xmlNode == null) return false;
+ List metricValues = convertMetricValueToTypedListForCSV(thisEntityMetricData);
+ FileIOHelper.writeListToCSVFile(metricValues, new MetricValueMetricReportMap(), entityMetricReportFilePath, appendRecordsToExistingFile);
- if (((XmlElement)xmlNode).IsEmpty == true)
- {
- return false;
+ entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
+ }
}
- else
+
+ // HTTPEPM
+ metricsDataFolderPath = Path.Combine(metricsEntityFolderPath, METRIC_HTTPEPM_SHORTNAME);
+ entityMetricReportFilePath = Path.Combine(metricsDataFolderPath, CONVERT_METRIC_VALUES_FILE_NAME);
+ if (metricDataHTTPEPM != null && metricDataHTTPEPM.Count > 0)
{
- bool value;
- if (Boolean.TryParse(xmlNode.InnerText, out value) == true)
+ if (entityID != -1)
{
- return value;
+ thisEntityMetricData = metricDataHTTPEPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true && m.metricName.Contains(entityID.ToString()) == true).FirstOrDefault();
}
else
{
- return false;
+ thisEntityMetricData = metricDataHTTPEPM.Where(m => m.metricPath.StartsWith(entityMetricPathPrefix) == true).FirstOrDefault();
}
- }
- }
+ if (thisEntityMetricData != null)
+ {
+ if (thisEntityMetricData.metricValues.Count > 0)
+ {
+ entityRow.HTTPEPM = (long)Math.Round((double)((double)thisEntityMetricData.metricValues.Sum(mv => mv.sum) / (double)entityRow.Duration), 0);
+ entityRow.HttpErrors = thisEntityMetricData.metricValues.Sum(mv => mv.sum);
+ }
- private static string getStringValueFromXmlNode(XmlNode xmlNode)
- {
- if (xmlNode == null) return String.Empty;
+ List metricValues = convertMetricValueToTypedListForCSV(thisEntityMetricData);
+ FileIOHelper.writeListToCSVFile(metricValues, new MetricValueMetricReportMap(), entityMetricReportFilePath, appendRecordsToExistingFile);
- if (((XmlElement)xmlNode).IsEmpty == true)
- {
- return String.Empty;
- }
- else
- {
- return xmlNode.InnerText;
+ entityRow.MetricsIDs.Add(thisEntityMetricData.metricId);
+ }
}
- }
-
- ///
- /// https://stackoverflow.com/questions/1123718/format-xml-string-to-print-friendly-xml-string
- ///
- ///
- ///
- private static string makeXMLFormattedAndIndented(String XML)
- {
- string Result = "";
-
- MemoryStream MS = new MemoryStream();
- XmlTextWriter W = new XmlTextWriter(MS, Encoding.Unicode);
- XmlDocument D = new XmlDocument();
- try
+ if (entityRow.ART == 0 && entityRow.TimeTotal == 0 &&
+ entityRow.CPM == 0 && entityRow.Calls == 0 &&
+ entityRow.EPM == 0 && entityRow.Errors == 0 &&
+ entityRow.EXCPM == 0 && entityRow.Exceptions == 0 &&
+ entityRow.HTTPEPM == 0 && entityRow.HttpErrors == 0)
{
- // Load the XmlDocument with the XML.
- D.LoadXml(XML);
-
- W.Formatting = Formatting.Indented;
-
- // Write the XML into a formatting XmlTextWriter
- D.WriteContentTo(W);
- W.Flush();
- MS.Flush();
-
- // Have to rewind the MemoryStream in order to read
- // its contents.
- MS.Position = 0;
-
- // Read MemoryStream contents into a StreamReader.
- StreamReader SR = new StreamReader(MS);
-
- // Extract the text from the StreamReader.
- String FormattedXML = SR.ReadToEnd();
-
- Result = FormattedXML;
+ entityRow.HasActivity = false;
}
- catch (XmlException)
+ else
{
+ entityRow.HasActivity = true;
}
- MS.Close();
- W.Close();
+ #endregion
- return Result;
+ // Add link to the metrics
+ updateEntityWithDeeplinks(entityRow, jobTimeRange);
+
+ return;
}
- private static string makeXMLFormattedAndIndented(XmlNode xmlNode)
+ private static bool updateEntityWithDeeplinks(EntityBase entityRow)
{
- if (xmlNode != null)
- {
- return makeXMLFormattedAndIndented(xmlNode.OuterXml);
- }
- else
- {
- return String.Empty;
- }
+ return updateEntityWithDeeplinks(entityRow, null);
}
- private static string makeXMLFormattedAndIndented(XmlNodeList xmlNodeList)
+ private static bool updateEntityWithDeeplinks(EntityBase entityRow, JobTimeRange jobTimeRange)
{
- if (xmlNodeList.Count > 0)
+ // Decide what kind of timerange
+ string DEEPLINK_THIS_TIMERANGE = DEEPLINK_TIMERANGE_LAST_15_MINUTES;
+ if (jobTimeRange != null)
{
- StringBuilder sb = new StringBuilder(128 * xmlNodeList.Count);
- foreach (XmlNode xmlNode in xmlNodeList)
- {
- sb.Append(makeXMLFormattedAndIndented(xmlNode));
- sb.AppendLine();
- }
- sb.Remove(sb.Length - 1, 1);
- return sb.ToString();
+ long fromTimeUnix = convertToUnixTimestamp(jobTimeRange.From);
+ long toTimeUnix = convertToUnixTimestamp(jobTimeRange.To);
+ long differenceInMinutes = (toTimeUnix - fromTimeUnix) / (60000);
+ DEEPLINK_THIS_TIMERANGE = String.Format(DEEPLINK_TIMERANGE_BETWEEN_TIMES, toTimeUnix, fromTimeUnix, differenceInMinutes);
}
- else
+
+ // Determine what kind of entity we are dealing with and adjust accordingly
+ string deepLinkMetricTemplateInMetricBrowser = DEEPLINK_METRIC_APPLICATION_TARGET_METRIC_ID;
+ long entityIdForMetricBrowser = entityRow.ApplicationID;
+ if (entityRow is EntityApplication)
{
- return String.Empty;
+ entityRow.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entityRow.Controller, DEEPLINK_THIS_TIMERANGE);
+ entityRow.ApplicationLink = String.Format(DEEPLINK_APPLICATION, entityRow.Controller, entityRow.ApplicationID, DEEPLINK_THIS_TIMERANGE);
+ }
+ else if (entityRow is EntityTier)
+ {
+ entityRow.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entityRow.Controller, DEEPLINK_THIS_TIMERANGE);
+ entityRow.ApplicationLink = String.Format(DEEPLINK_APPLICATION, entityRow.Controller, entityRow.ApplicationID, DEEPLINK_THIS_TIMERANGE);
+ entityRow.TierLink = String.Format(DEEPLINK_TIER, entityRow.Controller, entityRow.ApplicationID, entityRow.TierID, DEEPLINK_THIS_TIMERANGE);
+ deepLinkMetricTemplateInMetricBrowser = DEEPLINK_METRIC_TIER_TARGET_METRIC_ID;
+ entityIdForMetricBrowser = entityRow.TierID;
+ }
+ else if (entityRow is EntityNode)
+ {
+ entityRow.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entityRow.Controller, DEEPLINK_THIS_TIMERANGE);
+ entityRow.ApplicationLink = String.Format(DEEPLINK_APPLICATION, entityRow.Controller, entityRow.ApplicationID, DEEPLINK_THIS_TIMERANGE);
+ entityRow.TierLink = String.Format(DEEPLINK_TIER, entityRow.Controller, entityRow.ApplicationID, entityRow.TierID, DEEPLINK_THIS_TIMERANGE);
+ entityRow.NodeLink = String.Format(DEEPLINK_NODE, entityRow.Controller, entityRow.ApplicationID, entityRow.NodeID, DEEPLINK_THIS_TIMERANGE);
+ deepLinkMetricTemplateInMetricBrowser = DEEPLINK_METRIC_NODE_TARGET_METRIC_ID;
+ entityIdForMetricBrowser = entityRow.NodeID;
+ }
+ else if (entityRow is EntityBackend)
+ {
+ entityRow.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entityRow.Controller, DEEPLINK_THIS_TIMERANGE);
+ entityRow.ApplicationLink = String.Format(DEEPLINK_APPLICATION, entityRow.Controller, entityRow.ApplicationID, DEEPLINK_THIS_TIMERANGE);
+ ((EntityBackend)entityRow).BackendLink = String.Format(DEEPLINK_BACKEND, entityRow.Controller, entityRow.ApplicationID, ((EntityBackend)entityRow).BackendID, DEEPLINK_THIS_TIMERANGE);
+ }
+ else if (entityRow is EntityBusinessTransaction)
+ {
+ entityRow.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entityRow.Controller, DEEPLINK_THIS_TIMERANGE);
+ entityRow.ApplicationLink = String.Format(DEEPLINK_APPLICATION, entityRow.Controller, entityRow.ApplicationID, DEEPLINK_THIS_TIMERANGE);
+ entityRow.TierLink = String.Format(DEEPLINK_TIER, entityRow.Controller, entityRow.ApplicationID, entityRow.TierID, DEEPLINK_THIS_TIMERANGE);
+ ((EntityBusinessTransaction)entityRow).BTLink = String.Format(DEEPLINK_BUSINESS_TRANSACTION, entityRow.Controller, entityRow.ApplicationID, ((EntityBusinessTransaction)entityRow).BTID, DEEPLINK_THIS_TIMERANGE);
+ deepLinkMetricTemplateInMetricBrowser = DEEPLINK_METRIC_TIER_TARGET_METRIC_ID;
+ entityIdForMetricBrowser = entityRow.TierID;
+ }
+ else if (entityRow is EntityServiceEndpoint)
+ {
+ entityRow.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entityRow.Controller, DEEPLINK_THIS_TIMERANGE);
+ entityRow.ApplicationLink = String.Format(DEEPLINK_APPLICATION, entityRow.Controller, entityRow.ApplicationID, DEEPLINK_THIS_TIMERANGE);
+ entityRow.TierLink = String.Format(DEEPLINK_TIER, entityRow.Controller, entityRow.ApplicationID, entityRow.TierID, DEEPLINK_THIS_TIMERANGE);
+ ((EntityServiceEndpoint)entityRow).SEPLink = String.Format(DEEPLINK_SERVICE_ENDPOINT, entityRow.Controller, entityRow.ApplicationID, entityRow.TierID, ((EntityServiceEndpoint)entityRow).SEPID, DEEPLINK_THIS_TIMERANGE);
+ }
+ else if (entityRow is EntityError)
+ {
+ entityRow.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entityRow.Controller, DEEPLINK_THIS_TIMERANGE);
+ entityRow.ApplicationLink = String.Format(DEEPLINK_APPLICATION, entityRow.Controller, entityRow.ApplicationID, DEEPLINK_THIS_TIMERANGE);
+ entityRow.TierLink = String.Format(DEEPLINK_TIER, entityRow.Controller, entityRow.ApplicationID, entityRow.TierID, DEEPLINK_THIS_TIMERANGE);
+ ((EntityError)entityRow).ErrorLink = String.Format(DEEPLINK_ERROR, entityRow.Controller, entityRow.ApplicationID, ((EntityError)entityRow).ErrorID, DEEPLINK_THIS_TIMERANGE);
+ }
+ else if (entityRow is EntityInformationPoint)
+ {
+ entityRow.ControllerLink = String.Format(DEEPLINK_CONTROLLER, entityRow.Controller, DEEPLINK_THIS_TIMERANGE);
+ entityRow.ApplicationLink = String.Format(DEEPLINK_APPLICATION, entityRow.Controller, entityRow.ApplicationID, DEEPLINK_THIS_TIMERANGE);
+ ((EntityInformationPoint)entityRow).IPLink = String.Format(DEEPLINK_INFORMATION_POINT, entityRow.Controller, entityRow.ApplicationID, ((EntityInformationPoint)entityRow).IPID, DEEPLINK_THIS_TIMERANGE);
}
- }
-
- private static BusinessTransactionDiscoveryRule fillBusinessTransactionDiscoveryRule(XmlNode entryMatchPointConfigurationNode, XmlNode entryMatchPointTransactionConfigurationNode, EntityApplicationConfiguration applicationConfiguration, XmlNode applicationComponentNode)
- {
- BusinessTransactionDiscoveryRule businessTransactionDiscoveryRule = new BusinessTransactionDiscoveryRule();
-
- businessTransactionDiscoveryRule.Controller = applicationConfiguration.Controller;
- businessTransactionDiscoveryRule.ControllerLink = applicationConfiguration.ControllerLink;
- businessTransactionDiscoveryRule.ApplicationName = applicationConfiguration.ApplicationName;
- businessTransactionDiscoveryRule.ApplicationID = applicationConfiguration.ApplicationID;
- businessTransactionDiscoveryRule.ApplicationLink = applicationConfiguration.ApplicationLink;
-
- businessTransactionDiscoveryRule.AgentType = entryMatchPointConfigurationNode.SelectSingleNode("agent-type").InnerText;
- businessTransactionDiscoveryRule.EntryPointType = entryMatchPointTransactionConfigurationNode.Attributes["transaction-entry-point-type"].Value;
- businessTransactionDiscoveryRule.IsMonitoringEnabled = getBoolValueFromXmlNode(entryMatchPointTransactionConfigurationNode.SelectSingleNode("enable"));
- businessTransactionDiscoveryRule.DiscoveryType = entryMatchPointTransactionConfigurationNode.SelectSingleNode("discovery-config").Attributes["discovery-resolution"].Value;
- businessTransactionDiscoveryRule.IsDiscoveryEnabled = getBoolValueFromXmlNode(entryMatchPointTransactionConfigurationNode.SelectSingleNode("discovery-config/discovery-config-enabled"));
- businessTransactionDiscoveryRule.NamingConfigType = entryMatchPointTransactionConfigurationNode.SelectSingleNode("discovery-config/naming-config").Attributes["scheme"].Value;
-
- businessTransactionDiscoveryRule.RuleRawValue = makeXMLFormattedAndIndented(entryMatchPointTransactionConfigurationNode);
- if (applicationComponentNode != null)
+ if (entityRow.MetricsIDs != null && entityRow.MetricsIDs.Count > 0)
{
- businessTransactionDiscoveryRule.TierName = applicationComponentNode.SelectSingleNode("name").InnerText;
+ StringBuilder sb = new StringBuilder(128);
+ foreach (int metricID in entityRow.MetricsIDs)
+ {
+ sb.Append(String.Format(deepLinkMetricTemplateInMetricBrowser, entityIdForMetricBrowser, metricID));
+ sb.Append(",");
+ }
+ sb.Remove(sb.Length - 1, 1);
+ entityRow.MetricLink = String.Format(DEEPLINK_METRIC, entityRow.Controller, entityRow.ApplicationID, sb.ToString(), DEEPLINK_THIS_TIMERANGE);
}
- return businessTransactionDiscoveryRule;
+ return true;
}
- private static BusinessTransactionEntryRule fillBusinessTransactionExcludeRule(XmlNode entryMatchPointConfigurationNode, XmlNode entryMatchPointTransactionConfigurationNode, XmlNode entryMatchPointCustomMatchPointConfigurationNode, EntityApplicationConfiguration applicationConfiguration, XmlNode applicationComponentNode)
+ private static void updateEntitiesWithReportDetailLinksApplication(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobTarget jobTarget, List entityList)
{
- BusinessTransactionEntryRule businessTransactionEntryRule = new BusinessTransactionEntryRule();
-
- businessTransactionEntryRule.Controller = applicationConfiguration.Controller;
- businessTransactionEntryRule.ControllerLink = applicationConfiguration.ControllerLink;
- businessTransactionEntryRule.ApplicationName = applicationConfiguration.ApplicationName;
- businessTransactionEntryRule.ApplicationID = applicationConfiguration.ApplicationID;
- businessTransactionEntryRule.ApplicationLink = applicationConfiguration.ApplicationLink;
-
- businessTransactionEntryRule.AgentType = getStringValueFromXmlNode(entryMatchPointConfigurationNode.SelectSingleNode("agent-type"));
- businessTransactionEntryRule.EntryPointType = entryMatchPointTransactionConfigurationNode.Attributes["transaction-entry-point-type"].Value;
- businessTransactionEntryRule.RuleName = entryMatchPointCustomMatchPointConfigurationNode.Attributes["name"].Value;
- businessTransactionEntryRule.IsExclusion = true;
+ string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
+ string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
+ string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
+ string reportsFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
- XmlNode matchRule = entryMatchPointCustomMatchPointConfigurationNode.ChildNodes[0];
- fillMatchRuleDetails(businessTransactionEntryRule, matchRule);
+ for (int i = 0; i < entityList.Count; i++)
+ {
+ EntityBase entityRow = entityList[i];
+ entityRow.DetailLink = String.Format(@"=HYPERLINK(""{0}"", """")", getEntityMetricReportFilePath(programOptions, jobConfiguration, jobTarget, entityRow).Substring(reportsFolderPath.Length + 1));
+ }
+ }
- businessTransactionEntryRule.RuleRawValue = makeXMLFormattedAndIndented(entryMatchPointCustomMatchPointConfigurationNode);
+ private static void updateEntitiesWithReportDetailLinksTiers(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobTarget jobTarget, List entityList)
+ {
+ string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
+ string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
+ string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
+ string reportsFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
- if (applicationComponentNode != null)
+ for (int i = 0; i < entityList.Count; i++)
{
- businessTransactionEntryRule.TierName = applicationComponentNode.SelectSingleNode("name").InnerText;
+ EntityBase entityRow = entityList[i];
+ entityRow.DetailLink = String.Format(@"=HYPERLINK(""{0}"", """")", getEntityMetricReportFilePath(programOptions, jobConfiguration, jobTarget, entityRow).Substring(reportsFolderPath.Length + 1));
}
-
- return businessTransactionEntryRule;
}
- private static BusinessTransactionEntryRule fillBusinessTransactionEntryRule(XmlNode entryMatchPointConfigurationNode, XmlNode entryMatchPointCustomMatchPointConfigurationNode, EntityApplicationConfiguration applicationConfiguration, XmlNode applicationComponentNode, List businessTransactionsList)
+ private static void updateEntitiesWithReportDetailLinksNodes(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobTarget jobTarget, List entityList)
{
- BusinessTransactionEntryRule businessTransactionEntryRule = new BusinessTransactionEntryRule();
+ string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
+ string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
+ string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
+ string reportsFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
- businessTransactionEntryRule.Controller = applicationConfiguration.Controller;
- businessTransactionEntryRule.ControllerLink = applicationConfiguration.ControllerLink;
- businessTransactionEntryRule.ApplicationName = applicationConfiguration.ApplicationName;
- businessTransactionEntryRule.ApplicationID = applicationConfiguration.ApplicationID;
- businessTransactionEntryRule.ApplicationLink = applicationConfiguration.ApplicationLink;
+ for (int i = 0; i < entityList.Count; i++)
+ {
+ EntityBase entityRow = entityList[i];
+ entityRow.DetailLink = String.Format(@"=HYPERLINK(""{0}"", """")", getEntityMetricReportFilePath(programOptions, jobConfiguration, jobTarget, entityRow).Substring(reportsFolderPath.Length + 1));
+ }
+ }
- businessTransactionEntryRule.AgentType = getStringValueFromXmlNode(entryMatchPointConfigurationNode.SelectSingleNode("agent-type"));
- businessTransactionEntryRule.EntryPointType = entryMatchPointCustomMatchPointConfigurationNode.Attributes["transaction-entry-point-type"].Value;
- businessTransactionEntryRule.RuleName = getStringValueFromXmlNode(entryMatchPointCustomMatchPointConfigurationNode.SelectSingleNode("name"));
- businessTransactionEntryRule.IsBackground = getBoolValueFromXmlNode(entryMatchPointCustomMatchPointConfigurationNode.SelectSingleNode("background"));
- businessTransactionEntryRule.IsExclusion = false;
+ private static void updateEntitiesWithReportDetailLinksBackends(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobTarget jobTarget, List entityList)
+ {
+ string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
+ string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
+ string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
+ string reportsFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
- XmlNode matchRule = entryMatchPointCustomMatchPointConfigurationNode.SelectSingleNode("match-rule").ChildNodes[0];
- fillMatchRuleDetails(businessTransactionEntryRule, matchRule);
+ for (int i = 0; i < entityList.Count; i++)
+ {
+ EntityBase entityRow = entityList[i];
+ entityRow.DetailLink = String.Format(@"=HYPERLINK(""{0}"", """")", getEntityMetricReportFilePath(programOptions, jobConfiguration, jobTarget, entityRow).Substring(reportsFolderPath.Length + 1));
+ }
+ }
- businessTransactionEntryRule.RuleRawValue = makeXMLFormattedAndIndented(entryMatchPointCustomMatchPointConfigurationNode);
+ private static void updateEntitiesWithReportDetailLinksBusinessTransactions(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobTarget jobTarget, List entityList)
+ {
+ string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
+ string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
+ string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
+ string reportsFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
- if (applicationComponentNode != null)
+ for (int i = 0; i < entityList.Count; i++)
{
- businessTransactionEntryRule.TierName = getStringValueFromXmlNode(applicationComponentNode.SelectSingleNode("name"));
+ EntityBase entityRow = entityList[i];
+ entityRow.DetailLink = String.Format(@"=HYPERLINK(""{0}"", """")", getEntityMetricReportFilePath(programOptions, jobConfiguration, jobTarget, entityRow).Substring(reportsFolderPath.Length + 1));
}
+ }
- if (businessTransactionsList != null)
- {
- List businessTransactionsForThisRule = new List();
- businessTransactionsForThisRule.AddRange(businessTransactionsList.Where(b => b.BTName == businessTransactionEntryRule.RuleName).ToList());
- businessTransactionsForThisRule.AddRange(businessTransactionsList.Where(b => b.BTName.StartsWith(String.Format("{0}.", businessTransactionEntryRule.RuleName))).ToList());
- businessTransactionsForThisRule.AddRange(businessTransactionsList.Where(b => b.BTNameOriginal == businessTransactionEntryRule.RuleName).ToList());
- businessTransactionsForThisRule.AddRange(businessTransactionsList.Where(b => b.BTNameOriginal.StartsWith(String.Format("{0}.", businessTransactionEntryRule.RuleName))).ToList());
- businessTransactionsForThisRule = businessTransactionsForThisRule.Distinct().ToList();
- businessTransactionEntryRule.NumDetectedBTs = businessTransactionsForThisRule.Count;
- if (businessTransactionsForThisRule.Count > 0)
- {
- StringBuilder sb = new StringBuilder(32 * businessTransactionsForThisRule.Count);
- foreach (EntityBusinessTransaction bt in businessTransactionsForThisRule)
- {
- sb.AppendFormat("{0}/{1};\n", bt.TierName, bt.BTName);
- }
- sb.Remove(sb.Length - 1, 1);
+ private static void updateEntitiesWithReportDetailLinksServiceEndpoints(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobTarget jobTarget, List entityList)
+ {
+ string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
+ string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
+ string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
+ string reportsFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
- businessTransactionEntryRule.DetectedBTs = sb.ToString();
- }
+ for (int i = 0; i < entityList.Count; i++)
+ {
+ EntityBase entityRow = entityList[i];
+ entityRow.DetailLink = String.Format(@"=HYPERLINK(""{0}"", """")", getEntityMetricReportFilePath(programOptions, jobConfiguration, jobTarget, entityRow).Substring(reportsFolderPath.Length + 1));
}
-
- return businessTransactionEntryRule;
}
- private static BusinessTransactionEntryScope fillBusinessTransactionEntryScope(XmlNode scopeConfigurationNode, XmlNode scopeToRuleMappingConfigurationNode, EntityApplicationConfiguration applicationConfiguration)
+ private static void updateEntitiesWithReportDetailLinksErrors(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobTarget jobTarget, List entityList)
{
- BusinessTransactionEntryScope businessTransactionEntryScope = new BusinessTransactionEntryScope();
+ string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
+ string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
+ string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
+ string reportsFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
- businessTransactionEntryScope.Controller = applicationConfiguration.Controller;
- businessTransactionEntryScope.ControllerLink = applicationConfiguration.ControllerLink;
- businessTransactionEntryScope.ApplicationName = applicationConfiguration.ApplicationName;
- businessTransactionEntryScope.ApplicationID = applicationConfiguration.ApplicationID;
- businessTransactionEntryScope.ApplicationLink = applicationConfiguration.ApplicationLink;
+ for (int i = 0; i < entityList.Count; i++)
+ {
+ EntityBase entityRow = entityList[i];
+ entityRow.DetailLink = String.Format(@"=HYPERLINK(""{0}"", """")", getEntityMetricReportFilePath(programOptions, jobConfiguration, jobTarget, entityRow).Substring(reportsFolderPath.Length + 1));
+ }
+ }
- businessTransactionEntryScope.ScopeName = scopeConfigurationNode.Attributes["scope-name"].Value;
- businessTransactionEntryScope.ScopeType = scopeConfigurationNode.Attributes["scope-type"].Value;
- businessTransactionEntryScope.Description = scopeConfigurationNode.Attributes["scope-description"].Value;
- businessTransactionEntryScope.Version = Convert.ToInt32(scopeConfigurationNode.Attributes["scope-version"].Value);
+ private static void updateEntitiesWithReportDetailLinksInformationPoints(ProgramOptions programOptions, JobConfiguration jobConfiguration, JobTarget jobTarget, List entityList)
+ {
+ string controllerFolderPath = Path.Combine(programOptions.OutputJobFolderPath, getFileSystemSafeString(new Uri(jobTarget.Controller).Host));
+ string applicationFolderPath = Path.Combine(controllerFolderPath, getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID));
+ string entitiesFolderPath = Path.Combine(applicationFolderPath, ENTITIES_FOLDER_NAME);
+ string reportsFolderPath = Path.Combine(programOptions.OutputJobFolderPath, REPORTS_FOLDER_NAME);
- XmlNodeList includedTierNodeList = scopeConfigurationNode.SelectNodes("included-tiers/tier-name");
- businessTransactionEntryScope.NumTiers = includedTierNodeList.Count;
- if (businessTransactionEntryScope.NumTiers > 0)
+ for (int i = 0; i < entityList.Count; i++)
{
- List includedTiersList = new List(businessTransactionEntryScope.NumTiers);
- foreach (XmlNode includedTierNode in includedTierNodeList)
- {
- includedTiersList.Add(includedTierNode.InnerText);
- }
- includedTiersList.Sort();
-
- StringBuilder sb = new StringBuilder(32 * businessTransactionEntryScope.NumTiers);
- foreach (string includedTier in includedTiersList)
- {
- sb.AppendFormat("{0};\n", includedTier);
- }
- sb.Remove(sb.Length - 1, 1);
- businessTransactionEntryScope.IncludedTiers = sb.ToString();
+ EntityBase entityRow = entityList[i];
+ entityRow.DetailLink = String.Format(@"=HYPERLINK(""{0}"", """")", getEntityMetricReportFilePath(programOptions, jobConfiguration, jobTarget, entityRow).Substring(reportsFolderPath.Length + 1));
}
+ }
- XmlNodeList ruleMappingNodeList = scopeToRuleMappingConfigurationNode.SelectNodes(String.Format("scope-rule-mapping[@scope-name='{0}']/rule", businessTransactionEntryScope.ScopeName));
- businessTransactionEntryScope.NumRules = ruleMappingNodeList.Count;
- if (businessTransactionEntryScope.NumRules > 0)
+ private static List convertMetricValueToTypedListForCSV(AppDRESTMetric metricValueObject)
+ {
+ List metricValues = new List(metricValueObject.metricValues.Count);
+ foreach (AppDRESTMetricValue mv in metricValueObject.metricValues)
{
- List ruleMappingList = new List(businessTransactionEntryScope.NumRules);
- foreach (XmlNode ruleMappingNode in ruleMappingNodeList)
- {
- string ruleName = ruleMappingNode.Attributes["rule-name"].Value;
- string ruleDescription = ruleMappingNode.Attributes["rule-description"].Value;
- string ruleNameAndDescription = String.Empty;
- if (ruleDescription.Length > 0 && ruleDescription != ruleName)
- {
- ruleMappingList.Add(String.Format("{0} ({1})", ruleName, ruleDescription));
- }
- else
- {
- ruleMappingList.Add(ruleName);
- }
- }
- ruleMappingList.Sort();
+ MetricValue metricValue = new MetricValue();
+ metricValue.EventTimeStampUtc = convertFromUnixTimestamp(mv.startTimeInMillis);
+ metricValue.EventTimeStamp = metricValue.EventTimeStampUtc.ToLocalTime();
+ metricValue.EventTime = metricValue.EventTimeStamp;
+ metricValue.Count = mv.count;
+ metricValue.Min = mv.min;
+ metricValue.Max = mv.max;
+ metricValue.Occurrences = mv.occurrences;
+ metricValue.Sum = mv.sum;
+ metricValue.Value = mv.value;
- StringBuilder sb = new StringBuilder(32 * businessTransactionEntryScope.NumRules);
- foreach (string ruleMapping in ruleMappingList)
+ metricValue.MetricID = metricValueObject.metricId;
+ switch (metricValueObject.frequency)
{
- sb.AppendFormat("{0};\n", ruleMapping);
+ case "SIXTY_MIN":
+ {
+ metricValue.MetricResolution = MetricResolution.SIXTY_MIN;
+ break;
+ }
+ case "TEN_MIN":
+ {
+ metricValue.MetricResolution = MetricResolution.TEN_MIN;
+ break;
+ }
+ case "ONE_MIN":
+ {
+ metricValue.MetricResolution = MetricResolution.ONE_MIN;
+ break;
+ }
+ default:
+ {
+ metricValue.MetricResolution = MetricResolution.ONE_MIN;
+ break;
+ }
}
- sb.Remove(sb.Length - 1, 1);
- businessTransactionEntryScope.IncludedRules = sb.ToString();
+ metricValues.Add(metricValue);
}
- return businessTransactionEntryScope;
+ return metricValues;
}
- private static BusinessTransactionEntryRule20 fillBusinessTransactionEntryRule20(XmlNode ruleConfigurationNode, XmlNode scopeToRuleMappingConfigurationNode, EntityApplicationConfiguration applicationConfiguration, List businessTransactionsList)
+ private static List convertMetricSummaryToTypedListForCSV(AppDRESTMetric metricValueObject, EntityBase entityRow, JobTimeRange jobTimeRange)
{
- BusinessTransactionEntryRule20 businessTransactionEntryRule = new BusinessTransactionEntryRule20();
-
- businessTransactionEntryRule.Controller = applicationConfiguration.Controller;
- businessTransactionEntryRule.ControllerLink = applicationConfiguration.ControllerLink;
- businessTransactionEntryRule.ApplicationName = applicationConfiguration.ApplicationName;
- businessTransactionEntryRule.ApplicationID = applicationConfiguration.ApplicationID;
- businessTransactionEntryRule.ApplicationLink = applicationConfiguration.ApplicationLink;
-
- businessTransactionEntryRule.AgentType = ruleConfigurationNode.Attributes["agent-type"].Value;
- businessTransactionEntryRule.RuleName = ruleConfigurationNode.Attributes["rule-name"].Value;
- businessTransactionEntryRule.Description = ruleConfigurationNode.Attributes["rule-description"].Value;
- businessTransactionEntryRule.Version = Convert.ToInt32(ruleConfigurationNode.Attributes["version"].Value);
-
- businessTransactionEntryRule.IsEnabled = Convert.ToBoolean(ruleConfigurationNode.Attributes["enabled"].Value);
- businessTransactionEntryRule.Priority = Convert.ToInt32(ruleConfigurationNode.Attributes["priority"].Value);
+ List metricSummaries = new List();
+ metricSummaries.Add(new MetricSummary() {
+ PropertyName = "Controller",
+ PropertyValue = entityRow.Controller,
+ Link = entityRow.ControllerLink });
+ metricSummaries.Add(new MetricSummary() {
+ PropertyName = "Application",
+ PropertyValue = entityRow.ApplicationName,
+ Link = entityRow.ApplicationLink });
- JObject txRuleSettings = JObject.Parse(getStringValueFromXmlNode(ruleConfigurationNode.SelectSingleNode("tx-match-rule")));
- if (txRuleSettings != null)
+ string deepLinkMetricTemplateInMetricBrowser = DEEPLINK_METRIC_APPLICATION_TARGET_METRIC_ID;
+ long entityIdForMetricBrowser = entityRow.ApplicationID;
+ if (entityRow is EntityApplication)
{
- if (txRuleSettings["type"].ToString() != "CUSTOM")
+ metricSummaries.Add(new MetricSummary() { PropertyName = "EntityType", PropertyValue = "Application" });
+ metricSummaries.Add(new MetricSummary() { PropertyName = "ApplicationID", PropertyValue = entityRow.ApplicationID });
+ }
+ else if (entityRow is EntityTier)
+ {
+ metricSummaries.Add(new MetricSummary() { PropertyName = "EntityType", PropertyValue = "Tier" });
+ metricSummaries.Add(new MetricSummary() {
+ PropertyName = "Tier",
+ PropertyValue = entityRow.TierName,
+ Link = entityRow.TierLink });
+ metricSummaries.Add(new MetricSummary() { PropertyName = "ApplicationID", PropertyValue = entityRow.ApplicationID });
+ metricSummaries.Add(new MetricSummary() { PropertyName = "TierID", PropertyValue = entityRow.TierID });
+ deepLinkMetricTemplateInMetricBrowser = DEEPLINK_METRIC_TIER_TARGET_METRIC_ID;
+ entityIdForMetricBrowser = entityRow.TierID;
+ }
+ else if (entityRow is EntityNode)
+ {
+ metricSummaries.Add(new MetricSummary() { PropertyName = "EntityType", PropertyValue = "Node" });
+ metricSummaries.Add(new MetricSummary()
{
- // This is likely autodiscovery rule, do not fill it out and bail
- return null;
- }
-
- JToken txCustomRuleSettings = txRuleSettings["txcustomrule"];
- if (txCustomRuleSettings != null)
+ PropertyName = "Tier",
+ PropertyValue = entityRow.TierName,
+ Link = entityRow.TierLink
+ });
+ metricSummaries.Add(new MetricSummary()
{
- if (txCustomRuleSettings["type"].ToString() == "EXCLUDE")
- {
- businessTransactionEntryRule.IsExclusion = true;
- }
- else if (txCustomRuleSettings["type"].ToString() == "INCLUDE")
- {
- businessTransactionEntryRule.IsExclusion = false;
- }
-
- businessTransactionEntryRule.EntryPointType = txCustomRuleSettings["txentrypointtype"].ToString();
-
- JToken isBackgroundProperty = txCustomRuleSettings["properties"].Where(p => p["name"].ToString() == "BACKGROUND_TASK").FirstOrDefault();
- if (isBackgroundProperty != null)
- {
- businessTransactionEntryRule.IsBackground = (bool)isBackgroundProperty["booleanvalue"];
- }
-
- businessTransactionEntryRule.MatchConditions = txCustomRuleSettings["matchconditions"].ToString();
- businessTransactionEntryRule.Actions = txCustomRuleSettings["actions"].ToString();
- businessTransactionEntryRule.Properties = txCustomRuleSettings["properties"].ToString();
- }
+ PropertyName = "Node",
+ PropertyValue = entityRow.NodeName,
+ Link = entityRow.NodeLink
+ });
+ metricSummaries.Add(new MetricSummary() { PropertyName = "ApplicationID", PropertyValue = entityRow.ApplicationID });
+ metricSummaries.Add(new MetricSummary() { PropertyName = "TierID", PropertyValue = entityRow.TierID });
+ metricSummaries.Add(new MetricSummary() { PropertyName = "NodeID", PropertyValue = entityRow.NodeID });
+ deepLinkMetricTemplateInMetricBrowser = DEEPLINK_METRIC_NODE_TARGET_METRIC_ID;
+ entityIdForMetricBrowser = entityRow.NodeID;
}
-
- // I really want to do it, but some of our rules have apostrophes
- // Spring WS - Base servlet for Spring's web framework
- // And the query for scope-rule-mapping/rule[@rule-name='Spring WS - Base servlet for Spring's web framework'] breaks
- // So going to do it the hard way
- //XmlNode scopeForThisRuleNode = scopeToRuleMappingConfigurationNode.SelectSingleNode(String.Format("scope-rule-mapping/rule[@rule-name='{0}']", businessTransactionEntryRule.RuleName));
- foreach (XmlNode scopeNode in scopeToRuleMappingConfigurationNode.SelectNodes("scope-rule-mapping/rule"))
+ else if (entityRow is EntityBackend)
{
- if (scopeNode.Attributes["rule-name"].Value == businessTransactionEntryRule.RuleName)
+ metricSummaries.Add(new MetricSummary() { PropertyName = "EntityType", PropertyValue = "Backend" });
+ metricSummaries.Add(new MetricSummary()
{
- businessTransactionEntryRule.ScopeName = scopeNode.ParentNode.Attributes["scope-name"].Value;
- break;
- }
+ PropertyName = "Tier",
+ PropertyValue = entityRow.TierName,
+ Link = entityRow.TierLink
+ });
+ metricSummaries.Add(new MetricSummary()
+ {
+ PropertyName = "Backend",
+ PropertyValue = ((EntityBackend)entityRow).BackendName,
+ Link = ((EntityBackend)entityRow).BackendLink
+ });
+ metricSummaries.Add(new MetricSummary() { PropertyName = "ApplicationID", PropertyValue = entityRow.ApplicationID });
+ metricSummaries.Add(new MetricSummary() { PropertyName = "TierID", PropertyValue = entityRow.TierID });
+ metricSummaries.Add(new MetricSummary() { PropertyName = "BackendID", PropertyValue = ((EntityBackend)entityRow).BackendID });
}
-
- if (businessTransactionsList != null)
+ else if (entityRow is EntityBusinessTransaction)
{
- List businessTransactionsForThisRule = new List