From 2e556dd0f1dd48252e6874753e33e5be7947eae1 Mon Sep 17 00:00:00 2001 From: Alexandros Filios Date: Mon, 26 Aug 2024 14:58:05 +0200 Subject: [PATCH] fix metric check Signed-off-by: Alexandros Filios --- integration/token/fungible/support.go | 6 +++--- integration/token/fungible/tests.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/integration/token/fungible/support.go b/integration/token/fungible/support.go index bcc56beb8..07fe2d24a 100644 --- a/integration/token/fungible/support.go +++ b/integration/token/fungible/support.go @@ -1130,7 +1130,7 @@ func CheckLocalMetrics(ii *integration.Infrastructure, user string, viewName str Expect(metrics).NotTo(BeEmpty()) var sum float64 - for _, m := range metrics[user+"_fsc_view_operations"].GetMetric() { + for _, m := range metrics["fsc_view_operations"].GetMetric() { for _, labelPair := range m.Label { if labelPair.GetName() == "view" && labelPair.GetValue() == viewName { sum += m.Counter.GetValue() @@ -1142,11 +1142,11 @@ func CheckLocalMetrics(ii *integration.Infrastructure, user string, viewName str Expect(sum).NotTo(BeZero()) } -func CheckPrometheusMetrics(ii *integration.Infrastructure, user, viewName string) { +func CheckPrometheusMetrics(ii *integration.Infrastructure, viewName string) { cli, err := ii.NWO.PrometheusAPI() Expect(err).To(BeNil()) metric := model.Metric{ - "__name__": model.LabelValue(user + "_fsc_view_operations"), + "__name__": model.LabelValue("fsc_view_operations"), "view": model.LabelValue(viewName), } val, warnings, err := cli.Query(context.Background(), metric.String(), time.Now()) diff --git a/integration/token/fungible/tests.go b/integration/token/fungible/tests.go index 0601c0e9e..2c5209b90 100644 --- a/integration/token/fungible/tests.go +++ b/integration/token/fungible/tests.go @@ -1076,7 +1076,7 @@ func TestStressSuite(network *integration.Infrastructure, auditorId string, sele }})) CheckLocalMetrics(network, "alice", "github.com/hyperledger-labs/fabric-token-sdk/integration/token/fungible/views/BalanceView") - CheckPrometheusMetrics(network, "alice", "github.com/hyperledger-labs/fabric-token-sdk/integration/token/fungible/views/BalanceView") + CheckPrometheusMetrics(network, "github.com/hyperledger-labs/fabric-token-sdk/integration/token/fungible/views/BalanceView") } func TestStress(network *integration.Infrastructure, auditorId string, selector *token3.ReplicaSelector) {