diff --git a/README.md b/README.md index 57610ce..d050ceb 100644 --- a/README.md +++ b/README.md @@ -132,11 +132,9 @@ There are two modes to the application. The view-metrics script processes metrics stored in the `./nexusiq` directory and presents them as detailed aggregated charts in a web view or in data files in the `./datafiles` directory. -⚠ There must be a `successmetrics.csv` in the `./iqmetrics` directory. +⚠ In order to aggregate and process success metrics a minimum of three data points (weeks or months) are needed. -⚠ In order to aggregate and process metrics a minimum of three data points (weeks or months) are needed. - -⚠ Only fully completed months (or weeks) are included in the data extract. +⚠ Only fully completed months (or weeks) are included in the success metrics data extract. ### View-metrics configuration diff --git a/view-metrics/src/main/java/org/sonatype/cs/metrics/SuccessMetricsApplication.java b/view-metrics/src/main/java/org/sonatype/cs/metrics/SuccessMetricsApplication.java index 7a0e6e4..0bb77f3 100644 --- a/view-metrics/src/main/java/org/sonatype/cs/metrics/SuccessMetricsApplication.java +++ b/view-metrics/src/main/java/org/sonatype/cs/metrics/SuccessMetricsApplication.java @@ -18,6 +18,7 @@ import java.time.LocalDateTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; +import java.util.Objects; @SpringBootApplication @EnableJpaRepositories @@ -78,24 +79,19 @@ public void run(String... args) throws Exception { successMetricsFileLoaded = loaderService.loadAllMetrics(activeProfile); - if (isSuccessMetricsFileLoaded()) { - if (runMode.contains("SERVLET")) { - // web app - this.startUp(); + if (runMode.contains("SERVLET")) { + // web app + this.startUp(); + } else { + // non-interactive mode + this.timestamp = + DateTimeFormatter.ofPattern("ddMMyy_HHmm") + .format(LocalDateTime.now(ZoneId.systemDefault())); + if (Objects.equals(activeProfile, "data")) { + createDataFiles(); } else { - // non-interactive mode - this.timestamp = - DateTimeFormatter.ofPattern("ddMMyy_HHmm") - .format(LocalDateTime.now(ZoneId.systemDefault())); - if ("data".equals(activeProfile)) { - createDataFiles(); - } else { - log.error("unknown profile"); - } + log.error("unknown profile"); } - } else { - log.error("No data files found"); - System.exit(-1); } } diff --git a/view-metrics/src/main/resources/templates/home.html b/view-metrics/src/main/resources/templates/home.html index fc8fa2e..e721df1 100644 --- a/view-metrics/src/main/resources/templates/home.html +++ b/view-metrics/src/main/resources/templates/home.html @@ -12,33 +12,29 @@
- Summary Report (anonymised) -

- Applications Report -

- Security Violations Report -

- License Violations Report -

- + Summary Report (anonymised) +

+ Applications Report +

+ Security Violations Report +

+ License Violations Report +

+
Firewall Report

-
- Policy Violations Report -

-
+
+ Policy Violations Report +

+
-
- Application Evaluations Report -

+
+ Application Evaluations Report +

@@ -46,11 +42,10 @@

-
- Database -
+
+ Database +
-
diff --git a/view-metrics/src/test/resources/org/sonatype/cs/metrics/SuccessMetricsWebApplicationTest.checkPageContents.home.approved.txt b/view-metrics/src/test/resources/org/sonatype/cs/metrics/SuccessMetricsWebApplicationTest.checkPageContents.home.approved.txt index e7aeb0e..6298a84 100644 --- a/view-metrics/src/test/resources/org/sonatype/cs/metrics/SuccessMetricsWebApplicationTest.checkPageContents.home.approved.txt +++ b/view-metrics/src/test/resources/org/sonatype/cs/metrics/SuccessMetricsWebApplicationTest.checkPageContents.home.approved.txt @@ -154,33 +154,29 @@
- Summary Report (anonymised) -

- Applications Report -

- Security Violations Report -

- License Violations Report -

- + Summary Report (anonymised) +

+ Applications Report +

+ Security Violations Report +

+ License Violations Report +

+
Firewall Report

-
- Policy Violations Report -

-
+
+ Policy Violations Report +

+
-
- Application Evaluations Report -

+
+ Application Evaluations Report +

@@ -188,10 +184,9 @@

- + -
- \ No newline at end of file +