MCPcopy Create free account
hub / github.com/prometheus/common / UnmarshalJSON

Method UnmarshalJSON

model/value_histogram.go:34–44  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

32}
33
34func (v *FloatString) UnmarshalJSON(b []byte) error {
35 if len(b) < 2 || b[0] != '"' || b[len(b)-1] != '"' {
36 return errors.New("float value must be a quoted string")
37 }
38 f, err := strconv.ParseFloat(string(b[1:len(b)-1]), 64)
39 if err != nil {
40 return err
41 }
42 *v = FloatString(f)
43 return nil
44}
45
46type HistogramBucket struct {
47 Boundaries int32

Callers

nothing calls this directly

Calls 1

FloatStringTypeAlias · 0.85

Tested by

no test coverage detected