Skip to content

Commit

Permalink
OM86 - review feedback
Browse files Browse the repository at this point in the history
removed - re-repl hist command
modified the for loop
removed unnecessary comments
  • Loading branch information
mphanias committed Nov 29, 2023
1 parent abf7d90 commit a8ea04c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 3 additions & 6 deletions watcher_latency.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ func (lw *LatencyWatcher) refresh(o *Observer, infoKeys []string, rawMetrics map
}

// loop all the latency infokeys
for ik := range infoKeys {
err := parseSingleLatenciesKey(infoKeys[ik], rawMetrics, allowedLatenciesList, blockedLatenciessList, ch)
for _, infoKey := range infoKeys {
err := parseSingleLatenciesKey(infoKey, rawMetrics, allowedLatenciesList, blockedLatenciessList, ch)
if err != nil {
return err
}
Expand Down Expand Up @@ -130,10 +130,7 @@ func isStatLatencyHistRelated(stat string) bool {
func (lw *LatencyWatcher) getLatenciesCommands(rawMetrics map[string]string) []string {
var commands = []string{"latencies:"}

// below latency-command are added to the auto-enabled list, i.e. latencies: command
// re-repl is auto-enabled, but not coming as part of latencies: list, hence we are adding it explicitly
//
// Hashmap content format := namespace-<histogram-key> = <0/1>
// Hashmap content format := namespace-<histogram-key> = <histogram-key>
for latencyHistName := range LatencyBenchmarks {
histTokens := strings.Split(latencyHistName, "-")

Expand Down
4 changes: 2 additions & 2 deletions watcher_namespaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ func (nw *NamespaceWatcher) refreshNamespaceStats(singleInfoKey string, infoKeys
LatencyBenchmarks[nsName+"-"+stat] = stat
}
}
// append default re-repl, as this auto-enabled, but not coming as part of latencies, we need this as namespace is available only here
LatencyBenchmarks[nsName+"-latency-hist-re-repl"] = "{" + nsName + "}-re-repl"

}
// // append default re-repl, as this auto-enabled, but not coming as part of latencies, we need this as namespace is available only here
// LatencyBenchmarks[nsName+"-latency-hist-re-repl"] = "{" + nsName + "}-re-repl"

}

Expand Down

0 comments on commit a8ea04c

Please sign in to comment.