Skip to content

Commit

Permalink
Detected APM Entities Report:
Browse files Browse the repository at this point in the history
- Added Overflow BT contents
- Added SEP rules to the detected SEPs

Entity Metrics Report:
- Fixed flowmap parsing bug which could happen when looking at flowmaps from multiple Controllers and AppID/TierID combinations were not unique

Configuration Report:
- Added Detected SEPs to the SEP rules report
  • Loading branch information
danielodievich committed Jun 28, 2019
1 parent e4d9aef commit af9cd54
Show file tree
Hide file tree
Showing 34 changed files with 2,670 additions and 1,430 deletions.
13 changes: 8 additions & 5 deletions AppDynamics.Dexter.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="1.9.71" />
<PackageReference Include="CommandLineParser" Version="2.5.0" />
<PackageReference Include="CsvHelper" Version="7.1.1" />
<PackageReference Include="EPPlus" Version="4.5.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="NLog" Version="4.5.11" />
<PackageReference Include="NLog.Config" Version="4.5.11" />
<PackageReference Include="NLog.Schema" Version="4.5.11" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="NLog" Version="4.6.5" />
<PackageReference Include="NLog.Config" Version="4.6.5" />
<PackageReference Include="NLog.Schema" Version="4.6.5" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
</ItemGroup>

Expand Down Expand Up @@ -229,6 +229,9 @@
<None Update="ConfigCompare\reference.controller\EmptyWEB.0\ENT\webpages.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="CompareStates.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="EmptyConfig\reference.controller\CFG\controllerversion.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
44 changes: 44 additions & 0 deletions CompareStates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"Target": [
{
"ReferenceController": "https://your.controller.here",
"ReferenceApplication": ".*",
"DifferenceController": "https://your.other.controller.here",
"DifferenceApplication": ".*",
"NameRegex": true,
"Type": "APM"
},
{
"ReferenceController": "https://your.controller.here",
"ReferenceApplication": "SpecificApplication",
"DifferenceController": "https://your.controller.here",
"DifferenceApplication": "AnotherSpecificApplication",
"NameRegex": false,
"Type": "APM"
},
{
"ReferenceController": "https://your.controller.here",
"ReferenceApplication": "SpecificApplication",
"DifferenceController": "https://your.other.controller.here",
"DifferenceApplication": "AnotherSpecificApplication",
"NameRegex": false,
"Type": "APM"
}
],
"Input": {
"Configuration": true,
"DetectedEntities": true,
"Metrics": true,
"Flowmaps": true,
"Snapshots": true
},
"Output": {
"Configuration": true,
"DetectedEntities": true,
"EntityMetrics": true,
"EntityMetricGraphs": true,
"Flowmaps": true,
"Snapshots": true,
"FlameGraphs": true
}
}
68 changes: 47 additions & 21 deletions ControllerApi/ControllerApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,32 @@ public string GetAPMBusinessTransactions(long applicationID)
return this.GetAPMBusinessTransactions(applicationID.ToString());
}

public string GetAPMBusinessTransactionsInOverflow(long tierID, long currentEventCount, long endEventID, long startTimeInUnixEpochFormat, long endTimeInUnixEpochFormat, long durationBetweenTimes)
{
string requestJSONTemplate =
@"{{
""componentId"": {0},
""timeRangeSpecifier"": {{
""type"": ""BETWEEN_TIMES"",
""startTime"": {3},
""endTime"": {4},
""durationInMinutes"": {5}
}},
""endEventId"": {2},
""currentFetchedEventCount"": {1}
}}";

string requestBody = String.Format(requestJSONTemplate,
tierID,
currentEventCount,
endEventID,
startTimeInUnixEpochFormat,
endTimeInUnixEpochFormat,
durationBetweenTimes);

return this.apiPOST("controller/restui/overflowtraffic/event", "application/json", requestBody, "application/json", true);
}

public string GetAPMBackends(string applicationName)
{
return this.apiGET(String.Format("controller/rest/applications/{0}/backends?output=JSON", applicationName), "application/json", false);
Expand Down Expand Up @@ -1591,11 +1617,11 @@ public string GetLicense(long startTimeInUnixEpochFormat, long endTimeInUnixEpoc
{
string requestJSONTemplate =
@"{{
""type"": ""BETWEEN_TIMES"",
""startTime"": {0},
""endTime"": {1},
""durationInMinutes"": {2}
}}";
""type"": ""BETWEEN_TIMES"",
""startTime"": {0},
""endTime"": {1},
""durationInMinutes"": {2}
}}";

string requestBody = String.Format(requestJSONTemplate,
startTimeInUnixEpochFormat,
Expand All @@ -1609,11 +1635,11 @@ public string GetLicenseUsageAllExceptEUMSummary(long startTimeInUnixEpochFormat
{
string requestJSONTemplate =
@"{{
""type"": ""BETWEEN_TIMES"",
""startTime"": {0},
""endTime"": {1},
""durationInMinutes"": {2}
}}";
""type"": ""BETWEEN_TIMES"",
""startTime"": {0},
""endTime"": {1},
""durationInMinutes"": {2}
}}";

string requestBody = String.Format(requestJSONTemplate,
startTimeInUnixEpochFormat,
Expand All @@ -1627,11 +1653,11 @@ public string GetLicenseUsageEUMSummary(long startTimeInUnixEpochFormat, long en
{
string requestJSONTemplate =
@"{{
""type"": ""BETWEEN_TIMES"",
""startTime"": {0},
""endTime"": {1},
""durationInMinutes"": {2}
}}";
""type"": ""BETWEEN_TIMES"",
""startTime"": {0},
""endTime"": {1},
""durationInMinutes"": {2}
}}";

string requestBody = String.Format(requestJSONTemplate,
startTimeInUnixEpochFormat,
Expand All @@ -1645,11 +1671,11 @@ public string GetLicenseUsageAPM(long startTimeInUnixEpochFormat, long endTimeIn
{
string requestJSONTemplate =
@"{{
""type"": ""BETWEEN_TIMES"",
""startTime"": {0},
""endTime"": {1},
""durationInMinutes"": {2}
}}";
""type"": ""BETWEEN_TIMES"",
""startTime"": {0},
""endTime"": {1},
""durationInMinutes"": {2}
}}";

string requestBody = String.Format(requestJSONTemplate,
startTimeInUnixEpochFormat,
Expand Down Expand Up @@ -1703,7 +1729,7 @@ public string GetLicenseUsageOtherAgent(string licenseType, long startTimeInUnix
""endTime"": {1},
""durationInMinutes"": {2},
""timeRange"": null,
""timeRangeAdjusted"":false
""timeRangeAdjusted"": false
}}";

string requestBody = String.Format(requestJSONTemplate,
Expand Down
12 changes: 12 additions & 0 deletions DataObjects/CompareStatesConfiguration/CompareConfiguration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Collections.Generic;

namespace AppDynamics.Dexter
{
public class CompareConfiguration
{
public CompareInput Input { get; set; }
public CompareOutput Output { get; set; }
public List<CompareTarget> Target { get; set; }
public JobStatus Status { get; set; }
}
}
13 changes: 13 additions & 0 deletions DataObjects/CompareStatesConfiguration/CompareInput.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Collections.Generic;

namespace AppDynamics.Dexter
{
public class CompareInput
{
public bool DetectedEntities { get; set; }
public bool Flowmaps { get; set; }
public bool Metrics { get; set; }
public bool Snapshots { get; set; }
public bool Configuration { get; set; }
}
}
12 changes: 12 additions & 0 deletions DataObjects/CompareStatesConfiguration/CompareOutput.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace AppDynamics.Dexter
{
public class CompareOutput
{
public bool DetectedEntities { get; set; }
public bool EntityMetrics { get; set; }
public bool EntityMetricGraphs { get; set; }
public bool Snapshots { get; set; }
public bool FlameGraphs { get; set; }
public bool Configuration { get; set; }
}
}
53 changes: 53 additions & 0 deletions DataObjects/CompareStatesConfiguration/CompareStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
namespace AppDynamics.Dexter
{
public enum CompareStatus
{
// Compare Steps
CompareAPMConfiguration = 1,
//CompareDBConfiguration = 2,
//CompareWEBConfiguration = 3,
//CompareMOBILEConfiguration = 4,
//CompareBIQConfiguration = 5,

CompareAPMEntities = 10,
//CompareSIMEntities = 21,
//CompareDBEntities = 22,
//CompareWEBEntities = 23,
//CompareMOBILEEntities = 24,
//CompareBIQEntities = 25,

CompareAPMMetrics = 20,
//CompareSIMMetrics = 21,
//CompareDBMetrics = 22,
//CompareWEBMetrics = 23,
//CompareMOBILEMetrics = 24,
//CompareBIQMetrics = 25,

CompareAPMFlowmaps = 30,

CompareAPMSnapshots = 40,

// Report steps
ReportConfigurationDifferences = 100,

ReportAPMEntitiesDifferences = 110,
//ReportSIMEntities = 111,
//ReportDBEntities = 112,
//ReportWEBEntities = 113,
//ReportMOBILEEntities = 114,
//ReportBIQEntities = 115,

ReportAPMMetricsDifferences = 120,
ReportAPMMetricGraphsDifferences = 121,

ReportAPMFlowmapsDifferences = 122,

ReportAPMSnapshotsDifferences = 130,
ReportAPMFlameGraphsDifferences = 132,

// The rest
Done = 500,

Error = -1
}
}
35 changes: 35 additions & 0 deletions DataObjects/CompareStatesConfiguration/CompareTarget.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;

namespace AppDynamics.Dexter
{
public class CompareTarget
{
public string ReferenceConroller { get; set; }
public string ReferenceApplication { get; set; }
public long ReferenceApplicationID { get; set; }
public string DifferenceController { get; set; }
public string DifferenceApplication { get; set; }
public long DifferenceApplicationID { get; set; }
public bool NameRegex { get; set; }
public string Type { get; set; }

public CompareTarget Clone()
{
return (CompareTarget)this.MemberwiseClone();
}

public override string ToString()
{
return String.Format(
"CompareTarget: {0}/{1}({2})[{3}] vs {4}/{5}({6})[{7}]",
this.ReferenceConroller,
this.ReferenceApplication,
this.ReferenceApplicationID,
this.Type,
this.DifferenceController,
this.DifferenceApplication,
this.DifferenceApplicationID,
this.Type);
}
}
}
33 changes: 16 additions & 17 deletions DataObjects/ProgramOptions/ProgramOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,28 @@ namespace AppDynamics.Dexter
{
public class ProgramOptions
{
[Option('j', "jobfile", Required = true, HelpText = "Input file defining the job to process.")]
[Option('j', "job-file", Required = true, SetName ="etl", HelpText = "Input file defining the parameters of the ETL job to process.")]
public string InputJobFilePath { get; set; }

[Option('r', "restart", Required = false, DefaultValue = false, HelpText = "If true, restart processing of job file if it is in the middle of processing already.")]
public bool RestartJobFromBeginning { get; set; }

[Option('o', "outputfolder", Required = false, DefaultValue = @"", HelpText = "Output folder where to store results of jobs.")]
[Option('o', "output-folder", Required = false, HelpText = "Output folder where to store results of processing.")]
public string OutputFolderPath { get; set; }

[Option('s', "sequential", Required = false, DefaultValue = false, HelpText = "If true, process items during extraction and conversion sequentially.")]
[Option('c', "compare-states-file", Required = true, SetName = "compare", HelpText = "Compare file defining the mappings of the state comparison to perform.")]
public string CompareFilePath { get; set; }

[Option('l', "left-from-state-folder", Required = true, SetName = "compare", HelpText = "Folder of the ETL job to use as a left side/reference/from comparison.")]
public string FromJobFolderPath { get; set; }

[Option('r', "right-to-state-folder", Required = true, SetName = "compare", HelpText = "Folder of the ETL job to use as a right side/target/to comparison.")]
public string ToJobFolderPath{ get; set; }

[Option('d', "delete-previous-job-output", Required = false, HelpText = "If true, delete any results of previous processing.")]
public bool RestartJobFromBeginning { get; set; }

[Option('s', "sequential-processing", Required = false, HelpText = "If true, process certain items during extraction and conversion sequentially.")]
public bool ProcessSequentially { get; set; }

[Option('v', "noversioncheck", Required = false, DefaultValue = false, HelpText = "If true, skips the version check against GitHub repository.")]
[Option('v', "skip-version-check", Required = false, HelpText = "If true, skips the version check against GitHub repository.")]
public bool SkipVersionCheck { get; set; }

public string OutputJobFolderPath { get; set;}
Expand All @@ -29,16 +38,6 @@ public class ProgramOptions

public string JobName { get; set; }

[ParserState]
public IParserState LastParserState { get; set; }

[HelpOption]
public string GetUsage()
{
return HelpText.AutoBuild(this,
(HelpText current) => HelpText.DefaultParsingErrorsHandler(this, current));
}

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}'\r\nProgramLocationFolderPath='{6}'", this.InputJobFilePath, this.RestartJobFromBeginning, this.OutputFolderPath, this.OutputJobFolderPath, this.OutputJobFilePath, this.ProcessSequentially, this.ProgramLocationFolderPath);
Expand Down
Loading

0 comments on commit af9cd54

Please sign in to comment.