Session: Get Incremental Time Series Entries
- To get a range of incremental time series entries, use one of the
IncrementalTimeSeriesFor.Get
methods. - This method retrieves only the accumulated values of incremental time series entries.
To retrieve the values stored by each node, use GetTimeSeriesOperation.
- In this page:
IncrementalTimeSeriesFor.Get
IncrementalTimeSeriesFor.Get
retrieves a range of entries from a single time series.
- To retrieve multiple series' data, use the GetMultipleTimeSeriesOperation document-store operation.
- Retrieved data can be sliced to pages to get time series entries gradually, one custom-size page at a time.
Syntax
-
IncrementalTimeSeriesFor.Get
method:
// Return time series values for the provided range TimeSeriesEntry[] Get(DateTime? from = null, DateTime? to = null, int start = 0, int pageSize = int.MaxValue);
-
Parameters
Parameters Type Description from
DateTime?
Range Start to
DateTime?
Range End start
int
Paging first entry.
E.g. 50 means the first page would start at the 50th time series entry.
Default: 0, for the first time-series entry.pagesize
int
Paging page-size.
E.g. setpagesize
to 10 to retrieve pages of 10 entries.
Default: int.MaxValue, for all time series entries. -
Return Values
TimeSeriesEntry[]
- an array of time series entry classes.
Usage Flow
- Open a session
-
Create an instance of
IncrementalTimeSeriesFor
and pass it:- An explicit document ID,
-or-
An entity tracked by the session, e.g. a document object returned from session.Query or from session.Load. - The time series name.
The name must begin with "INC:" (can be upper or lower case) to identify the time series as incremental.
- An explicit document ID,
- Call
IncrementalTimeSeriesFor.Get
.
Code Samples
-
In this sample we retrieve all the entries of a time series.
// Get all time series entries TimeSeriesEntry[] val = session.IncrementalTimeSeriesFor("companies/webstore", "INC:Downloads") .Get(DateTime.MinValue, DateTime.MaxValue);
-
Find additional samples here.