Bucket
A bucket is a mutable collection of values that is used to accumulate aggregations over the index. The index may be an Index instance or a string.
The left side of the index is the range indicator, which is itself a combination of a letter and a number:
- the letter is the unit, either s (seconds), d (days),
h (hours), or d (days).
- the size is the quantity of that unit.
So 6h is six hours, 7d is seven days.
The right side of the index is a number, which is n number of that range since Jan 1, 1970 UTC.
And example of an index might be 1d-1673. This uniquely refers to a block of time 1 day long, starting 1673 days after the beginning of 1970.
Constructor Summary
Public Constructor | ||
public |
constructor(index: *) |
Method Summary
Public Methods | ||
public |
addEvent(event: *, cb: *) |
|
public |
aggregate(operator: *, cb: *) Takes the values within the bucket and aggregates them together |
|
public |
begin(): * |
|
public |
collect(cb: *) Takes the values within the bucket and collects them together |
|
public |
end(): * |
|
public |
index(): * |
|
public |
name(): * |
|
public |
range(): * |
|
public |
timerange(): * |
|
public |
toLocalString(): * |
|
public |
toUTCString(): * |
Public Constructors
public constructor(index: *) source
Params:
Name | Type | Attribute | Description |
index | * |
Public Methods
public addEvent(event: *, cb: *) source
Params:
Name | Type | Attribute | Description |
event | * | ||
cb | * |
public aggregate(operator: *, cb: *) source
Takes the values within the bucket and aggregates them together into a new IndexedEvent using the operator supplied. Then result or error is passed to the callback.
Params:
Name | Type | Attribute | Description |
operator | * | ||
cb | * |
public collect(cb: *) source
Takes the values within the bucket and collects them together into a new IndexedSeries using the operator supplied. Then result or error is passed to the callback.
Params:
Name | Type | Attribute | Description |
cb | * |