Skip to content

Commit

Permalink
Update InfluxDB task for tx count summarization
Browse files Browse the repository at this point in the history
  • Loading branch information
Agustin Godnic committed Aug 14, 2023
1 parent ced17eb commit 97e4dec
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions analytics/scripts/vaa_count_1h.flux
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import "date"

option task = {
name: "vaa_count grouped by hour",
every: 1h,
}

start = date.truncate(t: -1h, unit: 1h)
stop = date.truncate(t: now(), unit: 1h)
sourceBucket = "wormscan-30days"
destinationBucket = "wormscan"

from(bucket: sourceBucket)
|> range(start: start, stop: stop)
|> filter(fn: (r) => r["_measurement"] == "vaa_count")
|> group()
|> aggregateWindow(every: 1h, fn: count, createEmpty: true)
|> set(key: "_measurement", value: "vaa_count_1h")
|> to(bucket: destinationBucket, fieldFn: (r) => ({"count": r._value}))

0 comments on commit 97e4dec

Please sign in to comment.