commit 5fbc7fd5d6e6510e9e02f18bda8dec0e6bd2c8d1 Author: Karsten Loesing karsten.loesing@gmx.net Date: Fri Feb 2 15:27:27 2018 +0100
Use the same last-seen time for writing documents.
Previously, we'd have used the last-seen time of the relay/bridge that we're writing a document for. But that doesn't make much sense, because we don't have to provide, e.g., a 1 week graph for a relay that has been offline for years. This change is going to shrink the out/ directory to a similar size as it was when we used current system time for writing documents. --- .../onionoo/writer/BandwidthDocumentWriter.java | 20 ++++++---------- .../onionoo/writer/ClientsDocumentWriter.java | 16 ++++--------- .../onionoo/writer/DetailsDocumentWriter.java | 2 +- .../torproject/onionoo/writer/DocumentWriter.java | 2 +- .../onionoo/writer/DocumentWriterRunner.java | 18 +++++++++++++- .../onionoo/writer/SummaryDocumentWriter.java | 2 +- .../onionoo/writer/UptimeDocumentWriter.java | 12 ++++------ .../onionoo/writer/WeightsDocumentWriter.java | 9 +------ .../writer/BandwidthDocumentWriterTest.java | 9 ++----- .../onionoo/writer/DetailsDocumentWriterTest.java | 8 +++---- .../onionoo/writer/UptimeDocumentWriterTest.java | 28 ++++++++++------------ 11 files changed, 55 insertions(+), 71 deletions(-)
diff --git a/src/main/java/org/torproject/onionoo/writer/BandwidthDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/BandwidthDocumentWriter.java index 71595e2..7089c06 100644 --- a/src/main/java/org/torproject/onionoo/writer/BandwidthDocumentWriter.java +++ b/src/main/java/org/torproject/onionoo/writer/BandwidthDocumentWriter.java @@ -9,7 +9,6 @@ import org.torproject.onionoo.docs.DateTimeHelper; import org.torproject.onionoo.docs.DocumentStore; import org.torproject.onionoo.docs.DocumentStoreFactory; import org.torproject.onionoo.docs.GraphHistory; -import org.torproject.onionoo.docs.NodeStatus; import org.torproject.onionoo.docs.UpdateStatus;
import org.slf4j.Logger; @@ -32,7 +31,7 @@ public class BandwidthDocumentWriter implements DocumentWriter { }
@Override - public void writeDocuments() { + public void writeDocuments(long lastSeenMillis) { UpdateStatus updateStatus = this.documentStore.retrieve( UpdateStatus.class, true); long updatedMillis = updateStatus != null @@ -40,18 +39,13 @@ public class BandwidthDocumentWriter implements DocumentWriter { SortedSet<String> updateBandwidthDocuments = this.documentStore.list( BandwidthStatus.class, updatedMillis); for (String fingerprint : updateBandwidthDocuments) { - NodeStatus nodeStatus = this.documentStore.retrieve(NodeStatus.class, - true, fingerprint); - if (null == nodeStatus) { - continue; - } BandwidthStatus bandwidthStatus = this.documentStore.retrieve( BandwidthStatus.class, true, fingerprint); if (bandwidthStatus == null) { continue; } BandwidthDocument bandwidthDocument = this.compileBandwidthDocument( - fingerprint, nodeStatus, bandwidthStatus); + fingerprint, lastSeenMillis, bandwidthStatus); this.documentStore.store(bandwidthDocument, fingerprint); } log.info("Wrote bandwidth document files"); @@ -59,13 +53,13 @@ public class BandwidthDocumentWriter implements DocumentWriter {
private BandwidthDocument compileBandwidthDocument(String fingerprint, - NodeStatus nodeStatus, BandwidthStatus bandwidthStatus) { + long lastSeenMillis, BandwidthStatus bandwidthStatus) { BandwidthDocument bandwidthDocument = new BandwidthDocument(); bandwidthDocument.setFingerprint(fingerprint); - bandwidthDocument.setWriteHistory(this.compileGraphType( - nodeStatus.getLastSeenMillis(), bandwidthStatus.getWriteHistory())); - bandwidthDocument.setReadHistory(this.compileGraphType( - nodeStatus.getLastSeenMillis(), bandwidthStatus.getReadHistory())); + bandwidthDocument.setWriteHistory(this.compileGraphType(lastSeenMillis, + bandwidthStatus.getWriteHistory())); + bandwidthDocument.setReadHistory(this.compileGraphType(lastSeenMillis, + bandwidthStatus.getReadHistory())); return bandwidthDocument; }
diff --git a/src/main/java/org/torproject/onionoo/writer/ClientsDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/ClientsDocumentWriter.java index aba45cf..7ed2048 100644 --- a/src/main/java/org/torproject/onionoo/writer/ClientsDocumentWriter.java +++ b/src/main/java/org/torproject/onionoo/writer/ClientsDocumentWriter.java @@ -9,7 +9,6 @@ import org.torproject.onionoo.docs.ClientsStatus; import org.torproject.onionoo.docs.DateTimeHelper; import org.torproject.onionoo.docs.DocumentStore; import org.torproject.onionoo.docs.DocumentStoreFactory; -import org.torproject.onionoo.docs.NodeStatus; import org.torproject.onionoo.docs.UpdateStatus; import org.torproject.onionoo.util.FormattingUtils;
@@ -56,7 +55,7 @@ public class ClientsDocumentWriter implements DocumentWriter { private int writtenDocuments = 0;
@Override - public void writeDocuments() { + public void writeDocuments(long lastSeenMillis) { UpdateStatus updateStatus = this.documentStore.retrieve( UpdateStatus.class, true); long updatedMillis = updateStatus != null @@ -64,11 +63,6 @@ public class ClientsDocumentWriter implements DocumentWriter { SortedSet<String> updateDocuments = this.documentStore.list( ClientsStatus.class, updatedMillis); for (String hashedFingerprint : updateDocuments) { - NodeStatus nodeStatus = this.documentStore.retrieve(NodeStatus.class, - true, hashedFingerprint); - if (null == nodeStatus) { - continue; - } ClientsStatus clientsStatus = this.documentStore.retrieve( ClientsStatus.class, true, hashedFingerprint); if (clientsStatus == null) { @@ -76,7 +70,7 @@ public class ClientsDocumentWriter implements DocumentWriter { } SortedSet<ClientsHistory> history = clientsStatus.getHistory(); ClientsDocument clientsDocument = this.compileClientsDocument( - hashedFingerprint, nodeStatus, history); + hashedFingerprint, lastSeenMillis, history); this.documentStore.store(clientsDocument, hashedFingerprint); this.writtenDocuments++; } @@ -105,11 +99,11 @@ public class ClientsDocumentWriter implements DocumentWriter { DateTimeHelper.TEN_DAYS };
private ClientsDocument compileClientsDocument(String hashedFingerprint, - NodeStatus nodeStatus, SortedSet<ClientsHistory> history) { + long lastSeenMillis, SortedSet<ClientsHistory> history) { ClientsDocument clientsDocument = new ClientsDocument(); clientsDocument.setFingerprint(hashedFingerprint); - GraphHistoryCompiler ghc = new GraphHistoryCompiler( - nodeStatus.getLastSeenMillis() + DateTimeHelper.ONE_HOUR); + GraphHistoryCompiler ghc = new GraphHistoryCompiler(lastSeenMillis + + DateTimeHelper.ONE_HOUR); ghc.setThreshold(2L); for (int i = 0; i < this.graphIntervals.length; i++) { ghc.addGraphType(this.graphNames[i], this.graphIntervals[i], diff --git a/src/main/java/org/torproject/onionoo/writer/DetailsDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/DetailsDocumentWriter.java index bb81ca9..7ffaa07 100644 --- a/src/main/java/org/torproject/onionoo/writer/DetailsDocumentWriter.java +++ b/src/main/java/org/torproject/onionoo/writer/DetailsDocumentWriter.java @@ -32,7 +32,7 @@ public class DetailsDocumentWriter implements DocumentWriter { }
@Override - public void writeDocuments() { + public void writeDocuments(long lastSeenMillis) { UpdateStatus updateStatus = this.documentStore.retrieve( UpdateStatus.class, true); long updatedMillis = updateStatus != null diff --git a/src/main/java/org/torproject/onionoo/writer/DocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/DocumentWriter.java index 618a8e7..359de6f 100644 --- a/src/main/java/org/torproject/onionoo/writer/DocumentWriter.java +++ b/src/main/java/org/torproject/onionoo/writer/DocumentWriter.java @@ -5,7 +5,7 @@ package org.torproject.onionoo.writer;
public interface DocumentWriter {
- public abstract void writeDocuments(); + public abstract void writeDocuments(long lastSeenMillis);
public abstract String getStatsString(); } diff --git a/src/main/java/org/torproject/onionoo/writer/DocumentWriterRunner.java b/src/main/java/org/torproject/onionoo/writer/DocumentWriterRunner.java index dc3462c..968ab72 100644 --- a/src/main/java/org/torproject/onionoo/writer/DocumentWriterRunner.java +++ b/src/main/java/org/torproject/onionoo/writer/DocumentWriterRunner.java @@ -3,6 +3,10 @@
package org.torproject.onionoo.writer;
+import org.torproject.onionoo.docs.DocumentStore; +import org.torproject.onionoo.docs.DocumentStoreFactory; +import org.torproject.onionoo.docs.NodeStatus; + import org.slf4j.Logger; import org.slf4j.LoggerFactory;
@@ -28,10 +32,22 @@ public class DocumentWriterRunner {
/** Lets each configured document writer write its documents. */ public void writeDocuments() { + long lastSeenMillis = retrieveLastSeenMillis(); for (DocumentWriter dw : this.documentWriters) { log.debug("Writing " + dw.getClass().getSimpleName()); - dw.writeDocuments(); + dw.writeDocuments(lastSeenMillis); + } + } + + private long retrieveLastSeenMillis() { + DocumentStore documentStore = DocumentStoreFactory.getDocumentStore(); + long lastSeenMillis = -1L; + for (String fingerprint : documentStore.list(NodeStatus.class)) { + NodeStatus nodeStatus = documentStore.retrieve( + NodeStatus.class, true, fingerprint); + lastSeenMillis = Math.max(lastSeenMillis, nodeStatus.getLastSeenMillis()); } + return lastSeenMillis; }
/** Logs statistics of all configured document writers. */ diff --git a/src/main/java/org/torproject/onionoo/writer/SummaryDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/SummaryDocumentWriter.java index 813be1b..74ef31c 100644 --- a/src/main/java/org/torproject/onionoo/writer/SummaryDocumentWriter.java +++ b/src/main/java/org/torproject/onionoo/writer/SummaryDocumentWriter.java @@ -33,7 +33,7 @@ public class SummaryDocumentWriter implements DocumentWriter { private int deletedDocuments = 0;
@Override - public void writeDocuments() { + public void writeDocuments(long lastSeenAllRelaysAndBridgesMillis) { long relaysLastValidAfterMillis = -1L; long bridgesLastPublishedMillis = -1L; for (String fingerprint : this.documentStore.list(NodeStatus.class)) { diff --git a/src/main/java/org/torproject/onionoo/writer/UptimeDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/UptimeDocumentWriter.java index 12ba8fa..db09e3d 100644 --- a/src/main/java/org/torproject/onionoo/writer/UptimeDocumentWriter.java +++ b/src/main/java/org/torproject/onionoo/writer/UptimeDocumentWriter.java @@ -7,7 +7,6 @@ import org.torproject.onionoo.docs.DateTimeHelper; import org.torproject.onionoo.docs.DocumentStore; import org.torproject.onionoo.docs.DocumentStoreFactory; import org.torproject.onionoo.docs.GraphHistory; -import org.torproject.onionoo.docs.NodeStatus; import org.torproject.onionoo.docs.UpdateStatus; import org.torproject.onionoo.docs.UptimeDocument; import org.torproject.onionoo.docs.UptimeHistory; @@ -37,7 +36,7 @@ public class UptimeDocumentWriter implements DocumentWriter { }
@Override - public void writeDocuments() { + public void writeDocuments(long lastSeenMillis) { UptimeStatus uptimeStatus = this.documentStore.retrieve( UptimeStatus.class, true); if (uptimeStatus == null) { @@ -51,20 +50,18 @@ public class UptimeDocumentWriter implements DocumentWriter { SortedSet<String> updatedUptimeStatuses = this.documentStore.list( UptimeStatus.class, updatedMillis); for (String fingerprint : updatedUptimeStatuses) { - this.updateDocument(fingerprint, uptimeStatus); + this.updateDocument(fingerprint, lastSeenMillis, uptimeStatus); } log.info("Wrote uptime document files"); }
private int writtenDocuments = 0;
- private void updateDocument(String fingerprint, + private void updateDocument(String fingerprint, long lastSeenMillis, UptimeStatus knownStatuses) { - NodeStatus nodeStatus = this.documentStore.retrieve(NodeStatus.class, - true, fingerprint); UptimeStatus uptimeStatus = this.documentStore.retrieve( UptimeStatus.class, true, fingerprint); - if (null != nodeStatus && null != uptimeStatus) { + if (null != uptimeStatus) { boolean relay = uptimeStatus.getBridgeHistory().isEmpty(); SortedSet<UptimeHistory> history = relay ? uptimeStatus.getRelayHistory() @@ -72,7 +69,6 @@ public class UptimeDocumentWriter implements DocumentWriter { SortedSet<UptimeHistory> knownStatusesHistory = relay ? knownStatuses.getRelayHistory() : knownStatuses.getBridgeHistory(); - long lastSeenMillis = nodeStatus.getLastSeenMillis(); UptimeDocument uptimeDocument = this.compileUptimeDocument(relay, fingerprint, history, knownStatusesHistory, lastSeenMillis); this.documentStore.store(uptimeDocument, fingerprint); diff --git a/src/main/java/org/torproject/onionoo/writer/WeightsDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/WeightsDocumentWriter.java index b34a9e6..2d2239b 100644 --- a/src/main/java/org/torproject/onionoo/writer/WeightsDocumentWriter.java +++ b/src/main/java/org/torproject/onionoo/writer/WeightsDocumentWriter.java @@ -7,7 +7,6 @@ import org.torproject.onionoo.docs.DateTimeHelper; import org.torproject.onionoo.docs.DocumentStore; import org.torproject.onionoo.docs.DocumentStoreFactory; import org.torproject.onionoo.docs.GraphHistory; -import org.torproject.onionoo.docs.NodeStatus; import org.torproject.onionoo.docs.UpdateStatus; import org.torproject.onionoo.docs.WeightsDocument; import org.torproject.onionoo.docs.WeightsStatus; @@ -32,7 +31,7 @@ public class WeightsDocumentWriter implements DocumentWriter { }
@Override - public void writeDocuments() { + public void writeDocuments(long lastSeenMillis) { UpdateStatus updateStatus = this.documentStore.retrieve( UpdateStatus.class, true); long updatedMillis = updateStatus != null @@ -40,18 +39,12 @@ public class WeightsDocumentWriter implements DocumentWriter { SortedSet<String> updateWeightsDocuments = this.documentStore.list( WeightsStatus.class, updatedMillis); for (String fingerprint : updateWeightsDocuments) { - NodeStatus nodeStatus = this.documentStore.retrieve(NodeStatus.class, - true, fingerprint); - if (null == nodeStatus) { - continue; - } WeightsStatus weightsStatus = this.documentStore.retrieve( WeightsStatus.class, true, fingerprint); if (weightsStatus == null) { continue; } SortedMap<long[], double[]> history = weightsStatus.getHistory(); - long lastSeenMillis = nodeStatus.getLastSeenMillis(); WeightsDocument weightsDocument = this.compileWeightsDocument( fingerprint, history, lastSeenMillis); this.documentStore.store(weightsDocument, fingerprint); diff --git a/src/test/java/org/torproject/onionoo/writer/BandwidthDocumentWriterTest.java b/src/test/java/org/torproject/onionoo/writer/BandwidthDocumentWriterTest.java index fa76699..947eba9 100644 --- a/src/test/java/org/torproject/onionoo/writer/BandwidthDocumentWriterTest.java +++ b/src/test/java/org/torproject/onionoo/writer/BandwidthDocumentWriterTest.java @@ -12,7 +12,6 @@ import org.torproject.onionoo.docs.DateTimeHelper; import org.torproject.onionoo.docs.DocumentStoreFactory; import org.torproject.onionoo.docs.DummyDocumentStore; import org.torproject.onionoo.docs.GraphHistory; -import org.torproject.onionoo.docs.NodeStatus;
import org.junit.Before; import org.junit.Test; @@ -57,17 +56,13 @@ public class BandwidthDocumentWriterTest { + "r " + future + "-08-06 17:31:45 " + future + "-08-06 21:31:45 0\n" + "r " + future + "-08-06 21:31:45 " + future + "-08-07 01:31:45 0\n" + "r " + future + "-08-07 01:31:45 " + future + "-08-07 05:31:45 0\n"; - NodeStatus nodeStatus = new NodeStatus(ibibUnc0Fingerprint); - nodeStatus.setLastSeenMillis(DateTimeHelper.parse( - yesterday + " 12:00:00")); - this.documentStore.addDocument(nodeStatus, ibibUnc0Fingerprint); BandwidthStatus status = new BandwidthStatus(); status.setFromDocumentString(documentString); this.documentStore.addDocument(status, ibibUnc0Fingerprint); BandwidthDocumentWriter writer = new BandwidthDocumentWriter(); - writer.writeDocuments(); + writer.writeDocuments(DateTimeHelper.parse(yesterday + " 12:00:00")); assertEquals(1, this.documentStore.getPerformedListOperations()); - assertEquals(3, this.documentStore.getPerformedRetrieveOperations()); + assertEquals(2, this.documentStore.getPerformedRetrieveOperations()); assertEquals(1, this.documentStore.getPerformedStoreOperations()); BandwidthDocument document = this.documentStore.getDocument( BandwidthDocument.class, ibibUnc0Fingerprint); diff --git a/src/test/java/org/torproject/onionoo/writer/DetailsDocumentWriterTest.java b/src/test/java/org/torproject/onionoo/writer/DetailsDocumentWriterTest.java index 3356a9c..d96af71 100644 --- a/src/test/java/org/torproject/onionoo/writer/DetailsDocumentWriterTest.java +++ b/src/test/java/org/torproject/onionoo/writer/DetailsDocumentWriterTest.java @@ -28,7 +28,7 @@ public class DetailsDocumentWriterTest { @Test public void testNoDetailsStatuses() { DetailsDocumentWriter writer = new DetailsDocumentWriter(); - writer.writeDocuments(); + writer.writeDocuments(-1L); assertEquals("Without statuses, no documents should be written.", 0, this.documentStore.getPerformedStoreOperations()); } @@ -48,7 +48,7 @@ public class DetailsDocumentWriterTest { GABELMOO_OR_ADDRESS))); this.documentStore.addDocument(status, GABELMOO_FINGERPRINT); DetailsDocumentWriter writer = new DetailsDocumentWriter(); - writer.writeDocuments(); + writer.writeDocuments(-1L); assertEquals("One document should be written.", 1, this.documentStore.getPerformedStoreOperations()); DetailsDocument document = this.documentStore.getDocument( @@ -67,7 +67,7 @@ public class DetailsDocumentWriterTest { GABELMOO_OR_ADDRESS))); this.documentStore.addDocument(status, GABELMOO_FINGERPRINT); DetailsDocumentWriter writer = new DetailsDocumentWriter(); - writer.writeDocuments(); + writer.writeDocuments(-1L); assertEquals("One document should be written.", 1, this.documentStore.getPerformedStoreOperations()); DetailsDocument document = this.documentStore.getDocument( @@ -85,7 +85,7 @@ public class DetailsDocumentWriterTest { status.setAdvertisedOrAddresses(Arrays.asList(GABELMOO_OR_ADDRESS)); this.documentStore.addDocument(status, GABELMOO_FINGERPRINT); DetailsDocumentWriter writer = new DetailsDocumentWriter(); - writer.writeDocuments(); + writer.writeDocuments(-1L); assertEquals("One document should be written.", 1, this.documentStore.getPerformedStoreOperations()); DetailsDocument document = this.documentStore.getDocument( diff --git a/src/test/java/org/torproject/onionoo/writer/UptimeDocumentWriterTest.java b/src/test/java/org/torproject/onionoo/writer/UptimeDocumentWriterTest.java index 030d100..2915a04 100644 --- a/src/test/java/org/torproject/onionoo/writer/UptimeDocumentWriterTest.java +++ b/src/test/java/org/torproject/onionoo/writer/UptimeDocumentWriterTest.java @@ -10,7 +10,6 @@ import org.torproject.onionoo.docs.DateTimeHelper; import org.torproject.onionoo.docs.DocumentStoreFactory; import org.torproject.onionoo.docs.DummyDocumentStore; import org.torproject.onionoo.docs.GraphHistory; -import org.torproject.onionoo.docs.NodeStatus; import org.torproject.onionoo.docs.UptimeDocument; import org.torproject.onionoo.docs.UptimeStatus; import org.torproject.onionoo.updater.DescriptorSourceFactory; @@ -37,7 +36,7 @@ public class UptimeDocumentWriterTest { @Test public void testNoStatuses() { UptimeDocumentWriter writer = new UptimeDocumentWriter(); - writer.writeDocuments(); + writer.writeDocuments(TEST_TIME); assertEquals("Without providing any data, nothing should be written " + "to disk.", 0, this.documentStore.getPerformedStoreOperations()); @@ -50,9 +49,6 @@ public class UptimeDocumentWriterTest {
private void addStatusOneWeekSample(String allRelaysUptime, String gabelmooUptime) { - NodeStatus nodeStatus = new NodeStatus(GABELMOO_FINGERPRINT); - nodeStatus.setLastSeenMillis(TEST_TIME); - this.documentStore.addDocument(nodeStatus, GABELMOO_FINGERPRINT); UptimeStatus status = new UptimeStatus(); status.setFromDocumentString(allRelaysUptime); this.documentStore.addDocument(status, ALL_RELAYS_FINGERPRINT); @@ -119,7 +115,7 @@ public class UptimeDocumentWriterTest { "r 2014-03-23-11 1\n"); UptimeDocumentWriter writer = new UptimeDocumentWriter(); DescriptorSourceFactory.getDescriptorSource().readDescriptors(); - writer.writeDocuments(); + writer.writeDocuments(TEST_TIME); assertEquals("Should write exactly one document.", 1, this.documentStore.getPerformedStoreOperations()); UptimeDocument document = this.documentStore.getDocument( @@ -134,7 +130,7 @@ public class UptimeDocumentWriterTest { "r 2014-03-23-10 2\n"); UptimeDocumentWriter writer = new UptimeDocumentWriter(); DescriptorSourceFactory.getDescriptorSource().readDescriptors(); - writer.writeDocuments(); + writer.writeDocuments(TEST_TIME); assertEquals("Should write exactly one document.", 1, this.documentStore.getPerformedStoreOperations()); UptimeDocument document = this.documentStore.getDocument( @@ -149,7 +145,7 @@ public class UptimeDocumentWriterTest { "r 2014-03-23-09 1\nr 2014-03-23-11 1\n"); UptimeDocumentWriter writer = new UptimeDocumentWriter(); DescriptorSourceFactory.getDescriptorSource().readDescriptors(); - writer.writeDocuments(); + writer.writeDocuments(TEST_TIME); assertEquals("Should write exactly one document.", 1, this.documentStore.getPerformedStoreOperations()); UptimeDocument document = this.documentStore.getDocument( @@ -164,7 +160,7 @@ public class UptimeDocumentWriterTest { "r 2014-03-23-09 1\nr 2014-03-23-11 1\n"); UptimeDocumentWriter writer = new UptimeDocumentWriter(); DescriptorSourceFactory.getDescriptorSource().readDescriptors(); - writer.writeDocuments(); + writer.writeDocuments(TEST_TIME); assertEquals("Should write exactly one document.", 1, this.documentStore.getPerformedStoreOperations()); UptimeDocument document = this.documentStore.getDocument( @@ -180,7 +176,7 @@ public class UptimeDocumentWriterTest { "r 2014-03-23-09 2\n"); UptimeDocumentWriter writer = new UptimeDocumentWriter(); DescriptorSourceFactory.getDescriptorSource().readDescriptors(); - writer.writeDocuments(); + writer.writeDocuments(TEST_TIME); assertEquals("Should write exactly one document.", 1, this.documentStore.getPerformedStoreOperations()); UptimeDocument document = this.documentStore.getDocument( @@ -196,7 +192,7 @@ public class UptimeDocumentWriterTest { "r 2014-03-16-13 168\n"); UptimeDocumentWriter writer = new UptimeDocumentWriter(); DescriptorSourceFactory.getDescriptorSource().readDescriptors(); - writer.writeDocuments(); + writer.writeDocuments(TEST_TIME); assertEquals("Should write exactly one document.", 1, this.documentStore.getPerformedStoreOperations()); UptimeDocument document = this.documentStore.getDocument( @@ -211,7 +207,7 @@ public class UptimeDocumentWriterTest { "r 2014-03-16-12 169\n"); UptimeDocumentWriter writer = new UptimeDocumentWriter(); DescriptorSourceFactory.getDescriptorSource().readDescriptors(); - writer.writeDocuments(); + writer.writeDocuments(TEST_TIME); assertEquals("Should write exactly one document.", 1, this.documentStore.getPerformedStoreOperations()); UptimeDocument document = this.documentStore.getDocument( @@ -226,7 +222,7 @@ public class UptimeDocumentWriterTest { "r 2014-03-16-11 5\n"); UptimeDocumentWriter writer = new UptimeDocumentWriter(); DescriptorSourceFactory.getDescriptorSource().readDescriptors(); - writer.writeDocuments(); + writer.writeDocuments(TEST_TIME); assertEquals("Should write exactly one document.", 1, this.documentStore.getPerformedStoreOperations()); UptimeDocument document = this.documentStore.getDocument( @@ -241,7 +237,7 @@ public class UptimeDocumentWriterTest { "r 2014-03-16-10 1\nr 2014-03-16-12 1\n"); UptimeDocumentWriter writer = new UptimeDocumentWriter(); DescriptorSourceFactory.getDescriptorSource().readDescriptors(); - writer.writeDocuments(); + writer.writeDocuments(TEST_TIME); assertEquals("Should write exactly one document.", 1, this.documentStore.getPerformedStoreOperations()); UptimeDocument document = this.documentStore.getDocument( @@ -260,7 +256,7 @@ public class UptimeDocumentWriterTest { "r 2012-03-01-00 287\n"); UptimeDocumentWriter writer = new UptimeDocumentWriter(); DescriptorSourceFactory.getDescriptorSource().readDescriptors(); - writer.writeDocuments(); + writer.writeDocuments(TEST_TIME); assertEquals("Should write exactly one document.", 1, this.documentStore.getPerformedStoreOperations()); UptimeDocument document = this.documentStore.getDocument( @@ -278,7 +274,7 @@ public class UptimeDocumentWriterTest { "r 2012-03-01-00 288\n"); UptimeDocumentWriter writer = new UptimeDocumentWriter(); DescriptorSourceFactory.getDescriptorSource().readDescriptors(); - writer.writeDocuments(); + writer.writeDocuments(TEST_TIME); assertEquals("Should write exactly one document.", 1, this.documentStore.getPerformedStoreOperations()); UptimeDocument document = this.documentStore.getDocument(
tor-commits@lists.torproject.org