How to navigate Warp 10 HOWTOs

how to navigate Warp 10 HOWTOs

Explore the basis of Warp 10™ and WarpScript™ across different concepts and snippets through this curated list of blog posts

Basic concepts

What is a Geo Time Series™ (GTS)?

A Geo Time Series™ (GTS) is a time series with a location associated with the value. For example, timestamp / latitude / longitude / elevation / value.

The Warp 10™ supported values are:

  • boolean (true/false)
  • long (ie: 1123456)
  • doubles (ie: 15.158)
  • strings
  • multivariates

Some metadata are associated with a GTS:

  • class name (ie: io.senx.temperature) which represents what is measured
  • labels: key/value pairs used to specify, for example, the data source (ie: {serial=123456,cutomerID=456789,unit=kelvin}). Labels are immutable during the lifetime of the series.
  • attributes are like labels, except they are mutable. (Warp 10™ does not keep track of changes)

It can be represented like that:

When you push data, use the "compact input format":
TS/LAT:LON/ELEV NAME{LABELS}{ATTRIBUTES} VALUE

When you fetch data, the output will be in JSON.

There could be some missing data for latitude, longitude, and elevation, this is supported by the platform (for example, while the GPS is not yet initialized).

How to manipulate GTS and data?

The way to manipulate GTS is to use the WarpScript™ language:

Data manipulation

Frameworks and utilities

Discover the essential frameworks.

  • Synchronize time between two or more GTS: BUCKETIZE
    • Get rid of the clock difference between my two sensors:
      [ $gts bucketizer.last NOW 5 m 0 ] BUCKETIZE
    • Downsample my series:
      [ $gts bucketizer.mean NOW 1 h 0 ] BUCKETIZE
    • Compute the average value over a period:
      [ $gts bucketizer.mean NOW 0 1 ] BUCKETIZE
  • Fill holes in my series (after a BUCKETIZE): FILL Interpolate between two values
  • Transform values or do a moving average: MAP
    • Convert from number to string:
      [ $gts mapper.tostring 0 0 0 ] MAP
    • Compute a moving average:
      [ $gts mapper.mean 0 1 0 ] MAP
    • Compute the delta:
      [ $gts mapper.delta 0 1 0 ] MAP
  • Filter GTS according to some criteria: FILTER
    • Keep only GTS with a given label:
      [ $gts [] { 'myLabel' '~abc.*' } filter.bylabels ] FILTER
      [ $gts [] { 'myLabel' '=123' } filter.bylabels ] FILTER
    • Keep only GTS wich last value is greater than 10 and dispatch the result by a given label:
      [ $gts [ 'myLabel' ] 10 filter.last.gt ] FILTER
    • Keep only GTS with values: NONEMPTY
      $gts NONEMPTY
  • Compute GTS together: REDUCE (tips & tricks: use BUCKETIZE before)
    • Operation on 2 GTS values: use standard operators. You will lose the latitude and longitude.
      $gts1 $gts2 *
    • Operation on 2 or more GTS with aligned timestamps:
      [ $gtsList [] reducer.sum ] REDUCE
    • Count data point per timestamp and per a given label's value:
      [ $gtsList [ 'myLabel' ] reducer.count ] REDUCE

Usual manipulation functions

Dataviz tricks

  • Compute a histogram of values with VALUEHISTOGRAM to feed a pie in your dataviz for example.
  • Use LTTB to reduce the number of data points to be displayed
  • Use WarpView to build quickly a dashboard.

Share