Processes a named digest by batching history events and populating the relevant database tables and views. Only events added to the history since digestHistories was last called will be processed.
The default batch size is 250,000 events, which can be changed by setting the
When the digest runs, the started and finished properties are automatically updated.
This function is often used in an end point which can be called using a Scheduled Tasks. Where we have used digests to provide data for dashboards, the scheduled task generally calls the end point every five minutes.
Parameters
Name | Type | Description |
---|---|---|
name | String, required | The name of the digest to process |
batchsize | Integer, optional | Defaults to 250,000 |
Returns
The response will indicate whether there is more work to do.
Name | Type | Description |
---|---|---|
allEventsProcessed | Boolean | Will be |
totalNewRowsCount | Integer | The number of new rows added by this operation |
totalValueCount | Integer | The number of new values added by this operation |
columns | Object | The columns processed by this operation |
columns.<digestname>.<columnname> | Object | Information about this column |
columns.<digestname>.<columnname>.valueCount | Integer | The number of new values added |
columns.<digestname>.<columnname>.cursorPosition | Integer | The current position in the history the digest has reached |
columns.<digestname>.<columnname>.allEventsProcessed | Boolean | Will be |
columns.<digestname>.<columnname>.newRowsCount | Integer | The number of new rows added |
Example
Request
function(params, credentials) {
let resp = this.callWorkerMethod("history", "digestHistories", {
"name": "exampledigest"
});
return resp;
}
Response
{
"id": 8,
"result": {
"totalValueCount": 603,
"columns": {
"exampledigest.started": {
"valueCount": 30,
"cursorPosition": 2963,
"allEventsProcessed": true,
"newRowsCount": 0
},
"exampledigest.all_descriptions": {
"valueCount": 151,
"cursorPosition": 2963,
"allEventsProcessed": true,
"newRowsCount": 30
},
"exampledigest.businesskey": {
"valueCount": 30,
"cursorPosition": 2963,
"allEventsProcessed": true,
"newRowsCount": 0
},
"exampledigest.first_response_time": {
"valueCount": 30,
"cursorPosition": 2963,
"allEventsProcessed": true,
"newRowsCount": 0
},
"exampledigest.all_descriptions.eventtime": {
"valueCount": 151,
"cursorPosition": 2963,
"allEventsProcessed": true,
"newRowsCount": 0
},
"exampledigest.all_descriptions.eventdescription": {
"valueCount": 151,
"cursorPosition": 2963,
"allEventsProcessed": true,
"newRowsCount": 0
},
"exampledigest.involved_users.involveduser": {
"valueCount": 60,
"cursorPosition": 2963,
"allEventsProcessed": true,
"newRowsCount": 0
},
"exampledigest.involved_users": {
"valueCount": 0,
"cursorPosition": 2963,
"allEventsProcessed": true,
"newRowsCount": 0
}
},
"allEventsProcessed": true,
"totalNewRowsCount": 30
},
"jsonrpc": "2.0"
}