Skip to main content

Activity monitoring

Zuora

Activity monitoring

The introduction of the continuation token makes activity monitoring possible in BI Views V2. There are four queues in the lifecycle of the token:

  • Active queue
    Tokens that are being actively processed are in the active queue.
  • Completed queue
    Tokens for which all data has been cached are in the completed queue. Completed tasks will be in this queue for a stipulated time (300 seconds) before they are removed from the queue.
  • Draining queue
    Tokens that are completed or stale are in the draining queue. Drained tasks will be in this queue for a stipulated time (five seconds) before they are removed from the queue.
  • Stale queue
    If an active query does not perform any activity for more 240 seconds, its token is in the stale queue. If the query gets back to normal within 300 seconds, its token will be put in the active queue; otherwise, the token will be put to the draining queue.

You can use the activity monitoring feature to check the status of the continuation token by querying the queue status.

Request examples

To get the status information about all tokens, issue the following request:

GET request:

https://$tenant/api/integrations/v2/biviews-status

To get the details of a specific continuation token, issue the following request, where task_id is the continuation token that was returned in the initial request: 

GET request:

https://$tenant/api/integrations/v2/biviews-status/<task_id>

To cancel a task, issue the following request, where task_id is the continuation token that was returned in the initial request: 

DELETE request:

https://$tenant/api/integrations/v2/biviews-status/<task_id>

Response field description

When the activity monitoring APIs are executed, the following fields will be returned to provide the queue information.

Field name Description
task_id The continuation token that is issued when the first page is requested.
Accumulate

The total number of rows that have been accumulated so far. 

For example, there are 353 rows in the database and 10 rows are retrieved at a time. If five pages of data have been retrieved, this field value will be 50. If all rows have been retrieved, this field value will be 353.

metric

The number of rows on the most recent page that have been retrieved.

For example, there are 353 rows in the database and 10 rows are retrieved at a time. If five pages of data have been retrieved, this field value will be 10. If all rows have been retrieved, this field value will be 3, which is the number of rows on the last page.

activity_tracker

This object contains three fields:

  • elapsed_time: The time that has elapsed since the last event. If the elapsed time is more than 240 seconds, the token is moved to the Stale queue.

  • initative_time: The time when the first request was made.

  • last_activity: The time when the last event occurs.

query_config This object tracks the query that is being executed. It tracks the filter parameters (from date and to date) and the view for which the query is being executed.
status

The events that occur during data processing. These events are as follows:

  • ADDED-TO-QUEUE: Emitted when the first page is requested.
  • META-DATA-SCANNED: Emitted when the columns to return are processed.
  • SCANNING-PAGE-(N): Emitted when the service is fetching data ahead for the respective page.
  • COMMITING-PAGE-(N): Emitted when data has been written to the cache for the respective page.
  • MAX-REQUESTED-PAGE-REACHED: Emitted when the max requested page number is reached.
  • NO-RECORD-FOUND: Emitted when no records are found for the given query criteria.
  • END-OF-QUERY_REACHED: Emitted when all available records are scanned.
  • COMPLETED: Emitted when the data fetch ahead of rows is completed.
  • CANCELED: Emitted when a query is canceled.

The following is a response example that provides status information about all tokens. In this example, one token is in the active queue and one token is in the completed queue. For the token in the active queue, the first page is requested. For the token in the completed queue, 353 rows of data have been downloaded.


{
    "active": [
        
            "accumulate": 0,
            "activity_tracker": {
                "elapsed_time": "0:00:04.259198",
                "initated_time": "2019-05-02 10:39:36.560855",
                "last_activity": "2019-05-02 10:39:36.809429"
            },
            "message": null,
            "metric": null,
            "query_config": {
                "filter_params": {
                    "fromDate": "2018-01-26 00:00:00",
                    "toDate": "2020-07-02 00:00:00"
                },
                "object_name": "RPRO_BI3_RC_SCHD_V"
            },
            "status": "ADDED-TO-QUEUE",
            "task_id": "64ba53fb-99e2-464b-b60f-af0b9ac5aff4"
        
    ],
    "completed": [
        
            "accumulate": 353,
            "activity_tracker": {
                "elapsed_time": "0:00:29.915065",
                "initated_time": "2019-05-02 10:38:48.968783",
                "last_activity": "2019-05-02 10:39:11.152693"
            },
            "message": null,
            "metric": 3,
            "query_config": {
                "filter_params": {
                    "fromDate": "2018-01-26 00:00:00",
                    "toDate": "2020-07-02 00:00:00"
                },
                "object_name": "RPRO_BI3_RC_SCHD_V"
            },
            "status": "COMPLETED",
            "task_id": "10a54c58-7327-4966-99a7-da9763708e0f"
        
    ],
    "draining": [],
    "stale": []
}