@Test public void summary() throws URISyntaxException { final Statistics stats = new Statistics(); final Request request = new HttpRequest.Builder(Method.GET, new URI("http: RequestTimestamps timestamps = new RequestTimestamps(); timestamps.startMillis = System.currentTimeMillis(); timestamps.finishMillis = timestamps.startMillis + 17; final Response response = new HttpResponse.Builder().withStatusCode(200).withBody(Bodies.zeroes(1024)).withRequestTimestamps(timestamps) .build(); stats.update(Pair.of(request, response)); final long timestampStart = System.nanoTime(); final long timestampFinish = timestampStart + 100; final double runtime = ((double) (timestampFinish - timestampStart)) / TimeUnit.SECONDS.toMillis(1); final Summary summary = new Summary(stats, timestampStart, timestampFinish, 0, ImmutableList.of("Test Success"), 0); summary.toString(); final Summary.SummaryStats summaryStats = summary.getSummaryStats(); assertThat(summaryStats.timestampStart, is(timestampStart)); assertThat(summaryStats.timestampFinish, is(timestampFinish)); assertThat(summaryStats.runtime, is(runtime)); assertThat(summaryStats.operations, is(1L)); assertThat(summaryStats.write.operation, is(Operation.WRITE)); assertThat(summaryStats.write.operations, is(0L)); assertThat(summaryStats.write.bytes, is(0L)); assertThat(summaryStats.write.statusCodes.size(), is(0)); assertThat(summaryStats.read.operation, is(Operation.READ)); assertThat(summaryStats.read.operations, is(1L)); assertThat(summaryStats.read.bytes, is(1024L)); assertThat(summaryStats.read.statusCodes.size(), is(1)); assertThat(summaryStats.read.statusCodes, hasEntry(200, 1L)); assertThat(summaryStats.delete.operation, is(Operation.DELETE)); assertThat(summaryStats.delete.operations, is(0L)); assertThat(summaryStats.delete.bytes, is(0L)); assertThat(summaryStats.delete.statusCodes.size(), is(0)); assertThat(summaryStats.metadata.operation, is(Operation.METADATA)); assertThat(summaryStats.metadata.operations, is(0L)); assertThat(summaryStats.metadata.statusCodes.size(), is(0)); assertThat(summaryStats.metadata.statusCodes.size(), is(0)); assertThat(summaryStats.readLegalHold.operation, is(Operation.READ_LEGAL_HOLD)); assertThat(summaryStats.readLegalHold.operations, is(0L)); assertThat(summaryStats.readLegalHold.statusCodes.size(), is(0)); assertThat(summaryStats.readLegalHold.statusCodes.size(), is(0)); assertThat(summaryStats.writeLegalHold.operation, is(Operation.WRITE_LEGAL_HOLD)); assertThat(summaryStats.writeLegalHold.operations, is(0L)); assertThat(summaryStats.writeLegalHold.statusCodes.size(), is(0)); assertThat(summaryStats.writeLegalHold.statusCodes.size(), is(0)); assertThat(summaryStats.writeLegalHold.operation, is(Operation.WRITE_LEGAL_HOLD)); assertThat(summaryStats.writeLegalHold.operations, is(0L)); assertThat(summaryStats.writeLegalHold.statusCodes.size(), is(0)); assertThat(summaryStats.writeLegalHold.statusCodes.size(), is(0)); }
public Summary(final Statistics stats, final long timestampStart, final long timestampFinish, final int exitCode, ImmutableList<String> messages, final int requestsAborted) { checkNotNull(stats); checkArgument(timestampStart >= 0, "timestampStart must be >= 0 [%s]", timestampStart); checkArgument(timestampStart <= timestampFinish, "timestampStart must be <= timestampFinish [%s, %s]", timestampStart, timestampFinish); this.summaryStats = new SummaryStats(stats, timestampStart, timestampFinish, exitCode, messages, requestsAborted); }
Summary { public Summary(final Statistics stats, final long timestampStart, final long timestampFinish, final int exitCode, ImmutableList<String> messages, final int requestsAborted) { checkNotNull(stats); checkArgument(timestampStart >= 0, "timestampStart must be >= 0 [%s]", timestampStart); checkArgument(timestampStart <= timestampFinish, "timestampStart must be <= timestampFinish [%s, %s]", timestampStart, timestampFinish); this.summaryStats = new SummaryStats(stats, timestampStart, timestampFinish, exitCode, messages, requestsAborted); } }
Summary { public Summary(final Statistics stats, final long timestampStart, final long timestampFinish, final int exitCode, ImmutableList<String> messages, final int requestsAborted) { checkNotNull(stats); checkArgument(timestampStart >= 0, "timestampStart must be >= 0 [%s]", timestampStart); checkArgument(timestampStart <= timestampFinish, "timestampStart must be <= timestampFinish [%s, %s]", timestampStart, timestampFinish); this.summaryStats = new SummaryStats(stats, timestampStart, timestampFinish, exitCode, messages, requestsAborted); } Summary(final Statistics stats, final long timestampStart, final long timestampFinish,
                 final int exitCode, ImmutableList<String> messages, final int requestsAborted); }
Summary { public Summary(final Statistics stats, final long timestampStart, final long timestampFinish, final int exitCode, ImmutableList<String> messages, final int requestsAborted) { checkNotNull(stats); checkArgument(timestampStart >= 0, "timestampStart must be >= 0 [%s]", timestampStart); checkArgument(timestampStart <= timestampFinish, "timestampStart must be <= timestampFinish [%s, %s]", timestampStart, timestampFinish); this.summaryStats = new SummaryStats(stats, timestampStart, timestampFinish, exitCode, messages, requestsAborted); } Summary(final Statistics stats, final long timestampStart, final long timestampFinish,
                 final int exitCode, ImmutableList<String> messages, final int requestsAborted); SummaryStats getSummaryStats(); @Override String toString(); }
Summary { public Summary(final Statistics stats, final long timestampStart, final long timestampFinish, final int exitCode, ImmutableList<String> messages, final int requestsAborted) { checkNotNull(stats); checkArgument(timestampStart >= 0, "timestampStart must be >= 0 [%s]", timestampStart); checkArgument(timestampStart <= timestampFinish, "timestampStart must be <= timestampFinish [%s, %s]", timestampStart, timestampFinish); this.summaryStats = new SummaryStats(stats, timestampStart, timestampFinish, exitCode, messages, requestsAborted); } Summary(final Statistics stats, final long timestampStart, final long timestampFinish,
                 final int exitCode, ImmutableList<String> messages, final int requestsAborted); SummaryStats getSummaryStats(); @Override String toString();  }