commit 4b9161d3797229b4951cf82ff9547bb1f907b96d Author: Karsten Loesing karsten.loesing@gmx.net Date: Thu Dec 15 09:17:13 2011 +0100
Use a few updated method signatures in metrics-lib. --- src/org/torproject/doctor/Checker.java | 8 ++++---- .../torproject/doctor/MetricsWebsiteReport.java | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/org/torproject/doctor/Checker.java b/src/org/torproject/doctor/Checker.java index c78ebf6..ab7e92d 100644 --- a/src/org/torproject/doctor/Checker.java +++ b/src/org/torproject/doctor/Checker.java @@ -257,11 +257,11 @@ public class Checker { split(","))); SortedSet<String> conflicts = new TreeSet<String>(); for (RelayNetworkStatusVote vote : this.downloadedVotes) { - Map<String, String> voteConsensusParams = + Map<String, Integer> voteConsensusParams = vote.getConsensusParams(); boolean conflictOrInvalid = false; if (voteConsensusParams != null) { - for (Map.Entry<String, String> e : + for (Map.Entry<String, Integer> e : voteConsensusParams.entrySet()) { if (!downloadedConsensus.getConsensusParams().containsKey( e.getKey()) || @@ -271,7 +271,7 @@ public class Checker { !e.getKey().startsWith("bwauth"))) { StringBuilder message = new StringBuilder(); message.append(vote.getNickname()); - for (Map.Entry<String, String> p : + for (Map.Entry<String, Integer> p : voteConsensusParams.entrySet()) { message.append(" " + p.getKey() + "=" + p.getValue()); } @@ -344,7 +344,7 @@ public class Checker { for (RelayNetworkStatusVote vote : this.downloadedVotes) { boolean containsMeasuredBandwidths = false; for (NetworkStatusEntry entry : vote.getStatusEntries().values()) { - if (entry.getBandwidth().contains("Measured=")) { + if (entry.getMeasured() >= 0) { containsMeasuredBandwidths = true; break; } diff --git a/src/org/torproject/doctor/MetricsWebsiteReport.java b/src/org/torproject/doctor/MetricsWebsiteReport.java index ac60ae7..9644c65 100644 --- a/src/org/torproject/doctor/MetricsWebsiteReport.java +++ b/src/org/torproject/doctor/MetricsWebsiteReport.java @@ -426,14 +426,14 @@ public class MetricsWebsiteReport { + "cbtdisabled,cbtnummodes,cbtrecentcount,cbtmaxtimeouts," + "cbtmincircs,cbtquantile,cbtclosequantile,cbttestfreq," + "cbtmintimeout,cbtinitialtimeout").split(","))); - Map<String, String> consensusConsensusParams = + Map<String, Integer> consensusConsensusParams = downloadedConsensus.getConsensusParams(); for (RelayNetworkStatusVote vote : this.downloadedVotes.values()) { - Map<String, String> voteConsensusParams = + Map<String, Integer> voteConsensusParams = vote.getConsensusParams(); boolean conflictOrInvalid = false; if (voteConsensusParams != null) { - for (Map.Entry<String, String> e : + for (Map.Entry<String, Integer> e : voteConsensusParams.entrySet()) { if (!consensusConsensusParams.containsKey(e.getKey()) || !consensusConsensusParams.get(e.getKey()).equals( @@ -450,7 +450,7 @@ public class MetricsWebsiteReport { + " <td><font color="red">" + vote.getNickname() + "</font></td>\n" + " <td><font color="red">params"); - for (Map.Entry<String, String> e : + for (Map.Entry<String, Integer> e : voteConsensusParams.entrySet()) { this.bw.write(" " + e.getKey() + "=" + e.getValue()); } @@ -460,7 +460,7 @@ public class MetricsWebsiteReport { this.bw.write(" <tr>\n" + " <td>" + vote.getNickname() + "</td>\n" + " <td>params"); - for (Map.Entry<String, String> e : + for (Map.Entry<String, Integer> e : voteConsensusParams.entrySet()) { this.bw.write(" " + e.getKey() + "=" + e.getValue()); } @@ -473,7 +473,7 @@ public class MetricsWebsiteReport { + " <td><font color="blue">consensus</font>" + "</td>\n" + " <td><font color="blue">params"); - for (Map.Entry<String, String> e : + for (Map.Entry<String, Integer> e : this.downloadedConsensus.getConsensusParams().entrySet()) { this.bw.write(" " + e.getKey() + "=" + e.getValue()); } @@ -546,7 +546,7 @@ public class MetricsWebsiteReport { for (RelayNetworkStatusVote vote : this.downloadedVotes.values()) { int bandwidthWeights = 0; for (NetworkStatusEntry entry : vote.getStatusEntries().values()) { - if (entry.getBandwidth().contains("Measured=")) { + if (entry.getMeasured() >= 0L) { bandwidthWeights++; } }