MCPcopy Create free account
hub / github.com/cortexproject/cortex / Audit

Method Audit

tools/query-audit/auditor.go:21–31  ·  view source on GitHub ↗

Audit audits two prometheus queries

(control, x model.Value)

Source from the content-addressed store, hash-verified

19
20// Audit audits two prometheus queries
21func (a *Auditor) Audit(control, x model.Value) (Diff, error) {
22 if x.Type() == model.ValMatrix && control.Type() == model.ValMatrix {
23 return a.auditMatrix(x.(model.Matrix), control.(model.Matrix))
24 }
25
26 if x.Type() == model.ValVector && control.Type() == model.ValVector {
27 return a.auditVector(x.(model.Vector), control.(model.Vector))
28 }
29
30 return Diff{}, errors.Errorf("unsupported types for equality: got %s & %s", control.Type().String(), x.Type().String())
31}
32
33func (a *Auditor) auditMatrix(x, y model.Matrix) (diff Diff, err error) {
34 // different # of returned series

Callers 1

RunFunction · 0.95

Calls 4

auditMatrixMethod · 0.95
auditVectorMethod · 0.95
TypeMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected