We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7618c56 commit abdfacfCopy full SHA for abdfacf
metrics-exporter-dogstatsd/src/writer.rs
@@ -88,8 +88,19 @@ impl PayloadWriter {
88
return false;
89
}
90
91
- // Track the new offset.
92
- self.offsets.push(self.buf.len());
+ // Offset update
+ if current_len + self.last_offset() <= self.max_payload_len {
93
+ // If the current metric can be written within the max_payload_len
94
+ // replace the last offset (if there is valid offset)
95
+ if let Some(last_offset) = self.offsets.last_mut() {
96
+ *last_offset = self.buf.len();
97
+ } else {
98
+ self.offsets.push(self.buf.len());
99
+ }
100
101
+ // - else add a new offset to send current metric in a new Packet
102
103
104
105
true
106
0 commit comments