Skip to content

Commit

Permalink
Snapshots report:
Browse files Browse the repository at this point in the history
- Perf improvements for the flame graph folding for very large datasets

Entity Metrics report:
- Added better support for cross-application flowmaps
  • Loading branch information
danielodievich committed May 17, 2019
1 parent 02aedcb commit 4df81fd
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 68 deletions.
3 changes: 3 additions & 0 deletions AppDynamics.Dexter.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppDynamics.Dexter.Core", "AppDynamics.Dexter.Core.csproj", "{F2687CC0-8C55-4B74-AE08-7A1D6DDE18E1}"
EndProject
Global
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Expand Down
2 changes: 1 addition & 1 deletion DataObjects/JobConfiguration/JobStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public enum JobStatus
IndexWEBConfiguration = 73,
IndexMOBILEConfiguration = 74,
IndexBIQConfiguration = 75,

IndexApplicationConfigurationDifferences = 76,

IndexAPMMetrics = 80,
Expand Down
3 changes: 2 additions & 1 deletion Helpers/FileIOHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,8 @@ public static bool AppendTwoCSVFiles(FileStream csvToAppendToSW, string csvToApp

private static void copyStream(Stream input, Stream output)
{
byte[] buffer = new byte[1024 * 128];
// 1048576 = 1024*1024 = 2^20 = 1MB
byte[] buffer = new byte[1048576];
int bytesRead;
while ((bytesRead = input.Read(buffer, 0, buffer.Length)) > 0)
{
Expand Down
16 changes: 1 addition & 15 deletions ProcessingSteps/FilePathMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -401,20 +401,6 @@ public class FilePathMap
private const string CONVERT_SNAPSHOTS_SEGMENTS_FOLDED_CALL_STACKS_TIMERANGE_FILE_NAME = "snapshots.foldedcallstacks.{0:yyyyMMddHHmm}-{1:yyyyMMddHHmm}.csv";
private const string CONVERT_SNAPSHOTS_SEGMENTS_FOLDED_CALL_STACKS_WITH_TIME_TIMERANGE_FILE_NAME = "snapshots.foldedcallstackswithtime.{0:yyyyMMddHHmm}-{1:yyyyMMddHHmm}.csv";

// Snapshot files
private const string CONVERT_SNAPSHOT_FILE_NAME = "snapshot.csv";
private const string CONVERT_SNAPSHOT_SEGMENTS_FILE_NAME = "snapshot.segments.csv";
private const string CONVERT_SNAPSHOT_SEGMENTS_EXIT_CALLS_FILE_NAME = "snapshot.exits.csv";
private const string CONVERT_SNAPSHOT_SEGMENTS_SERVICE_ENDPOINTS_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";

// Folded call stacks for snapshot
private const string CONVERT_SNAPSHOT_SEGMENTS_FOLDED_CALL_STACKS_FILE_NAME = "snapshot.foldedcallstacks.csv";
private const string CONVERT_SNAPSHOT_SEGMENTS_FOLDED_CALL_STACKS_WITH_TIME_FILE_NAME = "snapshot.foldedcallstacks.withtime.csv";

// Flow map to flow grid conversion file names
private const string CONVERT_ACTIVITY_GRIDS_FILE_NAME = "activitygrids.full.csv";
private const string CONVERT_ALL_ACTIVITY_GRIDS_FILE_NAME = "{0}.activitygrids.full.csv";
Expand Down Expand Up @@ -5632,7 +5618,7 @@ public string SnapshotsSegmentsIndexFilePath(JobTarget jobTarget)
getFileSystemSafeString(getControllerNameForFileSystem(jobTarget.Controller)),
getShortenedEntityNameForFileSystem(jobTarget.Application, jobTarget.ApplicationID),
APM_SNAPSHOTS_FOLDER_NAME,
CONVERT_SNAPSHOT_SEGMENTS_FILE_NAME);
CONVERT_SNAPSHOTS_SEGMENTS_FILE_NAME);
}

public string SnapshotsExitCallsIndexFilePath(JobTarget jobTarget)
Expand Down
178 changes: 142 additions & 36 deletions ProcessingSteps/Index/IndexAPMFlowmaps.cs

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions ProcessingSteps/Index/IndexAPMSnapshots.cs
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,11 @@ public override bool Execute(ProgramOptions programOptions, JobConfiguration job

loggerConsole.Info("Fold Stacks for Nodes and Business Transactions");

int j = 1;
foreach (JobTimeRange jobTimeRange in jobConfiguration.Input.HourlyTimeRanges)
{
Console.WriteLine("Processing range {0}/{1} for hour starting {2:o}", j, jobConfiguration.Input.HourlyTimeRanges.Count, jobTimeRange.From);

// Go through BTs
foreach (APMBusinessTransaction businessTransaction in businessTransactionsList)
{
Expand Down Expand Up @@ -584,6 +587,8 @@ public override bool Execute(ProgramOptions programOptions, JobConfiguration job
}
}
}

j++;
}

