influxdata / influxdata/kapacitor

How to reset “cumulativeSum” function?

Open
#1,675 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

My task is to accumulate values from some measure every seconds and reset that accumulated value to zero after hour.
I was trying below code but it was not successful.

stream
|from()
.database('srtdb')
.retentionPolicy('autogen')
.measurement('factory011')
.where(lambda: minute("time")!=0)
.groupBy('position')
|cumulativeSum('val')
.as('val')
|influxDBOut()
.database('srtdb')
.retentionPolicy('autogen')
.measurement('kuku12')

Contributor guide

Open the contributing guide

Research direction

Start with the cumulativeSum('val') pipeline entry point and inspect how the where(lambda: minute("time")!=0) condition interacts with grouped stream data. Check the Kapacitor behavior or tests for cumulativeSum and determine what an hourly reset should produce in the influxDBOut() measurement; the issue names no source file or test to run.

Written by the indexing model from the issue text.

Assessment

Domain
stream-processing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.