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

Method Equal

model/value.go:43–58  ·  view source on GitHub ↗

Equal compares first the metrics, then the timestamp, then the value. The semantics of value equality is defined by SampleValue.Equal.

(o *Sample)

Source from the content-addressed store, hash-verified

41// Equal compares first the metrics, then the timestamp, then the value. The
42// semantics of value equality is defined by SampleValue.Equal.
43func (s *Sample) Equal(o *Sample) bool {
44 if s == o {
45 return true
46 }
47
48 if !s.Metric.Equal(o.Metric) {
49 return false
50 }
51 if !s.Timestamp.Equal(o.Timestamp) {
52 return false
53 }
54 if s.Histogram != nil {
55 return s.Histogram.Equal(o.Histogram)
56 }
57 return s.Value.Equal(o.Value)
58}
59
60func (s Sample) String() string {
61 if s.Histogram != nil {

Callers 2

EqualMethod · 0.45
EqualMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected