# irate_left() and irate_right()

ToolkitTimescaleDB Toolkit functions are available under Timescale Community Edition. They are automatically included with Timescale Cloud. Click to learn more.The instantaneous rate of change of the counter at the left (earlier) and right (later) side of the time range.

For more information about counter aggregation functions, see the hyperfunctions documentation.

The instantaneous rate of change of the counter at the left (earlier) side of
the time range. Essentially, the `idelta_left`

divided by the duration between the
first and second observed points in the CounterSummary. This can be especially
useful for fast moving counters.

irate_left(summary CounterSummary) RETURNS DOUBLE PRECISION

Name | Type | Description |
---|---|---|

summary | CounterSummary | The input CounterSummary from a counter_agg call |

Name | Type | Description |
---|---|---|

irate_left | DOUBLE PRECISION | The instantaneous rate computed from the left (earlier) side of the CounterSummary |

SELECTid,bucket,irate_left(summary)FROM (SELECTid,time_bucket('15 min'::interval, ts) AS bucket,counter_agg(ts, val) AS summaryFROM fooGROUP BY id, time_bucket('15 min'::interval, ts)) t

The instantaneous rate of change of the counter at the right (later) side of the
time range. Essentially, the `idelta_right`

divided by the duration between the
first and second observed points in the CounterSummary. This can be especially
useful for fast moving counters.

irate_right(summary CounterSummary) RETURNS DOUBLE PRECISION

Name | Type | Description |
---|---|---|

summary | CounterSummary | The input CounterSummary from a counter_agg call |

Name | Type | Description |
---|---|---|

irate_right | DOUBLE PRECISION | The instantaneous rate computed from the right (later) side of the CounterSummary |

SELECTid,bucket,irate_right(summary)FROM (SELECTid,time_bucket('15 min'::interval, ts) AS bucket,counter_agg(ts, val) AS summaryFROM fooGROUP BY id, time_bucket('15 min'::interval, ts)) t

Found an issue on this page?

Report an issue!Keywords