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

Method String

model/value.go:60–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58}
59
60func (s Sample) String() string {
61 if s.Histogram != nil {
62 return fmt.Sprintf("%s => %s", s.Metric, SampleHistogramPair{
63 Timestamp: s.Timestamp,
64 Histogram: s.Histogram,
65 })
66 }
67 return fmt.Sprintf("%s => %s", s.Metric, SamplePair{
68 Timestamp: s.Timestamp,
69 Value: s.Value,
70 })
71}
72
73// MarshalJSON implements json.Marshaler.
74func (s Sample) MarshalJSON() ([]byte, error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected