OVH Guide

Analytics over Time Series

Leverage WarpScripts for Analytics

Working with counters

In IT monitoring, we're heavily working with counters. Linux's data, number of HTTP calls, and so on. With WarpScript, you can easily avoid counter resets and calculate rate.

How to detect counter resets and remove them

The RESETS functions compensates for possible counter resets by adding the last value before the rest to all values after the reset.

You just need to use the RESETS like this:

 [] FETCH        // Fetch your data
 FALSE RESETS    // compensates your counter if it was reset

Before:

reset

After:

reset

You can play with these example using Quantum: resets.

How to transform a counter into a rate

The mapper.rate function computes the rate of change between the first and last values (rate = (last - first) / (lastick - firsttick)) of each sliding window. The location and elevation returned are those associated with the most recent value in the sliding window.

Here's an example:

 [] FETCH                            // Fetch your data
 [ SWAP mapper.rate 1 0 0 ] MAP      // compute a rate on a sliding-window

Before:

reset

After:

reset

You can play with these example using Quantum: rate.

Detecting patterns

Patterns detection is easy using built-in functions:

  • PATTERNS is generating a list of motifs.
  • PATTERNDETECTION is running the list of motifs on all the time series you have.

Here's an example:

 [] FETCH 'gts' STORE
 [] FETCH 'pattern.to.detect' STORE

 32 'windowSize' STORE
 8 'patternLength' STORE
 16 'quantizationScale' STORE

 $pattern.to.detect 0 GET $windowSize $patternLength $quantizationScale PATTERNS VALUES 'patterns' STORE
 $gts $patterns $windowSize $patternLength $quantizationScale  PATTERNDETECTION

Before:

pattern

After:

pattern

You can play with these example using Quantum: pattern.

Working with annotations

Annotations are a powerful Warp10 features. You can enrich your graph with custom-crafted annotations such as:

  • new releases
  • crash
  • bug reporting
  • bugfix
  • anomalies

To use annotations, you just have to push the value as string into Metrics. Only Warp10 protocol allows to do it. You can also convert a serie into annotations by converting its values into string or boolean.

Here's an example using an outliers functions called ESDTEST:

pattern

To easily transform a GTS into an annotation, use mapper.toboolean or use mapper.tostring from the MAP framework.

You can play with these example using Quantum: outliers.

Interested in IoT? Learn how to .