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.

  • Include time series data while loading or querying documents, to keep the data locally in the client's session and refrain from unnecessary additional trips to the server.
  • When caching is enabled, time series data is kept in the session cache as well.


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. set pagesize 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:
  • 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.