diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMetricsCollector.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMetricsCollector.java index 9a08951fe8..7b07a15aec 100755 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMetricsCollector.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMetricsCollector.java @@ -108,57 +108,58 @@ final class AutoIngestMetricsCollector { static final class MetricsSnapshot { private final List completedJobMetrics = new ArrayList<>(); - + /** * Gets a list of completed job metrics. - * + * * @return The completed job metrics. */ List getCompletedJobMetrics() { return new ArrayList<>(completedJobMetrics); } - + /** * Adds a new metric to the list of completed job metrics. - * - * @param completedDate The completed job date. + * + * @param completedDate The completed job date. * @param dataSourceSize The data source size. */ void addCompletedJobMetric(java.util.Date completedDate, long dataSourceSize) { completedJobMetrics.add(new JobMetric(completedDate, dataSourceSize)); } } - + /** * A single job metric for an auto ingest cluster. */ static final class JobMetric { + private final long completedDate; private final long dataSourceSize; - + /** * Instantiates a job metric. - * - * @param completedDate The job completion date. + * + * @param completedDate The job completion date. * @param dataSourceSize The data source size. */ JobMetric(java.util.Date completedDate, long dataSourceSize) { this.completedDate = completedDate.getTime(); this.dataSourceSize = dataSourceSize; } - + /** * Gets the job completion date, formatted in milliseconds. - * + * * @return The job completion date. */ long getCompletedDate() { return completedDate; } - + /** * Gets the data source size. - * + * * @return The data source size. */ long getDataSourceSize() { diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMetricsDialog.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMetricsDialog.java index 69f3401180..af0679be5f 100755 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMetricsDialog.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestMetricsDialog.java @@ -34,14 +34,14 @@ import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestMetricsCollector. * Displays auto ingest metrics for a cluster. */ final class AutoIngestMetricsDialog extends javax.swing.JDialog { - + private static final int GIGABYTE_SIZE = 1073741824; - + private final AutoIngestMetricsCollector autoIngestMetricsCollector; /** * Creates an instance of AutoIngestMetricsDialog - * + * * @param parent The parent container. */ @Messages({ @@ -62,39 +62,39 @@ final class AutoIngestMetricsDialog extends javax.swing.JDialog { setLocationRelativeTo(parent); setVisible(true); } - + /** * Update the metrics shown in the report text area. */ private void updateMetrics() { - if(datePicker.getDate() == null) { + if (datePicker.getDate() == null) { return; } - + AutoIngestMetricsCollector.MetricsSnapshot metricsSnapshot = autoIngestMetricsCollector.queryCoordinationServiceForMetrics(); List completedJobMetrics = metricsSnapshot.getCompletedJobMetrics(); int jobsCompleted = 0; long dataSourceSizeTotal = 0; long pickedDate = datePicker.getDate().atStartOfDay().toEpochSecond(ZoneOffset.UTC) * 1000; - - for(JobMetric jobMetric : completedJobMetrics) { - if(jobMetric.getCompletedDate() >= pickedDate) { + + for (JobMetric jobMetric : completedJobMetrics) { + if (jobMetric.getCompletedDate() >= pickedDate) { jobsCompleted++; dataSourceSizeTotal += jobMetric.getDataSourceSize(); } } - + SimpleDateFormat dateFormatter = new SimpleDateFormat("MMM d, yyyy"); reportTextArea.setText(String.format( - "Since %s:\n" + - "Number of Jobs Completed: %d\n" + - "Total Size of Data Sources: %.1f GB\n", + "Since %s:\n" + + "Number of Jobs Completed: %d\n" + + "Total Size of Data Sources: %.1f GB\n", dateFormatter.format(Date.valueOf(datePicker.getDate())), jobsCompleted, - (double)dataSourceSizeTotal / GIGABYTE_SIZE + (double) dataSourceSizeTotal / GIGABYTE_SIZE )); } - + /** * Exception type thrown when there is an error completing an auto ingest * metrics dialog operation. @@ -226,4 +226,4 @@ final class AutoIngestMetricsDialog extends javax.swing.JDialog { private javax.swing.JTextArea reportTextArea; private javax.swing.JLabel startingDataLabel; // End of variables declaration//GEN-END:variables -} \ No newline at end of file +}