MCPcopy
hub / github.com/prometheus/prometheus / NewPromParser

Function NewPromParser

model/textparse/promparse.go:173–179  ·  view source on GitHub ↗

NewPromParser returns a new parser of the byte slice.

(b []byte, st *labels.SymbolTable, enableTypeAndUnitLabels bool)

Source from the content-addressed store, hash-verified

171
172// NewPromParser returns a new parser of the byte slice.
173func NewPromParser(b []byte, st *labels.SymbolTable, enableTypeAndUnitLabels bool) Parser {
174 return &PromParser{
175 l: &promlexer{b: append(b, '\n')},
176 builder: labels.NewScratchBuilderWithSymbolTable(st, 16),
177 enableTypeAndUnitLabels: enableTypeAndUnitLabels,
178 }
179}
180
181// Series returns the bytes of the series, the timestamp if set, and the value
182// of the current sample.

Callers 7

TestPromParseFunction · 0.85
TestUTF8PromParseFunction · 0.85
TestPromParseErrorsFunction · 0.85
TestPromNullByteHandlingFunction · 0.85
NewFunction · 0.85
benchParseFunction · 0.85

Calls 1

Tested by 6

TestPromParseFunction · 0.68
TestUTF8PromParseFunction · 0.68
TestPromParseErrorsFunction · 0.68
TestPromNullByteHandlingFunction · 0.68
benchParseFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…