[tor-commits] [collector/master] Also rename properties from 'Torperf' to 'Onionperf'.

karsten at torproject.org karsten at torproject.org
Fri Apr 28 14:18:43 UTC 2017


commit 67aea3dfac326a77163cb0cd1b3505195779bf0a
Author: iwakeh <iwakeh at torproject.org>
Date:   Thu Apr 27 09:49:31 2017 +0000

    Also rename properties from 'Torperf' to 'Onionperf'.
---
 src/main/java/org/torproject/collector/Main.java            |  2 +-
 src/main/java/org/torproject/collector/conf/Annotation.java |  2 +-
 .../java/org/torproject/collector/conf/Configuration.java   |  2 +-
 src/main/java/org/torproject/collector/conf/Key.java        |  6 +++---
 src/main/resources/collector.properties                     |  8 ++++----
 src/test/java/org/torproject/collector/MainTest.java        |  2 +-
 .../java/org/torproject/collector/cron/SchedulerTest.java   | 13 +++++++------
 7 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/src/main/java/org/torproject/collector/Main.java b/src/main/java/org/torproject/collector/Main.java
index 95da01a..6676eb8 100644
--- a/src/main/java/org/torproject/collector/Main.java
+++ b/src/main/java/org/torproject/collector/Main.java
@@ -50,7 +50,7 @@ public class Main {
     collecTorMains.put(Key.ExitlistsActivated, ExitListDownloader.class);
     collecTorMains.put(Key.UpdateindexActivated, CreateIndexJson.class);
     collecTorMains.put(Key.RelaydescsActivated, ArchiveWriter.class);
-    collecTorMains.put(Key.TorperfActivated, OnionperfDownloader.class);
+    collecTorMains.put(Key.OnionperfActivated, OnionperfDownloader.class);
   }
 
   private static Configuration conf = new Configuration();
diff --git a/src/main/java/org/torproject/collector/conf/Annotation.java b/src/main/java/org/torproject/collector/conf/Annotation.java
index 5bdfbe6..ec983fc 100644
--- a/src/main/java/org/torproject/collector/conf/Annotation.java
+++ b/src/main/java/org/torproject/collector/conf/Annotation.java
@@ -16,7 +16,7 @@ public enum Annotation {
   Microdescriptor("@type microdescriptor 1.0\n"),
   Server("@type server-descriptor 1.0\n"),
   Status("@type bridge-network-status 1.1\n"),
-  Torperf("@type torperf 1.0\n"),
+  Onionperf("@type torperf 1.0\n"),
   Vote("@type network-status-vote-3 1.0\n");
 
   private final String annotation;
diff --git a/src/main/java/org/torproject/collector/conf/Configuration.java b/src/main/java/org/torproject/collector/conf/Configuration.java
index 7c7acc6..4e24a7b 100644
--- a/src/main/java/org/torproject/collector/conf/Configuration.java
+++ b/src/main/java/org/torproject/collector/conf/Configuration.java
@@ -92,7 +92,7 @@ public class Configuration extends Observable implements Cloneable {
         || this.getBool(Key.BridgedescsActivated)
         || this.getBool(Key.ExitlistsActivated)
         || this.getBool(Key.UpdateindexActivated)
-        || this.getBool(Key.TorperfActivated))) {
+        || this.getBool(Key.OnionperfActivated))) {
       throw new ConfigurationException("Nothing is activated!\n"
           + "Please edit collector.properties. Exiting.");
     }
diff --git a/src/main/java/org/torproject/collector/conf/Key.java b/src/main/java/org/torproject/collector/conf/Key.java
index 9473421..e3bcff1 100644
--- a/src/main/java/org/torproject/collector/conf/Key.java
+++ b/src/main/java/org/torproject/collector/conf/Key.java
@@ -42,9 +42,9 @@ public enum Key {
   RelaydescsActivated(Boolean.class),
   RelaydescsOffsetMinutes(Integer.class),
   RelaydescsPeriodMinutes(Integer.class),
-  TorperfActivated(Boolean.class),
-  TorperfOffsetMinutes(Integer.class),
-  TorperfPeriodMinutes(Integer.class),
+  OnionperfActivated(Boolean.class),
+  OnionperfOffsetMinutes(Integer.class),
+  OnionperfPeriodMinutes(Integer.class),
   UpdateindexActivated(Boolean.class),
   UpdateindexOffsetMinutes(Integer.class),
   UpdateindexPeriodMinutes(Integer.class),
diff --git a/src/main/resources/collector.properties b/src/main/resources/collector.properties
index f152644..54caf5a 100644
--- a/src/main/resources/collector.properties
+++ b/src/main/resources/collector.properties
@@ -30,11 +30,11 @@ RelaydescsPeriodMinutes = 30
 # offset in minutes since the epoch and
 RelaydescsOffsetMinutes = 5
 ## the following defines, if this module is activated
-TorperfActivated = false
+OnionperfActivated = false
 # period in minutes
-TorperfPeriodMinutes = 360
+OnionperfPeriodMinutes = 360
 # offset in minutes since the epoch and
-TorperfOffsetMinutes = 1
+OnionperfOffsetMinutes = 1
 # the following defines, if this module is activated
 UpdateindexActivated = false
 # period in minutes
@@ -139,7 +139,7 @@ ExitlistSyncOrigins = https://collector.torproject.org
 ## Where to download exit-lists from.
 ExitlistUrl = https://check.torproject.org/exit-addresses
 #
-######## Torperf downloader ########
+######## Onionperf downloader ########
 #
 ## OnionPerf base URLs
 ## Hosts must be configured to use the first subdomain part of the given URL as
diff --git a/src/test/java/org/torproject/collector/MainTest.java b/src/test/java/org/torproject/collector/MainTest.java
index 53a875d..2e9c0ce 100644
--- a/src/test/java/org/torproject/collector/MainTest.java
+++ b/src/test/java/org/torproject/collector/MainTest.java
@@ -100,7 +100,7 @@ public class MainTest {
     Main.main(new String[]{conf.toString()});
     assertTrue(4_000L <= conf.length());
     changeFilePathsAndSetActivation(conf,
-        Key.TorperfActivated.name());
+        Key.OnionperfActivated.name());
     Main.main(new String[]{conf.toString()});
     waitSec(2);
   }
diff --git a/src/test/java/org/torproject/collector/cron/SchedulerTest.java b/src/test/java/org/torproject/collector/cron/SchedulerTest.java
index fee3d74..63eb5af 100644
--- a/src/test/java/org/torproject/collector/cron/SchedulerTest.java
+++ b/src/test/java/org/torproject/collector/cron/SchedulerTest.java
@@ -22,9 +22,10 @@ import java.util.concurrent.ScheduledThreadPoolExecutor;
 public class SchedulerTest {
 
   private static final String runConfigProperties =
-      "TorperfActivated=true\nTorperfPeriodMinutes=1\nTorperfOffsetMinutes=0\n"
-      + "RelaydescsActivated=true\nRelaydescsPeriodMinutes=1"
-      + "\nRelaydescsOffsetMinutes=0\n"
+      "OnionperfActivated=true\nOnionperfPeriodMinutes=1\n"
+      + "OnionperfOffsetMinutes=0\n"
+      + "RelaydescsActivated=true\nRelaydescsPeriodMinutes=1\n"
+      + "RelaydescsOffsetMinutes=0\n"
       + "ExitlistsActivated=true\nExitlistsPeriodMinutes=1\n"
       + "ExitlistsOffsetMinutes=0\n"
       + "UpdateindexActivated=true\nUpdateindexPeriodMinutes=1\n"
@@ -37,7 +38,7 @@ public class SchedulerTest {
     Map<Key, Class<? extends CollecTorMain>> ctms = new HashMap<>();
     Configuration conf = new Configuration();
     conf.load(new ByteArrayInputStream(runConfigProperties.getBytes()));
-    ctms.put(Key.TorperfActivated, Dummy.class);
+    ctms.put(Key.OnionperfActivated, Dummy.class);
     ctms.put(Key.BridgedescsActivated, Dummy.class);
     ctms.put(Key.RelaydescsActivated, Dummy.class);
     ctms.put(Key.ExitlistsActivated, Dummy.class);
@@ -69,7 +70,7 @@ public class SchedulerTest {
     conf.load(new ByteArrayInputStream(("ShutdownGraceWaitMinutes=1\n"
         + runConfigProperties).getBytes()));
     conf.setProperty(Key.RunOnce.name(), "true");
-    ctms.put(Key.TorperfActivated, Counter.class);
+    ctms.put(Key.OnionperfActivated, Counter.class);
     ctms.put(Key.BridgedescsActivated, Counter.class);
     ctms.put(Key.RelaydescsActivated, Counter.class);
     ctms.put(Key.ExitlistsActivated, Counter.class);
@@ -92,7 +93,7 @@ public class SchedulerTest {
     Map<Key, Class<? extends CollecTorMain>> ctms = new HashMap<>();
     Configuration conf = new Configuration();
     conf.load(new ByteArrayInputStream(runConfigProperties.getBytes()));
-    ctms.put(Key.TorperfActivated, Broken.class);
+    ctms.put(Key.OnionperfActivated, Broken.class);
     ctms.put(Key.BridgedescsActivated, Broken.class);
     ctms.put(Key.RelaydescsActivated, Broken.class);
     ctms.put(Key.ExitlistsActivated, Broken.class);



More information about the tor-commits mailing list