Time Series of API Calls Counts

Get Historical Data

GET call-counts/historical/

Note

Authorized Roles: root, manager

It returns historical data by organization in a time period. When the amount of data found is greater than 100 points, it will be aggregated into 100 buckets.

Query Parameters
  • start_timestamp (float64) – Optional. [min: -150000000000.0 (year -2786) max: 3500000000.0 (year 2080)] Start timestamp

  • end_timestamp (float64) – Optional. [min: -150000000000.0 (year -2786) max: 3500000000.0 (year 2080)] End timestamp

EXAMPLE QUERY PARAMS
  ?start_timestamp=1616962929.0&end_timestamp=1635452529.0
Response JSON Object
  • warnings (list-of-string) – Optional. List of warnings

  • timestamps (list-of-float64) –

    Timestamps

    [min: -150000000000.0 (year -2786) max: 3500000000.0 (year 2080)]

  • counts (list-of-uint64) – Counts array

EXAMPLE RESPONSE
  {
      "timestamps": [1616962929.0, 1616963929.0, 1616964929.0, 1635452529.0],
      "counts": [78, 0, 15, 40]
  }

Get Historical Data By Label

GET call-counts/historical/<str:label>/

Note

Authorized Roles: root, manager

It returns historical data by organization and label in a time period. When the amount of data found is greater than 100 points, it will be aggregated into 100 buckets.

The response is paginated, you can control the response amount and offset using the query parameters amt and cursor.

The labels are:

  • ACCOUNTS: emails or names, depending on the type of account.

  • ENDPOINTS: names of endpoint groups and they are defined internally. The names will always be returned based on the samples found in the search.

  • DBS: db names created or deleted.

  • SCENARIOS: recommendation type and scenario name.

  • RECO_TYPES: recommendation type.

  • CHAT: active chat session per organization.

Query Parameters
  • start_timestamp (float64) – Optional. [min: -150000000000.0 (year -2786) max: 3500000000.0 (year 2080)] Start timestamp

  • end_timestamp (float64) – Optional. [min: -150000000000.0 (year -2786) max: 3500000000.0 (year 2080)] End timestamp

  • amt (int) – Optional. [max: 128] Maximum amount of series returned, by default is 64

  • cursor (string) – Optional. Pagination cursor, typically from the next_cursor value from the previous response

EXAMPLE QUERY PARAMS
  ?start_timestamp=1616962929.0&end_timestamp=1635452529.0&amt=2&cursor=Q21v1pHYHSFjSxy...
Response JSON Object
  • warnings (list-of-string) – Optional. List of warnings

  • timestamps (list-of-float64) –

    Timestamps

    [min: -150000000000.0 (year -2786) max: 3500000000.0 (year 2080)]

  • series (list-of-object) –

    Series

    Inner fields
    • key (string) – Key

    • description (string) – Description of series

    • counts (list-of-uint64) – Counts

    • extra_data (object) – Extra series data

      Inner fields
      • db_id (string) – Database ID

  • has_next (bool) – Indicates whether or not there are more series to request

  • next_cursor (string) – Pagination cursor to use in next request to get more series

EXAMPLE RESPONSE
  {
      "timestamps": [1616962929.0, 1616963929.0, 1635452529.0],
      "series": [
          {
              "key": "USERINTERACTION",
              "description": "create user interactions",
              "extra_data": {},
              "counts": [78, 0, 40]
          },
          {
              "key": "USERRATING",
              "description": "create, update, get or delete user ratings",
              "extra_data": {},
              "counts": [2, 45, 3]
          }
      ],
      "has_next": true,
      "next_cursor": "Q21vU1pHb1FjSEp..."
  }

Get Historical Data By Scenario

GET call-counts/historical/SCENARIOS/<str:reco_type>/<str:name>/

Note

Authorized Roles: root, manager, backend

It returns historical data by scenario in a time period. When the amount of data found is greater than 100 points, it will be aggregated into 100 buckets.

Query Parameters
  • start_timestamp (float64) – Optional. [min: -150000000000.0 (year -2786) max: 3500000000.0 (year 2080)] Start timestamp

  • end_timestamp (float64) – Optional. [min: -150000000000.0 (year -2786) max: 3500000000.0 (year 2080)] End timestamp

EXAMPLE QUERY PARAMS
  ?start_timestamp=1616962929.0&end_timestamp=1635452529.0
Response JSON Object
  • warnings (list-of-string) – Optional. List of warnings

  • timestamps (list-of-float64) –

    Timestamps

    [min: -150000000000.0 (year -2786) max: 3500000000.0 (year 2080)]

  • counts (list-of-uint64) – Counts array

EXAMPLE RESPONSE
  {
      "timestamps": [1616962929.0, 1616963929.0, 1616964929.0, 1635452529.0],
      "counts": [78, 0, 15, 40]
  }