Skip to content

Commit

Permalink
Entity Dashboards Report:
Browse files Browse the repository at this point in the history
- Adjusted logic for login to be more robust
- Minor UI fixes

Detected SIM Entities Report:
- Minor stability fixes
- Fixed #85

Entity Metrics Power BI report:
- Changed mislabeled relationship between some tables

Events Report:
- Added extraction of event details (fixed #86)
- Added events selector (fixed #87)

Entity Summary Report:
- Added first draft of report
  • Loading branch information
danielodievich committed Nov 19, 2019
1 parent afd0a18 commit 7f500bc
Show file tree
Hide file tree
Showing 69 changed files with 5,785 additions and 4,113 deletions.
7 changes: 7 additions & 0 deletions AppDynamics.Dexter.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<PackageLicenseUrl>https://github.com/Appdynamics/AppDynamics.DEXTER/blob/master/License.txt</PackageLicenseUrl>
<PackageProjectUrl />
<RepositoryUrl>https://github.com/Appdynamics/AppDynamics.DEXTER</RepositoryUrl>
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
</PropertyGroup>

<ItemGroup>
Expand All @@ -39,13 +40,19 @@
<ItemGroup>
<None Remove=".gitattributes" />
<None Remove=".gitignore" />
<None Remove="Aspose.Words.lic" />
<None Remove="packages.config" />
<None Remove="README.md" />
<None Remove="~%24MethodNamespaceTypeMapping.xlsm" />
<None Remove="~%24MethodNamespaceTypeMapping.xlsx" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Aspose.Words.lic" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Aspose.Words" Version="19.10.0" />
<PackageReference Include="CommandLineParser" Version="2.6.0" />
<PackageReference Include="CsvHelper" Version="7.1.1" />
<PackageReference Include="EPPlus" Version="4.5.3" />
Expand Down
22 changes: 22 additions & 0 deletions Aspose.Words.lic
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<License>
<Data>
<LicensedTo>Xtreme</LicensedTo>
<EmailTo>danielodievich@hotmail.com</EmailTo>
<LicenseType>Developer OEM</LicenseType>
<LicenseNote>Limited to 1 developer, unlimited physical locations</LicenseNote>
<OrderID>191025123853</OrderID>
<UserID>138126</UserID>
<OEM>This is a redistributable license</OEM>
<Products>
<Product>Aspose.Words for .NET</Product>
</Products>
<EditionType>Enterprise</EditionType>
<SerialNumber>deca013e-5e25-4550-a0d7-885a8bc5f3cb</SerialNumber>
<SubscriptionExpiry>20201025</SubscriptionExpiry>
<LicenseExpiry>20191124</LicenseExpiry>
<ExpiryNote>This is a temporary license for non-commercial use only and it will expire on 2019-11-24.</ExpiryNote>
<LicenseVersion>3.0</LicenseVersion>
<LicenseInstructions>https://purchase.aspose.com/policies/use-license</LicenseInstructions>
</Data>
<Signature>Vlyh8FCk7rpcO4ZtHcw6CJdpkCA+b7MP0ULWVJ1iudzDP5nJDQR/haZgF9iKnk2y811Yzda0S78gNfaa2oL+IezYIN7q0JgCDHSNra3Nc+RyBV15lODAArpWhQKMfOdQytAbSuMbv5SwquRU/i1rjuqida5wNC84y05F6V+ln5Y=</Signature>
</License>
915 changes: 458 additions & 457 deletions CodeMap.dgml

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions ControllerApi/ControllerApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,19 @@ public string GetApplicationEvents(long applicationID, string eventType, long st
false);
}

public string GetApplicationEventDetails(long eventID, long eventDateTimeInUnixEpochFormat)
{

return this.apiGET(
String.Format("controller/restui/events/eventDetails/{0}?timeRangeString=Custom_Time_Range.BETWEEN_TIMES.{2}.{1}.{3}",
eventID,
eventDateTimeInUnixEpochFormat - 900000, // time - 15 minutes
eventDateTimeInUnixEpochFormat + 900000, // time + 15 minutes
30), // 15 minutes + 15 minutes is 30, duration of this. Weird stuff!
"application/json",
true);
}

public string GetControllerNotifications()
{
return this.apiGET("controller/restui/notificationUiService/notifications", "application/json", true);
Expand Down
1 change: 1 addition & 0 deletions DataObjects/CompareStatesConfiguration/CompareOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public class CompareOutput
public bool EntityMetrics { get; set; }
public bool EntityMetricGraphs { get; set; }
public bool Snapshots { get; set; }
public bool Flowmaps { get; set; }
public bool FlameGraphs { get; set; }
public bool Configuration { get; set; }
}
Expand Down
2 changes: 1 addition & 1 deletion DataObjects/JobConfiguration/JobInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public class JobInput
public JobTimeRange TimeRange { get; set; }
public List<JobTimeRange> HourlyTimeRanges { get; set; }
public JobSnapshotSelectionCriteria SnapshotSelectionCriteria { get; set; }

public bool DetectedEntities { get; set; }
public bool Flowmaps { get; set; }
public bool Metrics { get; set; }
Expand All @@ -19,6 +18,7 @@ public class JobInput
public JobTarget ConfigurationComparisonReferenceMOBILE { get; set; }
public JobTarget ConfigurationComparisonReferenceDB { get; set; }
public bool Events { get; set; }
public string[] EventsSelectionCriteria { get; set; }
public bool UsersGroupsRolesPermissions { get; set; }
public bool Dashboards { get; set; }
public bool Licenses { get; set; }
Expand Down
1 change: 1 addition & 0 deletions DataObjects/JobConfiguration/JobOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ public class JobOutput
public bool UsersGroupsRolesPermissions { get; set; }
public bool Dashboards { get; set; }
public bool Licenses { get; set; }
public bool ApplicationSummary { get; set; }
}
}
1 change: 1 addition & 0 deletions DataObjects/JobConfiguration/JobStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public enum JobStatus
ReportAPMFlameGraphs = 132,

