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

Function TestDoMetrics

cmd/tempo-vulture/main_test.go:799–829  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

797}
798
799func TestDoMetrics(t *testing.T) {
800 seed := time.Date(2008, 1, 1, 12, 0, 0, 0, time.UTC)
801 traceInfo := util.NewTraceInfo(seed, "test")
802
803 // Define the configuration
804 config := vultureConfiguration{
805 tempoOrgID: "orgID",
806 tempoWriteBackoffDuration: time.Second,
807 }
808
809 logger = zap.NewNop()
810
811 mockHTTPClient := &MockHTTPClient{
812 err: nil,
813 metricsResp: &tempopb.QueryRangeResponse{
814 Series: []*tempopb.TimeSeries{
815 {
816 Samples: []tempopb.Sample{
817 {
818 TimestampMs: seed.UnixMilli(),
819 Value: 1.0,
820 },
821 },
822 },
823 },
824 },
825 }
826
827 doMetrics(mockHTTPClient, config, traceInfo, logger)
828 assert.Equal(t, 1, mockHTTPClient.GetMetricsCount())
829}
830
831func TestRunCheckerWithNilTicker(t *testing.T) {
832 config := vultureConfiguration{

Callers

nothing calls this directly

Calls 4

GetMetricsCountMethod · 0.95
NewTraceInfoFunction · 0.92
doMetricsFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected