MCPcopy Index your code
hub / github.com/prometheus/prometheus / Varint64

Method Varint64

tsdb/encoding/encoding.go:219–236  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

217}
218
219func (d *Decbuf) Varint64() int64 {
220 if d.E != nil {
221 return 0
222 }
223 // Decode as unsigned first, since that's what the varint library implements.
224 ux, n := varint.Uvarint(d.B)
225 if n < 1 {
226 d.E = ErrInvalidSize
227 return 0
228 }
229 // Now decode "ZigZag encoding" https://developers.google.com/protocol-buffers/docs/encoding#signed_integers.
230 x := int64(ux >> 1)
231 if ux&1 != 0 {
232 x = ^x
233 }
234 d.B = d.B[n:]
235 return x
236}
237
238func (d *Decbuf) Uvarint64() uint64 {
239 if d.E != nil {

Callers 13

TombstonesMethod · 0.95
SeriesMethod · 0.95
DecodeFunction · 0.95
samplesV1Method · 0.80
samplesV2Method · 0.80
readSTMarkerFunction · 0.80
ExemplarsFromBufferMethod · 0.80
histogramSamplesV1Method · 0.80
histogramSamplesV2Method · 0.80
DecodeHistogramFunction · 0.80

Calls 1

UvarintMethod · 0.80

Tested by

no test coverage detected