Generator
A BucketGenerator
To use a BucketGenerator you supply the size of the buckets you want e.g. "1h" for hourly. Then you call bucket() as needed, each time with a date. The bucket containing that date will be returned.
Buckets can then be used to aggregate data.
Static Method Summary
Static Public Methods | ||
public static |
getBucketPosFromDate(date: *, length: *): * |
|
public static |
getLengthFromSize(size: *): * Takes the size (e.g. |
Constructor Summary
Public Constructor | ||
public |
constructor(size: *) |
Method Summary
Public Methods | ||
public |
bucket(date: *): * Date in is assumed to be local and that the bucket will be |
|
public |
bucketIndex(date: *): * |
|
public |
bucketIndexList(date1: *, date2: *): * |
|
public |
bucketList(date1: *, date2: *): * |
Static Public Methods
public static getBucketPosFromDate(date: *, length: *): * source
Params:
Name | Type | Attribute | Description |
date | * | ||
length | * |
Return:
* |
public static getLengthFromSize(size: *): * source
Takes the size (e.g. 1d, 6h, 5m, 30s) and returns the length of the bucket in ms.
Params:
Name | Type | Attribute | Description |
size | * |
Return:
* |
Public Constructors
public constructor(size: *) source
Params:
Name | Type | Attribute | Description |
size | * |
Public Methods
public bucket(date: *): * source
Date in is assumed to be local and that the bucket will be created in UTC time. Note that this doesn't really matter for seconds, minutes, or hours. But days will be offset from midnight to midnight, depending on local timezone.
Params:
Name | Type | Attribute | Description |
date | * |
Return:
* |
public bucketIndexList(date1: *, date2: *): * source
Params:
Name | Type | Attribute | Description |
date1 | * | ||
date2 | * |
Return:
* |
public bucketList(date1: *, date2: *): * source
Params:
Name | Type | Attribute | Description |
date1 | * | ||
date2 | * |
Return:
* |