ReportAPMEntityDetails = 133,
ReportAPMApplicationSummary = 134,

ReportAPMEntityDashboardScreenshots = 140,

Expand Down
30 changes: 26 additions & 4 deletions DataObjects/ProgramOptions/ProgramOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class ProgramOptions
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; }
public string ReferenceJobFolderPath { 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('r', "right-to-state-folder", Required = true, SetName = "compare", HelpText = "Folder of the ETL job to use as a right side/difference/to comparison.")]
public string DifferenceJobFolderPath { get; set; }

[Option('d', "delete-previous-job-output", Required = false, HelpText = "If true, delete any results of previous processing.")]
public bool RestartJobFromBeginning { get; set; }
Expand All @@ -39,7 +39,29 @@ public class ProgramOptions

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);
return String.Format(
@"ProgramOptions:
InputJobFilePath='{0}'
RestartJobFromBeginning='{1}'
OutputFolderPath='{2}'
OutputJobFolderPath='{3}'
OutputJobFilePath='{4}'
ProcessSequentially='{5}'
ProgramLocationFolderPath='{6}'
CompareFilePath='{7}'
ReferenceJobFolderPath='{8}'
DifferenceJobFolderPath='{9}'
",
this.InputJobFilePath,
this.RestartJobFromBeginning,
this.OutputFolderPath,
this.OutputJobFolderPath,
this.OutputJobFilePath,
this.ProcessSequentially,
this.ProgramLocationFolderPath,
this.CompareFilePath,
this.ReferenceJobFolderPath,
this.DifferenceJobFolderPath);
}
}
}
8 changes: 5 additions & 3 deletions DefaultJob.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@
],
"Input": {
"TimeRange": {
"From": "2019-10-21T09:00:00",
"To": "2019-10-21T10:00:00"
"From": "2019-11-191T09:00:00",
"To": "2019-11-19T10:00:00"
},
"UsersGroupsRolesPermissions": true,
"Dashboards": true,
"Events": true,
"EventsSelectionCriteria": [ "All" ],
"Configuration": true,
"ConfigurationComparisonReferenceAPM": { "Controller": "", "Application": "" },
"ConfigurationComparisonReferenceWEB": { "Controller": "", "Application": "" },
Expand Down Expand Up @@ -238,6 +239,7 @@
"EntityDashboards": true,
"EntityDetails": true,
"Snapshots": true,
"FlameGraphs": true
"FlameGraphs": true,
"ApplicationSummary": true
}
}
2 changes: 1 addition & 1 deletion FlameGraphTemplate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 58 additions & 8 deletions ProcessingSteps/Extract/ExtractAPMEntityDashboardScreenshots.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class ExtractAPMEntityDashboardScreenshots : JobStepBase

internal const string DEEPLINK_TIMERANGE_BETWEEN_TIMES = "Custom_Time_Range.BETWEEN_TIMES.{0}.{1}.{2}";

