kit icon indicating copy to clipboard operation
kit copied to clipboard

Add test for cloudwatch2 counter that demonstrates

Open bernata opened this issue 1 year ago • 1 comments

potential slice bug with label-values. Label-values are stored in a Counter as a string slice and copyied over to a new Counter when With(lvs ...string) is invoked. The slice bug can present when the same Counter is copied twice with With() and each invocation does not resize the capacity of the slice.

bernata avatar Jul 19 '24 01:07 bernata

Hi @peterbourgon - thank you for contributing gokit; and all your contributions on advocating gokit and its surroundings [go, elegant design]. I wanted to get your thoughts on this test which I believe demonstrates a slice bug in some of the metrics Counter structures when the slice is not resized and two Counters refer to the same backing memory. Always using a new slice i think is the most straightforward fix. When you have a moment, it would be great to get your thoughts on this. Thank you again.

bernata avatar Jul 19 '24 01:07 bernata