influxdata / influxdb-csharp

A .NET library for efficiently sending points to InfluxDB 1.x
Apache License 2.0
199 stars 60 forks source link

Sampling support for counter metrics (i.e. aggregate values within a sampling interval) #9

Open nblumhardt opened 8 years ago

nblumhardt commented 8 years ago

If multiple Count() calls increment the same measurement in the sampling interval, these should be aggregated into single values before sending.

bnayae commented 6 years ago

I'm considering to contribute this functionality. My thoughts are:

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:

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.

LordMike commented 6 years ago

This is related to #46, as I assume that if Increments were grouped together in the 100ns buckets that DateTime can provide, data wouldn't have been lost?

bnayae commented 6 years ago

TNX, I will check the #46 status

cypressious commented 6 years ago

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.

cypressious commented 6 years ago

I went ahead and drafted the feature in #55. Please take a look.

nblumhardt commented 6 years ago

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?