Skip to content

Commit

Permalink
fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
asiyani committed Dec 28, 2024
1 parent 8cc81fc commit f64972f
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ func Test_Collector(t *testing.T) {
# HELP component_received_events_total component_received_events_total
# TYPE component_received_events_total counter
component_received_events_total{l1="v1"} 10 1735054883000
component_received_events_total{l1="v1",l2="v2"} 20 1735054879000
component_received_events_total{l1="v1",l2="v2",l3="v3"} 30 1735054866000
component_received_events_total{l1="v1",l2="v2"} 20 1735054883000
component_received_events_total{l1="v1",l2="v2",l3="v3"} 30 1735054883000
# HELP component_received_event_bytes_total component_received_event_bytes_total
# TYPE component_received_event_bytes_total counter
component_received_event_bytes_total{l1="v1"} 1000 1735054883000
component_received_event_bytes_total{l1="v1"} 1000 1735054879000
component_received_event_bytes_total{l1="v1",l2="v2"} 2000 1735054879000
component_received_event_bytes_total{l1="v1",l2="v2",l3="v3"} 3000 1735054866000
component_received_event_bytes_total{l1="v1",l2="v2",l3="v3"} 3000 1735054879000
`

ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Expand All @@ -160,66 +160,66 @@ component_received_event_bytes_total{l1="v1",l2="v2",l3="v3"} 3000 1735054866000
[]string{"l4"},
`# HELP component_received_event_bytes_total component_received_event_bytes_total
# TYPE component_received_event_bytes_total counter
component_received_event_bytes_total{l1="v1"} 1000
component_received_event_bytes_total{l1="v1",l2="v2"} 2000
component_received_event_bytes_total{l1="v1",l2="v2",l3="v3"} 3000
component_received_event_bytes_total{l1="v1"} 1000 1735054879000
component_received_event_bytes_total{l1="v1",l2="v2"} 2000 1735054879000
component_received_event_bytes_total{l1="v1",l2="v2",l3="v3"} 3000 1735054879000
# HELP component_received_events_total component_received_events_total
# TYPE component_received_events_total counter
component_received_events_total{l1="v1"} 10
component_received_events_total{l1="v1",l2="v2"} 20
component_received_events_total{l1="v1",l2="v2",l3="v3"} 30
component_received_events_total{l1="v1"} 10 1735054883000
component_received_events_total{l1="v1",l2="v2"} 20 1735054883000
component_received_events_total{l1="v1",l2="v2",l3="v3"} 30 1735054883000
`,
},
{
"matching-one",
[]string{"l3"},
`# HELP component_received_event_bytes_total component_received_event_bytes_total
# TYPE component_received_event_bytes_total counter
component_received_event_bytes_total{l1="v1"} 1000
component_received_event_bytes_total{l1="v1",l2="v2"} 5000
component_received_event_bytes_total{l1="v1"} 1000 1735054879000
component_received_event_bytes_total{l1="v1",l2="v2"} 5000 1735054879000
# HELP component_received_events_total component_received_events_total
# TYPE component_received_events_total counter
component_received_events_total{l1="v1"} 10
component_received_events_total{l1="v1",l2="v2"} 50
component_received_events_total{l1="v1"} 10 1735054883000
component_received_events_total{l1="v1",l2="v2"} 50 1735054883000
`,
},
{
"matching-two",
[]string{"l2"},
`# HELP component_received_event_bytes_total component_received_event_bytes_total
# TYPE component_received_event_bytes_total counter
component_received_event_bytes_total{l1="v1"} 3000
component_received_event_bytes_total{l1="v1",l3="v3"} 3000
component_received_event_bytes_total{l1="v1"} 3000 1735054879000
component_received_event_bytes_total{l1="v1",l3="v3"} 3000 1735054879000
# HELP component_received_events_total component_received_events_total
# TYPE component_received_events_total counter
component_received_events_total{l1="v1"} 30
component_received_events_total{l1="v1",l3="v3"} 30
component_received_events_total{l1="v1"} 30 1735054883000
component_received_events_total{l1="v1",l3="v3"} 30 1735054883000
`,
},
{
"matching-all",
[]string{"l1"},
`# HELP component_received_event_bytes_total component_received_event_bytes_total
# TYPE component_received_event_bytes_total counter
component_received_event_bytes_total 1000
component_received_event_bytes_total{l2="v2"} 2000
component_received_event_bytes_total{l2="v2",l3="v3"} 3000
component_received_event_bytes_total 1000 1735054879000
component_received_event_bytes_total{l2="v2"} 2000 1735054879000
component_received_event_bytes_total{l2="v2",l3="v3"} 3000 1735054879000
# HELP component_received_events_total component_received_events_total
# TYPE component_received_events_total counter
component_received_events_total 10
component_received_events_total{l2="v2"} 20
component_received_events_total{l2="v2",l3="v3"} 30
component_received_events_total 10 1735054883000
component_received_events_total{l2="v2"} 20 1735054883000
component_received_events_total{l2="v2",l3="v3"} 30 1735054883000
`,
},
{
"multiple-labels",
[]string{"l2", "l3"},
`# HELP component_received_event_bytes_total component_received_event_bytes_total
# TYPE component_received_event_bytes_total counter
component_received_event_bytes_total{l1="v1"} 6000
component_received_event_bytes_total{l1="v1"} 6000 1735054879000
# HELP component_received_events_total component_received_events_total
# TYPE component_received_events_total counter
component_received_events_total{l1="v1"} 60
component_received_events_total{l1="v1"} 60 1735054883000
`,
},
}
Expand Down

0 comments on commit f64972f

Please sign in to comment.