[System.Diagnostics.CodeAnalysis.SuppressMessage("Compiler", "CS0618", Justification = "Selenium driver obsolete warning is nice but I am not upgrading")]
public override bool Execute(ProgramOptions programOptions, JobConfiguration jobConfiguration)
{
Stopwatch stopWatch = new Stopwatch();
Expand Down Expand Up @@ -121,7 +122,7 @@ public override bool Execute(ProgramOptions programOptions, JobConfiguration job

ChromeOptions options = new ChromeOptions();
options.AcceptInsecureCertificates = true;
options.AddArgument("--headless");
//options.AddArgument("--headless");
options.AddArgument("--guest");
options.AddArgument("--disable-extensions");

Expand Down Expand Up @@ -262,7 +263,7 @@ public override bool Execute(ProgramOptions programOptions, JobConfiguration job
string addressURL = String.Format(URL_CONTROLLER_LOCAL_LOGIN, jobTarget.Controller);

loggerWebDriver.Info("Navigating to {0}", addressURL);
loggerConsole.Info("Logging into {0} with {1}", jobTarget.Controller, jobTarget.UserName);
loggerConsole.Info("Logging into {0}({1}) with {2}", jobTarget.Controller, jobTarget.ControllerVersion, jobTarget.UserName);

// https://soandso.saas.appdynamics.com/controller/#/localLogin=true
chromeDriver.Url = addressURL;
Expand All @@ -272,7 +273,9 @@ public override bool Execute(ProgramOptions programOptions, JobConfiguration job
RemoteWebElement accountTextBox = null;
RemoteWebElement userNameTextBox = null;
RemoteWebElement userPasswordTextBox = null;
RemoteWebElement loginButtonElement = null;
RemoteWebElement loginButton = null;
RemoteWebElement useLocalLoginHref= null;

try
{
accountTextBox = wait.Until<RemoteWebElement>(d => (RemoteWebElement)d.FindElement(By.Id("accountNameInput")));
Expand All @@ -290,7 +293,7 @@ public override bool Execute(ProgramOptions programOptions, JobConfiguration job
catch { }
try
{
loginButtonElement = wait.Until<RemoteWebElement>(d => (RemoteWebElement)d.FindElement(By.Id("submitInput")));
loginButton = wait.Until<RemoteWebElement>(d => (RemoteWebElement)d.FindElement(By.Id("submitInput")));
}
catch { }

Expand All @@ -312,6 +315,24 @@ public override bool Execute(ProgramOptions programOptions, JobConfiguration job
loggerWebDriver.Trace("Setting account={0}", accountName);
accountTextBox.SendKeys(accountName);
}

Thread.Sleep(1000);

if (userPasswordTextBox != null && userPasswordTextBox.Displayed == false)
{
loggerWebDriver.Warn("SAML must be configured, Password got hidden. Trying to click on Use Local Login");

// Check if Use Local Login is turned on
// In 4.5.13 or later the URL does not seem to take effect
try
{
useLocalLoginHref = wait.Until<RemoteWebElement>(d => (RemoteWebElement)d.FindElement(By.ClassName("adsLink")));

useLocalLoginHref.Click();
}
catch { }
}

if (userNameTextBox != null && userNameTextBox.Displayed == true)
{
loggerWebDriver.Trace("Setting user={0}", userName);
Expand All @@ -322,18 +343,47 @@ public override bool Execute(ProgramOptions programOptions, JobConfiguration job
loggerWebDriver.Trace("Sending password");
userPasswordTextBox.SendKeys(AESEncryptionHelper.Decrypt(jobTarget.UserPassword));

if (loginButtonElement != null && loginButtonElement.Displayed == true)
if (loginButton != null && loginButton.Displayed == true)
{
loggerWebDriver.Trace("Clicking login button");
loginButtonElement.Click();
loginButton.Click();

loggerWebDriver.Trace("Waiting for home page to appear");
wait.Until(ExpectedConditions.ElementIsVisible(By.ClassName("ads-home-view-card-container")));
try
{
wait.Until(ExpectedConditions.ElementIsVisible(By.ClassName("ads-home-view-card-container")));
}
catch (WebDriverTimeoutException ex)
{
if (ex.InnerException is OpenQA.Selenium.NoSuchElementException)
{
loggerWebDriver.Warn("Clicked Login button but homepage did not show up");
loggerWebDriver.Warn(ex);
}
}

isLogonSuccessful = true;
string currentBrowserURL = chromeDriver.Url.ToLower();
if (currentBrowserURL.Contains("locallogin"))
{
loggerWebDriver.Trace("Redirect after clicking Login was unsuccessful, but we are logged in");
isLogonSuccessful = true;
}
else if (currentBrowserURL.Contains("location=ad_home_overview"))
{
loggerWebDriver.Trace("Redirect after clicking Login was successful");
isLogonSuccessful = true;
}
else
{
isLogonSuccessful = false;
}
}
}
}
else
{
loggerWebDriver.Error("SAML must be configured, Password got hidden. Clicking on Login must not have worked");
}

}
catch (Exception ex)
Expand Down
Loading

0 comments on commit 7f500bc

Please sign in to comment.