public final class StatsLatencyWriter extends Object
This class MAY be used by end users, however it is not supported.
| Modifier and Type | Class and Description |
|---|---|
static class |
StatsLatencyWriter.Stats |
| Constructor and Description |
|---|
StatsLatencyWriter(String name,
String filename,
boolean printIntervalStats)
Construct a latency writer
Invokes
this(filename, true, printIntervalStats, false) |
StatsLatencyWriter(String name,
String filename,
boolean printHeader,
boolean printIntervalStats,
boolean printStatsInNanos)
Construct a latency writer
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close a latency writer
Invokes
close(true)
|
void |
close(boolean finish)
Close a latency writer
|
void |
close(int warmupCount,
StatsLatencyWriter.Stats stats)
Close a latency writer
|
static void |
closeNative(long lw,
int finalCount,
boolean finish)
Close a native latency writer
|
static long |
createNative(String name,
String filename,
boolean printHeader,
boolean printIntervalStats,
boolean printStatsInNanos)
Create a new native latency writer
|
static void |
destroyNative(long lw)
Destroy a native latency writer
|
void |
finish()
Print finish line
|
static boolean |
isNativeEnabled()
Get whether native is enabled and in use
|
static void |
processNative(long lw,
long latencies,
long itotal,
long total,
int icount,
int count,
int max)
Process a set of collected latencies
|
void |
start(int rate,
int count)
Start a latency writer
|
static void |
startNative(long lw)
Start a native latency writer
|
void |
stop()
Stop a latency writer
|
boolean |
write(int val)
Write a latency data point
|
public StatsLatencyWriter(String name, String filename, boolean printHeader, boolean printIntervalStats, boolean printStatsInNanos) throws Exception
name - The name of the stats seriesfilename - The file to write the latencies to. Can be null if latencies are not to be writtenprintHeader - Whether the latencies header should be printed. This should normally be true unless
multiple latency writers are being employed and only one of them should print the headerprintIntervalStats - Whether to print stats on each interval that the stats are written to the
file. Otherwise, only aggregate stats fot the full run are printed at the end of the runprintStatsInNanos - If true, then aggregated stats are printed in nanoseconds. Otherwise, they
are printed in microseconds. This parameter does not affect what is written to the latencies file.
That is always in nanoseconds i.e. what is supplied to write(int)Exceptionpublic static final boolean isNativeEnabled()
public static final long createNative(String name, String filename, boolean printHeader, boolean printIntervalStats, boolean printStatsInNanos) throws Exception
filename - The name of the file to which latencies are writtenExceptionpublic static final void startNative(long lw)
lw - The name latency writer handlepublic static final void processNative(long lw,
long latencies,
long itotal,
long total,
int icount,
int count,
int max)
throws Exception
lw - The name latency writer handlelatencies - The native buffer containing the latencies (nanos as consecutive ints)itotal - The interval latency total (sum of all latencies in this interval)total - The latency total since start of test (sum of all latencies since start of test)icount - The number of latencies collected in this interval i.e. the number of latencies in the supplied buffercount - The total number of latencies collected since the start of the testmax - The max latency since start of testExceptionpublic static final void closeNative(long lw,
int finalCount,
boolean finish)
lw - The name latency writer handlefinalCount - The final count of latencies collected in the test runfinish - Whether the latency writing is finishedpublic static final void destroyNative(long lw)
lw - The name latency writer handlepublic final void start(int rate,
int count)
throws Exception
rate - The rate at which points will be generatedcount - The total number of data pointsExceptionpublic final boolean write(int val)
throws Exception
val - The data point, in nanosecondsExceptionpublic final void close(boolean finish)
throws Exception
finish - Whether the latency writing is finishedExceptionpublic final void close(int warmupCount,
StatsLatencyWriter.Stats stats)
throws Exception
stats - Indicates that latency writing is finished and aggregate
stats should be populated in the supplied stats objectExceptionpublic final void close()
throws Exception
Invokes close(true)
Exceptionpublic final void finish()
Copyright © 2019 N5 Technologies, Inc. All Rights Reserved.