Opened 3 years ago

Closed 3 years ago

#19614 closed task (fixed)

metrics-web should confirm to style guide

Reported by: iwakeh Owned by: karsten
Priority: Medium Milestone: Metrics 1.0.0
Component: Metrics/Website Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: #19611 Points:
Reviewer: Sponsor:

Description (last modified by iwakeh)

verify that metrics-web java modules comply to the rules.
make necessary changes.

Closing.

Thanks!

Child Tickets

Change History (11)

comment:1 Changed 3 years ago by iwakeh

Owner: set to iwakeh
Status: newassigned

might be a good way to acquaint myself with this code here.

comment:2 Changed 3 years ago by iwakeh

Summary: confirm to (java) style guidemetrics-web should confirm to style guide

comment:3 Changed 3 years ago by karsten

Did you already start working on this one? I started 10 minutes ago because I didn't see this ticket. Do you mind me to make a start here? Otherwise I shall find something else to hack on. Up to you!

comment:4 Changed 3 years ago by iwakeh

Owner: changed from iwakeh to karsten

Please go ahead here.

comment:5 Changed 3 years ago by karsten

Status: assignedneeds_review

Please review my branch task-19614 that resolves most and suppresses a few checkstyle warnings. Whee, so many warnings, all gone now.

comment:6 Changed 3 years ago by iwakeh

Milestone: Metrics 1.0.0

comment:7 Changed 3 years ago by iwakeh

Status: needs_reviewmerge_ready

That was a lot of work here. And, good to add a general checkstyle task.

The restructuring of the project will be at least take one more ticket. I added it to the development page.

Ready for merge.

One more suppression could go away:

diff --git a/modules/legacy/src/org/torproject/ernie/cron/performance/TorperfProcessor.java b/modules/legacy/src/org/torproject/ernie/cron/performance/TorperfProcessor.java
index 751e7b9..87cbf90 100644
--- a/modules/legacy/src/org/torproject/ernie/cron/performance/TorperfProcessor.java
+++ b/modules/legacy/src/org/torproject/ernie/cron/performance/TorperfProcessor.java
@@ -27,7 +27,7 @@ import java.util.TreeMap;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-@SuppressWarnings("checkstyle:variabledeclarationusagedistance")
+
 public class TorperfProcessor {
 
   /** Processes Torperf data from the given directory and writes
@@ -224,13 +224,13 @@ public class TorperfProcessor {
           String allDateSizeSource = e.getKey();
           dlTimes = e.getValue();
           Collections.sort(dlTimes);
-          long q1 = dlTimes.get(dlTimes.size() / 4 - 1);
-          long md = dlTimes.get(dlTimes.size() / 2 - 1);
-          long q3 = dlTimes.get(dlTimes.size() * 3 / 4 - 1);
           long[] status = statusesAllSources.get(allDateSizeSource);
           timeouts = status[0];
           failures = status[1];
           requests = status[2];
+          long q1 = dlTimes.get(dlTimes.size() / 4 - 1);
+          long md = dlTimes.get(dlTimes.size() / 2 - 1);
+          long q3 = dlTimes.get(dlTimes.size() * 3 / 4 - 1);
           stats.put(allDateSizeSource,
               String.format("%s,%s,%s,%s,%s,%s,%s",
               allDateSizeSource, q1, md, q3, timeouts, failures,
Last edited 3 years ago by iwakeh (previous) (diff)

comment:8 Changed 3 years ago by karsten

Status: merge_readyassigned

Thanks for the review! I made the suggested change and pushed to master. Leaving open in case you want to make further changes as part of this ticket.

comment:9 Changed 3 years ago by karsten

Correction: I have been trying to push my branch but without success. I asked the admins to investigate. Will post here once the branch is pushed.

comment:10 Changed 3 years ago by karsten

Aaaand, pushed now. Going back to: Leaving open in case you want to make further changes as part of this ticket.

comment:11 Changed 3 years ago by iwakeh

Description: modified (diff)
Resolution: fixed
Status: assignedclosed

All things left will be tackled in #19754.

Note: See TracTickets for help on using tickets.