Formatting.

This commit is contained in:
U-BASIS\dgrove 2017-11-30 16:59:39 -05:00
parent a6b115b35e
commit a5408e8a4a
2 changed files with 30 additions and 29 deletions

View File

@ -121,7 +121,7 @@ final class AutoIngestMetricsCollector {
/** /**
* Adds a new metric to the list of completed job metrics. * 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. * @param dataSourceSize The data source size.
*/ */
void addCompletedJobMetric(java.util.Date completedDate, long dataSourceSize) { void addCompletedJobMetric(java.util.Date completedDate, long dataSourceSize) {
@ -133,13 +133,14 @@ final class AutoIngestMetricsCollector {
* A single job metric for an auto ingest cluster. * A single job metric for an auto ingest cluster.
*/ */
static final class JobMetric { static final class JobMetric {
private final long completedDate; private final long completedDate;
private final long dataSourceSize; private final long dataSourceSize;
/** /**
* Instantiates a job metric. * Instantiates a job metric.
* *
* @param completedDate The job completion date. * @param completedDate The job completion date.
* @param dataSourceSize The data source size. * @param dataSourceSize The data source size.
*/ */
JobMetric(java.util.Date completedDate, long dataSourceSize) { JobMetric(java.util.Date completedDate, long dataSourceSize) {

View File

@ -67,7 +67,7 @@ final class AutoIngestMetricsDialog extends javax.swing.JDialog {
* Update the metrics shown in the report text area. * Update the metrics shown in the report text area.
*/ */
private void updateMetrics() { private void updateMetrics() {
if(datePicker.getDate() == null) { if (datePicker.getDate() == null) {
return; return;
} }
@ -77,8 +77,8 @@ final class AutoIngestMetricsDialog extends javax.swing.JDialog {
long dataSourceSizeTotal = 0; long dataSourceSizeTotal = 0;
long pickedDate = datePicker.getDate().atStartOfDay().toEpochSecond(ZoneOffset.UTC) * 1000; long pickedDate = datePicker.getDate().atStartOfDay().toEpochSecond(ZoneOffset.UTC) * 1000;
for(JobMetric jobMetric : completedJobMetrics) { for (JobMetric jobMetric : completedJobMetrics) {
if(jobMetric.getCompletedDate() >= pickedDate) { if (jobMetric.getCompletedDate() >= pickedDate) {
jobsCompleted++; jobsCompleted++;
dataSourceSizeTotal += jobMetric.getDataSourceSize(); dataSourceSizeTotal += jobMetric.getDataSourceSize();
} }
@ -86,12 +86,12 @@ final class AutoIngestMetricsDialog extends javax.swing.JDialog {
SimpleDateFormat dateFormatter = new SimpleDateFormat("MMM d, yyyy"); SimpleDateFormat dateFormatter = new SimpleDateFormat("MMM d, yyyy");
reportTextArea.setText(String.format( reportTextArea.setText(String.format(
"Since %s:\n" + "Since %s:\n"
"Number of Jobs Completed: %d\n" + + "Number of Jobs Completed: %d\n"
"Total Size of Data Sources: %.1f GB\n", + "Total Size of Data Sources: %.1f GB\n",
dateFormatter.format(Date.valueOf(datePicker.getDate())), dateFormatter.format(Date.valueOf(datePicker.getDate())),
jobsCompleted, jobsCompleted,
(double)dataSourceSizeTotal / GIGABYTE_SIZE (double) dataSourceSizeTotal / GIGABYTE_SIZE
)); ));
} }