From e15d2af3187554032f04be46b1c92ffb513ead64 Mon Sep 17 00:00:00 2001 From: Michael Kalantar Date: Thu, 9 Nov 2023 09:40:01 -0500 Subject: [PATCH] add package comment Signed-off-by: Michael Kalantar --- metrics/server.go | 23 ++++++++++------------- metrics/server_test.go | 4 ++-- storage/client/client.go | 1 + 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/metrics/server.go b/metrics/server.go index 84ef8f07a..fd93586cc 100644 --- a/metrics/server.go +++ b/metrics/server.go @@ -257,12 +257,11 @@ func getAbnDashboard(w http.ResponseWriter, r *http.Request) { if err != nil { log.Logger.Debugf("unable to compute summaried metrics over transactions for application %s (version %d; signature %s)", namespaceApplication, v, *signature) continue - } else { - entry.SummaryOverTransactions = append(entry.SummaryOverTransactions, &versionSummarizedMetric{ - Version: v, - SummarizedMetric: smT, - }) } + entry.SummaryOverTransactions = append(entry.SummaryOverTransactions, &versionSummarizedMetric{ + Version: v, + SummarizedMetric: smT, + }) smU, err := calculateSummarizedMetric(metrics.MetricsOverUsers) if err != nil { @@ -299,11 +298,10 @@ func getAbnDashboard(w http.ResponseWriter, r *http.Request) { if err != nil { log.Logger.Debugf("unable to compute histogram over transactions for application %s (metric %s)", namespaceApplication, metric) continue - } else { - resultEntry := result[metric] - resultEntry.HistogramsOverTransactions = &hT - result[metric] = resultEntry } + resultEntry := result[metric] + resultEntry.HistogramsOverTransactions = &hT + result[metric] = resultEntry } for metric, byVersion := range byMetricOverUsers { @@ -311,11 +309,10 @@ func getAbnDashboard(w http.ResponseWriter, r *http.Request) { if err != nil { log.Logger.Debugf("unable to compute histogram over users for application %s (metric %s)", namespaceApplication, metric) continue - } else { - resultEntry := result[metric] - resultEntry.HistogramsOverUsers = &hT - result[metric] = resultEntry } + resultEntry := result[metric] + resultEntry.HistogramsOverUsers = &hT + result[metric] = resultEntry } // convert to JSON diff --git a/metrics/server_test.go b/metrics/server_test.go index 1d1142a0a..ed78a45bf 100644 --- a/metrics/server_test.go +++ b/metrics/server_test.go @@ -619,7 +619,7 @@ func (cm *testRoutemaps) GetAllRoutemaps() controllers.RoutemapsInterface { func TestGetABNDashboard(t *testing.T) { testRM := testRoutemaps{ - allroutemaps: setupRoutemaps(t, *getTestRM("default", "test")), + allroutemaps: setupRoutemaps(*getTestRM("default", "test")), } allRoutemaps = &testRM @@ -795,7 +795,7 @@ func TestCalculateHistogram(t *testing.T) { } } -func setupRoutemaps(t *testing.T, initialroutemaps ...testroutemap) testroutemaps { +func setupRoutemaps(initialroutemaps ...testroutemap) testroutemaps { routemaps := testroutemaps{ nsRoutemap: make(map[string]testroutemapsByName), } diff --git a/storage/client/client.go b/storage/client/client.go index 1c2516f25..fb2430eed 100644 --- a/storage/client/client.go +++ b/storage/client/client.go @@ -1,3 +1,4 @@ +// Package client implements an implementation independent storage client package client import (