Skip to content

Commit

Permalink
add package comment
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Kalantar <[email protected]>
  • Loading branch information
kalantar committed Nov 9, 2023
1 parent 12c5a45 commit e15d2af
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
23 changes: 10 additions & 13 deletions metrics/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -299,23 +298,21 @@ 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 {
hT, err := calculateHistogram(byVersion, 0, 0)
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
Expand Down
4 changes: 2 additions & 2 deletions metrics/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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),
}
Expand Down
1 change: 1 addition & 0 deletions storage/client/client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package client implements an implementation independent storage client
package client

import (
Expand Down

0 comments on commit e15d2af

Please sign in to comment.