MCPcopy
hub / github.com/grafana/tempo / validate

Method validate

pkg/traceql/engine_metrics_compare.go:319–340  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

317}
318
319func (m *MetricsCompare) validate() error {
320 err := m.f.validate()
321 if err != nil {
322 return err
323 }
324
325 if m.topN <= 0 {
326 return fmt.Errorf("compare() top number of values must be integer greater than 0")
327 }
328
329 if m.start == 0 && m.end == 0 {
330 return nil
331 }
332
333 if m.start <= 0 || m.end <= 0 {
334 return fmt.Errorf("compare() timestamps must be positive integer unix nanoseconds")
335 }
336 if m.end <= m.start {
337 return fmt.Errorf("compare() end timestamp must be greater than start timestamp")
338 }
339 return nil
340}
341
342func (m *MetricsCompare) String() string {
343 return "compare(" + m.f.String() + "}"

Callers

nothing calls this directly

Calls 1

validateMethod · 0.65

Tested by

no test coverage detected