influxdb-csharp
influxdb-csharp copied to clipboard
Sampling support for counter metrics (i.e. aggregate values within a sampling interval)
If multiple Count()
calls increment the same measurement in the sampling interval, these should be aggregated into single values before sending.
I'm considering to contribute this functionality. My thoughts are:
- sampling is good for Time
- aggregation is good for Increment Write and Measure may use non numeric fields, therefore less likely to be aggregate.
For both sampling and aggregation, it should group only measurements which have the same tags. Configuration can define IgnoreTag(string tag) in order to omit tags from the aggregation or sampling.
SAMPLING: can use different strategies:
- Take single event with-in a time-frame: this can be fine for lots of short time-frames, the statistics of big numbers should make it meaningful.
- Assign aggregation function like Min, Max, Mean, etc.. , this can be more accurate, but less performant. The API can let the user define the strategy at configuration time.
The aggregation and sampling client should be disposable in-order to flush the data on shutdown.
In any case this should be separate assembly which can extend the current functionality. It should be consume by different NuGet.
This is related to #46, as I assume that if Increment
s were grouped together in the 100ns buckets that DateTime
can provide, data wouldn't have been lost?
TNX, I will check the #46 status
Any updates on this feature? I'm transitioning to InfluxDB from a custom solution where we had something similar built in.
One note, sampling duration should not be the same as the batching duration. Because I might want to set the batching duration to a high value like 10 minutes but I want my increments only summed to 1 minute buckets.
I'm willing to contribute if @bnayae isn't planing to do it himself.
I went ahead and drafted the feature in #55. Please take a look.
Hi @influxdata/c-sharp /all,
@cypressious has been exploring this feature and is keen to work on an implementation 🎉
I'm not a great collaborator on this right now due to other commitments, but it is a substantial and challenging feature, so having other perspectives and help with it seems important.
Is anyone with experience in this library keen to help, or to shepherd the feature through via discussion/feedback/reviews?