Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build experimental gauge_agg #375

Closed
epgts opened this issue Mar 23, 2022 · 0 comments
Closed

Build experimental gauge_agg #375

epgts opened this issue Mar 23, 2022 · 0 comments
Labels
proposed-feature A proposed feature or function to ease a task

Comments

@epgts
Copy link
Contributor

epgts commented Mar 23, 2022

Issue #9 proposes counter_agg and gauge_agg, but only counter_agg is implemented.

Next step is to implement toolkit_experimental.gauge_agg and some associated functions. After we gather feedback and ensure the implementation meets users' needs, we'll move it out of experimental (for which we'll file a separate issue).

For this initial implementation, we offer the following functionality:

toolkit_experimental.gauge_agg(ts TIMESTAMPTZ, value DOUBLE PRECISION)
toolkit_experimental.gauge_agg(ts TIMESTAMPTZ, value DOUBLE PRECISION, bounds TSTZRANGE)
toolkit_experimental.rollup(gs toolkit_experimental.GaugeSummary)
toolkit_experimental.idelta_left(gs toolkit_experimental.GaugeSummary)
toolkit_experimental.idelta_right(gs toolkit_experimental.GaugeSummary)
@epgts epgts added the proposed-feature A proposed feature or function to ease a task label Mar 23, 2022
epgts added a commit that referenced this issue Mar 23, 2022
The primary difference between a counter and a gauge is that counters
only increase, so apparent decreases are treated as resets followed by
continued increments from the pre-reset value.

To facilitate this, we move the reset accounting into a new
`CounterSummaryBuilder` and add a `GaugeSummaryBuilder` which does not
handle resets specially.

Functions:
- delta
- idelta_left
- idelta_right
- rollup

Also expand counter_agg's minimal tests just a bit.  Both aggregates
still need much more thorough testing.

TODO:
- consider deeper changes to `CounterSummary` and its Builders to
  protect invariants (currently bug-prone as innards are exposed)

Resolves issue #375.
epgts added a commit that referenced this issue Mar 25, 2022
The primary difference between a counter and a gauge is that counters
only increase, so apparent decreases are treated as resets followed by
continued increments from the pre-reset value.

To facilitate this, we move the reset accounting into a new
`CounterSummaryBuilder` and add a `GaugeSummaryBuilder` which does not
handle resets specially.

Functions:
- delta
- idelta_left
- idelta_right
- rollup

Also expand counter_agg's minimal tests just a bit.  Both aggregates
still need much more thorough testing.

TODO:
- consider deeper changes to `CounterSummary` and its Builders to
  protect invariants (currently bug-prone as innards are exposed)

Resolves issue #375.
bors bot added a commit that referenced this issue Mar 28, 2022
369: Add prototype gauge_agg and a few functions. r=epgts a=epgts

The primary difference between a counter and a gauge is that counters
only increase, so apparent decreases are treated as resets followed by
continued increments from the pre-reset value.

To facilitate this, we move the reset accounting into a new
`CounterSummaryBuilder` and add a `GaugeSummaryBuilder` which does not
handle resets specially.

Functions:
- delta
- idelta_left
- idelta_right
- rollup

Also expand counter_agg's minimal tests just a bit.  Both aggregates
still need much more thorough testing.

TODO:
- consider deeper changes to `CounterSummary` and its Builders to
  protect invariants (currently bug-prone as innards are exposed)

Resolves issue #375.

Co-authored-by: Eric Gillespie <epg@timescale.com>
@epgts epgts closed this as completed Mar 30, 2022
@epgts epgts mentioned this issue Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposed-feature A proposed feature or function to ease a task
Projects
None yet
Development

No branches or pull requests

1 participant