influxdata / influxdb-csharp

A .NET library for efficiently sending points to InfluxDB 1.x

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reduce allocations for single point emission

cypressious opened this issue · comments

Most of the time, points are collected one by one by using one of the public methods of MetricsCollector. For every collected point however, an array has to be allocated because all the points go through the IPointEmitter.Emit(PointData[] points) method.

I propose to add a method virtual Emit(PointData point) to MetricsCollector that can be overriden by subclasses. The default implementation can simply delegate to the array accepting method.