Conversation
014aa77 to
e2955bd
Compare
To avoid numeric stability issues when computing it as sum/cnt.
StephenWakely
left a comment
There was a problem hiding this comment.
Looks good to me. Just have some very minor nits.
Another thought I had is, would it be a good idea to embed a version number into the payload. Or will we rely on the agent providing different endpoints for each version?
| * @return Builder instance. | ||
| */ | ||
| public ScalarMetric count(String name) { | ||
| ScalarMetric m = new ScalarMetric(this, 1, name); |
There was a problem hiding this comment.
Would it make sense to define the type as constants. It's not immediately apparent what the number 1 means here.
| } | ||
|
|
||
| void beginMetric(Metric m) { | ||
| endMetric(); |
There was a problem hiding this comment.
If there is a metric in progress at this stage, it would likely be because of a programmer error? Shouldn't we fail harder here so the error isn't overlooked?
| * @param name Name of the metric. | ||
| * @return New builder instance. | ||
| */ | ||
| public SketchMetric sketch(String name) { |
There was a problem hiding this comment.
Just a question, histograms and distributions have gone from the code, are they replaced by Sketches? Will this be deprecating histograms?
There was a problem hiding this comment.
We're not deprecating histograms, they are just not supported in this first version.
Sketches is the data type underpin dogstatsd distributions in the agent. Much like it happens in the agent, an aggregation component will be converting distribution samples into sketches (that this code will then serialize).
Add serializer implementation for new Dogstatsd HTTP-based protocol (for the server code, see DataDog/datadog-agent#45445).
This is more or less a verbatim translation of the intake v3 payload serializer), No compression is implemented, since payloads are expected to be sent primarily via the loopback interface. This the implementation a bit simpler, since only one payload size limit need to be observed.
The main entry point is in the
PayloadBuilderclass, and together withMetric,ScalarMetricandSketchMetricclasses it defines the public API.PayloadConsumeris used to stream A set ofBufferclasses provide growable arrays of primitives.