#endregion
Expand Down Expand Up @@ -2736,10 +2741,10 @@ private MethodCallLine convertCallGraphChildren_Recursion(
exitCallForThisExit.ToEntityName = getStringValueFromJToken(goingToProperty, "value");
}
goingToProperty = exitCallToken["properties"].Where(p => getStringValueFromJToken(p, "name") == "from").FirstOrDefault();
string callChainForThisSegment = "(Generated From Call Graph:Unknown)";
string callChainForThisSegment = "(CallGraph:Unknown)";
if (goingToProperty != null)
{
callChainForThisSegment = String.Format("(Generated From Call Graph:{0})", getStringValueFromJToken(goingToProperty, "value"));
callChainForThisSegment = String.Format("(CallGraph:{0})", getStringValueFromJToken(goingToProperty, "value"));
}
if (exitCallForThisExit.IsAsync == false)
{
Expand Down Expand Up @@ -3105,10 +3110,10 @@ private List<MethodCallLine> convertCallGraphChildren_Stack(
exitCallForThisExit.ToEntityName = getStringValueFromJToken(goingToProperty, "value");
}
goingToProperty = exitCallToken["properties"].Where(p => getStringValueFromJToken(p, "name") == "from").FirstOrDefault();
string callChainForThisSegment = "(Generated From Call Graph:Unknown)";
string callChainForThisSegment = "(CallGraph:Unknown)";
if (goingToProperty != null)
{
callChainForThisSegment = String.Format("(Generated From Call Graph:{0})", getStringValueFromJToken(goingToProperty, "value"));
callChainForThisSegment = String.Format("(CallGraph:{0})", getStringValueFromJToken(goingToProperty, "value"));
}
if (exitCallForThisExit.IsAsync == false)
{
Expand Down
1 change: 1 addition & 0 deletions ProcessingSteps/Index/JobStepIndexBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public class JobStepIndexBase : JobStepBase
#region Constants for various strings mapping to Entity types in Flowmaps and Events

internal const string ENTITY_TYPE_FLOWMAP_APPLICATION = "APPLICATION";
internal const string ENTITY_TYPE_FLOWMAP_FEDERATED_APPLICATION = "FEDERATED_APPLICATION";
internal const string ENTITY_TYPE_FLOWMAP_APPLICATION_MOBILE = "MOBILE_APPLICATION";
internal const string ENTITY_TYPE_FLOWMAP_TIER = "APPLICATION_COMPONENT";
internal const string ENTITY_TYPE_FLOWMAP_NODE = "APPLICATION_COMPONENT_NODE";
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.39.0")]
[assembly: AssemblyFileVersion("1.2.39.0")]
[assembly: AssemblyVersion("1.2.40.0")]
[assembly: AssemblyFileVersion("1.2.40.0")]
22 changes: 13 additions & 9 deletions ReportObjects/FlameGraph/FoldedStackLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,20 @@ public void AddFoldedStackLine(FoldedStackLine foldedStackLineToAdd)
{
// Append two exit calls by decoding them, squishing them together, and then reencoding them
string exitsInThisFoldedStack = Encoding.UTF8.GetString(Convert.FromBase64String(this.ExitCallsArray[i]));
string exitsInIncomingFoldedStack = Encoding.UTF8.GetString(Convert.FromBase64String(foldedStackLineToAdd.ExitCallsArray[i]));

List<string> allExits = new List<string>();
allExits.AddRange(exitsInThisFoldedStack.Split('\n').ToList());
allExits.AddRange(exitsInIncomingFoldedStack.Split('\n').ToList());
// Only append if the exit size hasn't grown larger then what we want to see
if (exitsInThisFoldedStack.Length < 400)
{
string exitsInIncomingFoldedStack = Encoding.UTF8.GetString(Convert.FromBase64String(foldedStackLineToAdd.ExitCallsArray[i]));

// Only append unique values
List<string> uniqueExits = allExits.Distinct().ToList();
this.ExitCallsArray[i] = Convert.ToBase64String(UTF8Encoding.UTF8.GetBytes(String.Join("\n", uniqueExits)));
List<string> allExits = new List<string>();
allExits.AddRange(exitsInThisFoldedStack.Split('\n').ToList());
allExits.AddRange(exitsInIncomingFoldedStack.Split('\n').ToList());

// Only append unique values
List<string> uniqueExits = allExits.Distinct().ToList();
this.ExitCallsArray[i] = Convert.ToBase64String(UTF8Encoding.UTF8.GetBytes(String.Join("\n", uniqueExits)));
}
}
else if (
this.ExitCallsArray[i] != null &&
Expand All @@ -177,8 +182,7 @@ public void AddFoldedStackLine(FoldedStackLine foldedStackLineToAdd)
(foldedStackLineToAdd.ExitCallsArray[i] == null || foldedStackLineToAdd.ExitCallsArray[i].Length == 0))
{
// Do nothing, nothing to join
}

}
}
}
}
Expand Down
Binary file modified VisualAnalytics/PowerBI/Design/EntityMetricsDesign.pbix
Binary file not shown.
Binary file modified VisualAnalytics/PowerBI/Templates/EntityMetrics.pbit
Binary file not shown.

0 comments on commit 4df81fd

Please sign in to comment.