Thank you for your feedback.
Form temporarily unavailable. Please try again or contact to submit your comments.

Analyze time series data

Log in to subscribe to topics and get notified when content changes.

Analyze time series data

Use JavaScript or REST APIs to extract time series data from the MetricBase database, and to run transforms on the data.

For information on the MetricBase REST APIs see the REST API Explorer on an instance with the MetricBase application installed, or see the Clotho Time Series API.

For information on the MetricBase JavaScript APIs, see Client, Data, DataBuilder, Transformer, TransformPart, TransformerResult.

To use MetricBase time series data in report visualizations, see Create time series reports from MetricBase data.

Example: Analyze time series data with the JavaScript APIs

This example is to get the average CPU percentage over the specified time for each XYZ computer.

// Query the cmdb_ci_computer table for the records for 
var gr = new GlideRecord('cmdb_ci_computer');

// Create a DataSelector object and specify the metric (cpu_percentage), 
// the transform (avg), and label (avg cpu)
var transform = new sn_clotho.Transformer(gr).addMetric(‘cpu_percentage').avg()

// Run the transform between startTime and endTime. 
// startTime and endTime are GlideDateTime 
var data = transform.execute(startTime, endTime);
var values = data[‘avg-cpu-percentage'].getValues();