@NotThreadSafe
public final class TimeSeries
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Class and Description |
|---|---|
class |
TimeSeries.Summary
Class contains the summary of the TimeSeries.
|
| Constructor and Description |
|---|
TimeSeries()
Creates a TimeSeries instance with default width set to 1 second.
|
TimeSeries(long widthNano)
Creates a TimeSeries instance with given width.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(TimeSeries other)
Add one histogram to the current one.
|
int |
get(long timeNano) |
java.util.TreeMap<java.lang.Long,java.lang.Integer> |
getSeries() |
TimeSeries.Summary |
getSummary() |
long |
getWidthNano() |
void |
print(java.io.PrintStream stream)
Print the time series densely, i.e.
|
void |
record(long timeNano)
Record one event at a timestamp into the time series.
|
void |
record(long timeNano,
int numEvents)
Record events at a timestamp into the time series.
|
void |
sparsePrint(java.io.PrintStream stream)
Print the time series sparsely, i.e.
|
java.lang.String |
toString() |
public TimeSeries(long widthNano)
widthNano - the granularity of the time series. If this is set to 1 min, we count
the number of events of every minute.public TimeSeries()
public void record(long timeNano)
timeNano - the time in nano secondspublic void record(long timeNano,
int numEvents)
timeNano - the time in nano secondsnumEvents - the number of events happened at timeNanopublic int get(long timeNano)
timeNano - the time in nano secondspublic long getWidthNano()
public java.util.TreeMap<java.lang.Long,java.lang.Integer> getSeries()
public void add(TimeSeries other)
other - the TimeSeries instance to addpublic TimeSeries.Summary getSummary()
TimeSeries.Summarypublic java.lang.String toString()
toString in class java.lang.Objectpublic void sparsePrint(java.io.PrintStream stream)
stream - the print streampublic void print(java.io.PrintStream stream)
stream - the print streamCopyright © 2024. All Rights Reserved.