Constructor.
the datum stream ID
an array with 2 elements for the datum start and end timestamps, either as a Date
instance
or a form suitable for constructing as new Date(ts)
Optional
iProps: InstantaneousPropertyStatistics[]the instantaneous property values and associated statistics
Optional
aProps: AccumulatingPropertyStatistics[]the accumulating property values and associated statistics
Optional
sProps: string[]the status property values
Optional
tags: string[] | Set<string>the tag values
Optional
meta: DatumStreamMetadata | DatumStreamMetadataRegistryoptional metadata to attach, or a metadata registry to resolve metadata based on the given streamId
Optional
Readonly
aThe accumulating property values and associated statistics.
Optional
Readonly
iThe instantaneous property values and associated statistics.
Optional
Readonly
metaAttached metadata.
Optional
Readonly
sThe status property values.
Readonly
streamThe stream ID.
Optional
Readonly
tagsThe tag values.
Readonly
tsThe start and end dates.
The timestamp.
Attached metadata.
Get the property values for a given samples type.
the type of property values to return
the property values for the given type, or undefined if none available
Get this object as a standard JSON encoded string value.
This method returns the JSON form of the result of toJsonObject().
Optional
registry: DatumStreamMetadataRegistrya stream metadata registry to encode as a registry-indexed stream datum
the JSON encoded string
Get this object as an array suitable for encoding into a standard stream datum JSON string.
This method can encode the datum into an array using one of two ways, depending on whether the registry
argument is provided.
When provided, the first array element will be the stream metadata index based on calling
indexOfMetadataStreamId().
Otherwise the first array element will be the stream ID itself.
For example if a registry is used, the resulting array might look like this:
[0,[1650945600000,1651032000000],[3.6,2,0,7.2],[19.1,2,18.1, 20.1],[1.422802,1138.446687,1139.869489]]
while without a registry the array might look like this:
["7714f762-2361-4ec2-98ab-7e96807b32a6", [1650945600000,1651032000000],[3.6,2,0,7.2],[19.1,2,18.1, 20.1],[1.422802,1138.446687,1139.869489]]
Optional
registry: DatumStreamMetadataRegistrya stream metadata registry to encode as a registry-indexed stream datum
the datum stream array object
Get this instance as a simple object.
The following basic properties will be set on the returned object:
streamId
- the stream IDdate
- the timestampdate_end
- the ending timestamp, if availablesourceId
- the metadata source IDnodeId
or locationId
- either the node ID or location ID from the metadatatags
- any tags (as an Array)Beyond that, all instantaneous, accumulating, and status properties will be included. If duplicate property names exist between the different classifications, the first-available value will be used. Any available statistics for each property are included as well, using property names with the following suffixes:
_count
- count of datum_min
- minimum value_max
- maximum value_start
- starting value_end
- ending valueOptional
meta: DatumStreamMetadata | DatumStreamMetadataRegistrya metadata instance or metadata registry to encode the property names with;
falls back to the meta
class property if not provided
Optional
withoutStatistics: booleantrue
to omit statistic properties
an object populated with all available properties
Static
fromParse a JSON string into a StreamAggregateDatum instance.
The JSON must be encoded the same way toJsonEncoding() does.
the JSON to parse
a metadata instance or metadata registry to decode with
the stream datum instance
SyntaxError if json
is not valid JSON
Static
fromCreate a new module:domain~StreamAggregateDatum StreamAggregateDatum instance from an array parsed from a stream datum JSON string.
The array must have been parsed from JSON that was encoded the same way toJsonEncoding() does.
the array parsed from JSON
a metadata instance or metadata registry to decode with
the stream datum instance
Generated using TypeDoc
A stream aggregate datum entity.
A stream aggregate datum is a datum representing some aggregate calculation, without any metadata describing the datum property names. The instantantaneous and accumulating property values are stored as 2D array fields
iProps
andaProps
that hold the property values as well as associated aggregate statistics. The datum status properties are stroed in the 1D array fieldsProps
. A DatumStreamMetadata object is required to associate names with these arrays.The instantaneous properties are 4-element arrays containing:
The accumulatingn statistics are 3-element arrays containing: