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

Duration (number and duration units)
Durations are specified as a number followed by a single character:

  • s: seconds

  • m: minutes

  • h: hours

  • d: days

  • d: days

The default is None.

Returns a reference to the input stream object

Examples

1
2
3
4
5
6
7
8
#Get all memory.utilization time series timeshifted by 1 week
A = data('memory.utilization').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