[tor-commits] [onionoo/master] Retain more detailed histories for a longer time.

karsten at torproject.org karsten at torproject.org
Wed Feb 7 10:19:32 UTC 2018


commit d153681176ba492af159e1126f9dde7d133d2720
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Fri Feb 2 15:38:03 2018 +0100

    Retain more detailed histories for a longer time.
    
    Previously, we'd have compressed histories to a resolution of 48 hours
    after 3 months. But we're now planning to introduce a 6 month graph
    with a resolution of 24 hours. With this change we're retaining
    detailed histories for three months longer.
    
    Related to #24729.
---
 src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java | 4 ++--
 src/main/java/org/torproject/onionoo/docs/ClientsStatus.java   | 2 +-
 src/main/java/org/torproject/onionoo/docs/DateTimeHelper.java  | 2 ++
 src/main/java/org/torproject/onionoo/docs/WeightsStatus.java   | 4 ++--
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java b/src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java
index ba22dd4..252a018 100644
--- a/src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java
@@ -134,8 +134,8 @@ public class BandwidthStatus extends Document {
           <= DateTimeHelper.ROUGHLY_ONE_MONTH) {
         intervalLengthMillis = DateTimeHelper.FOUR_HOURS;
       } else if (lastSeenMillis - endMillis
-          <= DateTimeHelper.ROUGHLY_THREE_MONTHS) {
-        intervalLengthMillis = DateTimeHelper.TWELVE_HOURS;
+          <= DateTimeHelper.ROUGHLY_SIX_MONTHS) {
+        intervalLengthMillis = DateTimeHelper.ONE_DAY;
       } else if (lastSeenMillis - endMillis
           <= DateTimeHelper.ROUGHLY_ONE_YEAR) {
         intervalLengthMillis = DateTimeHelper.TWO_DAYS;
diff --git a/src/main/java/org/torproject/onionoo/docs/ClientsStatus.java b/src/main/java/org/torproject/onionoo/docs/ClientsStatus.java
index a5bc8e8..2e11b50 100644
--- a/src/main/java/org/torproject/onionoo/docs/ClientsStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/ClientsStatus.java
@@ -77,7 +77,7 @@ public class ClientsStatus extends Document {
     for (ClientsHistory responses : uncompressedHistory) {
       long intervalLengthMillis;
       if (lastSeenMillis - responses.getEndMillis()
-          <= DateTimeHelper.ROUGHLY_THREE_MONTHS) {
+          <= DateTimeHelper.ROUGHLY_SIX_MONTHS) {
         intervalLengthMillis = DateTimeHelper.ONE_DAY;
       } else if (lastSeenMillis - responses.getEndMillis()
           <= DateTimeHelper.ROUGHLY_ONE_YEAR) {
diff --git a/src/main/java/org/torproject/onionoo/docs/DateTimeHelper.java b/src/main/java/org/torproject/onionoo/docs/DateTimeHelper.java
index c80514e..7966af8 100644
--- a/src/main/java/org/torproject/onionoo/docs/DateTimeHelper.java
+++ b/src/main/java/org/torproject/onionoo/docs/DateTimeHelper.java
@@ -57,6 +57,8 @@ public class DateTimeHelper {
 
   public static final long ROUGHLY_THREE_MONTHS = 92L * ONE_DAY;
 
+  public static final long ROUGHLY_SIX_MONTHS = 183L * ONE_DAY;
+
   public static final long ROUGHLY_ONE_YEAR = 366L * ONE_DAY;
 
   public static final long ROUGHLY_FIVE_YEARS = 5L * ROUGHLY_ONE_YEAR;
diff --git a/src/main/java/org/torproject/onionoo/docs/WeightsStatus.java b/src/main/java/org/torproject/onionoo/docs/WeightsStatus.java
index 94efda6..c221fdd 100644
--- a/src/main/java/org/torproject/onionoo/docs/WeightsStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/WeightsStatus.java
@@ -146,8 +146,8 @@ public class WeightsStatus extends Document {
           <= DateTimeHelper.ROUGHLY_ONE_MONTH) {
         intervalLengthMillis = DateTimeHelper.FOUR_HOURS;
       } else if (lastSeenMillis - endMillis
-          <= DateTimeHelper.ROUGHLY_THREE_MONTHS) {
-        intervalLengthMillis = DateTimeHelper.TWELVE_HOURS;
+          <= DateTimeHelper.ROUGHLY_SIX_MONTHS) {
+        intervalLengthMillis = DateTimeHelper.ONE_DAY;
       } else if (lastSeenMillis - endMillis
           <= DateTimeHelper.ROUGHLY_ONE_YEAR) {
         intervalLengthMillis = DateTimeHelper.TWO_DAYS;





More information about the tor-commits mailing list