influxdb-csharp icon indicating copy to clipboard operation
influxdb-csharp copied to clipboard

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

Open nblumhardt opened this issue 8 years ago • 6 comments

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

nblumhardt avatar Apr 19 '16 02:04 nblumhardt

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.

bnayae avatar Mar 07 '18 11:03 bnayae

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?

LordMike avatar Mar 16 '18 10:03 LordMike

TNX, I will check the #46 status

bnayae avatar Mar 19 '18 08:03 bnayae

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 avatar Apr 27 '18 10:04 cypressious

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

cypressious avatar Apr 27 '18 15:04 cypressious

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?

nblumhardt avatar May 15 '18 22:05 nblumhardt