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

Method Metadata

tsdb/record/record.go:896–913  ·  view source on GitHub ↗

Metadata appends the encoded metadata to b and returns the resulting slice.

(metadata []RefMetadata, b []byte)

Source from the content-addressed store, hash-verified

894
895// Metadata appends the encoded metadata to b and returns the resulting slice.
896func (*Encoder) Metadata(metadata []RefMetadata, b []byte) []byte {
897 buf := encoding.Encbuf{B: b}
898 buf.PutByte(byte(Metadata))
899
900 for _, m := range metadata {
901 buf.PutUvarint64(uint64(m.Ref))
902
903 buf.PutByte(m.Type)
904
905 buf.PutUvarint(2) // num_fields: We currently have two more metadata fields, UNIT and HELP.
906 buf.PutUvarintStr(unitMetaName)
907 buf.PutUvarintStr(m.Unit)
908 buf.PutUvarintStr(helpMetaName)
909 buf.PutUvarintStr(m.Help)
910 }
911
912 return buf.Get()
913}
914
915// EncodeLabels encodes the contents of labels into buf.
916func EncodeLabels(buf *encoding.Encbuf, lbls labels.Labels) {

Callers 6

logMethod · 0.95
populateTestWLFunction · 0.95
TestRecord_EncodeDecodeFunction · 0.95
TestRecord_CorruptedFunction · 0.95
TestRecord_TypeFunction · 0.95
TestCheckpointFunction · 0.95

Calls 5

PutByteMethod · 0.95
PutUvarint64Method · 0.95
PutUvarintMethod · 0.95
PutUvarintStrMethod · 0.95
GetMethod · 0.95

Tested by 5

populateTestWLFunction · 0.76
TestRecord_EncodeDecodeFunction · 0.76
TestRecord_CorruptedFunction · 0.76
TestRecord_TypeFunction · 0.76
TestCheckpointFunction · 0.76