[or-cvs] [metrics-db/master] Don't import bandwidth histories twice.

karsten at torproject.org karsten at torproject.org
Thu Nov 18 13:08:38 UTC 2010


Author: Karsten Loesing <karsten.loesing at gmx.net>
Date: Thu, 18 Nov 2010 14:04:47 +0100
Subject: Don't import bandwidth histories twice.
Commit: e8eed467403764e70d96e4d0f7fad61bee6b0384

We imported bandwidth histories of relays that started counting bytes and
dirreq-bytes at different times twice. Fix this by resetting the counters
each time we add a tuple to the database.
---
 .../ernie/db/RelayDescriptorDatabaseImporter.java  |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/org/torproject/ernie/db/RelayDescriptorDatabaseImporter.java b/src/org/torproject/ernie/db/RelayDescriptorDatabaseImporter.java
index 565d97c..fb46d94 100644
--- a/src/org/torproject/ernie/db/RelayDescriptorDatabaseImporter.java
+++ b/src/org/torproject/ernie/db/RelayDescriptorDatabaseImporter.java
@@ -453,6 +453,7 @@ public final class RelayDescriptorDatabaseImporter {
                    + (dirWrittenBytes != null ? dirWrittenBytes : "\\N")
                    + "\n");
               }
+              readBytes = writtenBytes = dirReadBytes = dirWrittenBytes = null;
             }
             if (intervalEnd.equals("EOL")) {
               break;
-- 
1.7.1



More information about the tor-commits mailing list