skip to main content
Corticon Server: Integration & Deployment Guide : Corticon API reference : REST Management API : Summary of REST methods for management of Decision Services : API Retrieve Metrics
 

Try Corticon Now
API Retrieve Metrics
<base>/server/metrics
HTTP POST
Retrieves metrics for the server. The request can pass in a Decision Service (or a list of Decision Services as an array), and a timestamp showing when the windowed metrics will begin. If the JSON object does not contain any Decision Service, metrics are returned for all the Decision Services in the server along with the server metrics. See Windowed Metrics for more information. The object is formatted as follows:
{
"timestamp" : <timestamp for metrics in milliseconds since Unix Epoch in GMT timezone>,
"decisionServices" : <Decision Services that you want the metrics for,
if this list is not provided then metrics for all Decision Services
will be provided>
[
{
"name" : <Name of Decision Service we want metrics for>,
"majorVersion" : <Major version of Decision Service we want metrics for>,
"minorVersion" : <Minor Version of Decision Service we want metrics for>
},
...
]
}
The responses are formatted as shown:
{
"decisionServices" :
[
{
"name" : <Name of the Decision Service these metrics belong to>,
"majorVersion" : <Major Version of the Decision Service these metrics belong to>,
"minorVersion" : <Minor Version of the Decision Service these metrics belong to>,
"totalExecutionTime" : <The total execution time, in milliseconds,
for this Decision Service since it was added to the server >,
"totalNumberOfExecutions" : <Total number of executions for this Decision Service
since it was added to the server>,
"window" :
[
{
"timestamp" : <The timestamp of this metrics window, in milliseconds
since the UNIX Epoch in the GMT timezone>,
"totalIntervalExecutionTime" : <The total execution time ,in milliseconds,
for this metrics window >,
"totalIntervalNumberOfExecutions" : <The total number of executions
for this metrics window>
},
...
]
},
...
],
"serverMetrics" :
{
"totalExecutionTime" : <UTC timer format showing the total execution time for all
Decision Services deployed on this server since it was created>,
"totalNumberOfExecutions" : <Total number of executions for all
Decision Services deployed on this server since it was created>,
"window" :
[
{
"timestamp" : <The timestamp of this metrics window in milliseconds
since the UNIX Epoch in the GMT timezone>,
"memoryUsage" : <Memory usage for this window in bytes>,
"totalIntervalExecutionTime" : <The total execution time, in milliseconds,
for this metrics window >,
"totalIntervalNumberOfExecutions" : <The total number of executions
for this metrics window>
},
...
]
},
"error" : <This object will only be added if an error was encountered
while processing the request>
{...}
}
In the event of an error, the API attempts to return a partial answer, and adds an error object to the returned object. The error object (shown above) is added to the response object, and the HTTP response code is set accordingly.
Success status codes:
*200 OK
*206 Partial Content (where non-failing errors were encountered while processing the request)
Error status codes:
*400 Bad Request
*500 Internal Server Error