public final class TimeWindow
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
name |
private long |
period |
private int |
resolution |
Modifier | Constructor and Description |
---|---|
private |
TimeWindow(int resolution,
long period,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
int |
getBuckets() |
java.lang.String |
getName() |
long |
getPeriod() |
int |
getResolution() |
static TimeWindow |
of(int resolution,
long period,
java.lang.String name)
Factory method to create a new TimeWindow.
|
private final int resolution
private final long period
private final java.lang.String name
private TimeWindow(int resolution, long period, java.lang.String name)
public java.lang.String getName()
public int getResolution()
public long getPeriod()
public static TimeWindow of(int resolution, long period, java.lang.String name)
resolution
- the fine-grained resolution at which individual events will be
aggregated. Must be a positive factor of period
period
- the duration represented (at least at a
resolution
resolution-level accuracy)name
- a short name for the window; used to name
automatically-generated metrics based on this window. e.g.
'1m' or '12h'.public int getBuckets()