TimelessMetrics.Transform (timeless_metrics v6.0.14)

Copy Markdown View Source

Post-query value transforms for unit conversion.

Applied to aggregated values after bucketing. Useful for converting raw SNMP values (e.g. tenths of dBmV) to human-readable units.

Supported transforms

  • {:multiply, n} — multiply each value by n
  • {:divide, n} — divide each value by n
  • {:offset, n} — add n to each value
  • {:scale, multiplier, offset}value * multiplier + offset (e.g. Celsius to Fahrenheit)
  • {:log10} — base-10 logarithm (useful for RF power ratios)
  • nil — no transform (passthrough)

Summary

Functions

Apply a transform to a list of {timestamp, value} tuples.

Parse a transform string from HTTP params.

Parse a threshold filter string.

Functions

apply(data, arg2)

Apply a transform to a list of {timestamp, value} tuples.

parse(str)

Parse a transform string from HTTP params.

Examples

parse("divide:10")    #=> {:divide, 10.0}
parse("multiply:100") #=> {:multiply, 100.0}
parse("offset:-273")  #=> {:offset, -273.0}
parse("scale:1.8:32") #=> {:scale, 1.8, 32.0}
parse("log10")        #=> {:log10}
parse(nil)            #=> nil

parse_threshold(str)

Parse a threshold filter string.

Examples

parse_threshold("filter_gt:90")  #=> {:gt, 90.0}
parse_threshold("filter_lt:10")  #=> {:lt, 10.0}
parse_threshold(nil)             #=> nil