SignalFx Developers Guide

timeshift()

Timeshifts each datapoint in the input stream, offsetting them by a specified time period. This lets you compare a metric time series with its own past behavior.

Syntax

timeshift(offset)

Table 1. Parameter definitions
Parameter Type Description

offset

Duration (number and duration units indicator: "s" = seconds, "m" = minutes, "h" = hours, "w" = weeks)

Duration to apply to each datapoint in the input stream, as a positive offset

Returns a reference to the input stream object

Examples

1
2
3
4
5
6
7
8
#Get all memory.utiliization time series timeshifted by 1 week
A = data('memory.utiliization').timeshift('7d')

#timeshift the calculation of cache hit rate by an hour
cache_hits = data('cache.hits')
cache_misses = data('cache.misses')
cache_rate = cache_hits / (cache_misses + cache_hits)
last_week = cache_rate.timeshift('1h')

© Copyright 2019 SignalFx.

Third-party license information