MCPcopy
hub / github.com/grafana/k6 / AddMetricSamples

Method AddMetricSamples

output/helpers.go:22–29  ·  view source on GitHub ↗

AddMetricSamples adds the given metric samples to the internal buffer.

(samples []metrics.SampleContainer)

Source from the content-addressed store, hash-verified

20
21// AddMetricSamples adds the given metric samples to the internal buffer.
22func (sc *SampleBuffer) AddMetricSamples(samples []metrics.SampleContainer) {
23 if len(samples) == 0 {
24 return
25 }
26 sc.Lock()
27 sc.buffer = append(sc.buffer, samples...)
28 sc.Unlock()
29}
30
31// GetBufferedSamples returns the currently buffered metric samples and makes a
32// new internal buffer with some hopefully realistic size. If the internal

Callers 2

TestSampleBufferBasicsFunction · 0.95

Calls 2

UnlockMethod · 0.80
LockMethod · 0.45

Tested by 2

TestSampleBufferBasicsFunction · 0.76