Skip to content

Commit b30979c

Browse files
committed
Address comments on PR
Signed-off-by: Stuti Biyani <[email protected]>
1 parent 13445d9 commit b30979c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

go/vt/vttablet/tabletserver/querythrottler/query_throttler.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939
)
4040

4141
const (
42-
_queryThrottleAppName = "QueryThrottler"
42+
_queryThrottlerAppName = "QueryThrottler"
4343
// defaultPriority is the default priority value when none is specified
4444
defaultPriority = 100 // sqlparser.MaxPriorityValue
4545
)
@@ -79,10 +79,10 @@ func NewQueryThrottler(ctx context.Context, throttler *throttle.Throttler, cfgLo
7979
strategy: &registry.NoOpStrategy{}, // default strategy until config is loaded
8080
env: env,
8181
stats: Stats{
82-
requestsTotal: env.Exporter().NewCountersWithMultiLabels(_queryThrottleAppName+"Requests", "query throttler requests", []string{"strategy", "workload", "priority"}),
83-
requestsThrottled: env.Exporter().NewCountersWithMultiLabels(_queryThrottleAppName+"Throttled", "query throttler requests throttled", []string{"strategy", "workload", "priority", "metric_name", "metric_value", "dry_run"}),
84-
totalLatency: env.Exporter().NewMultiTimings(_queryThrottleAppName+"TotalLatencyNs", "Total latency of QueryThrottler.Throttle in nanoseconds", []string{"strategy", "workload", "priority"}),
85-
evaluateLatency: env.Exporter().NewMultiTimings(_queryThrottleAppName+"EvaluateLatencyNs", "Latency from Throttle entry to completion of Evaluate in nanoseconds", []string{"strategy", "workload", "priority"}),
82+
requestsTotal: env.Exporter().NewCountersWithMultiLabels(_queryThrottlerAppName+"Requests", "query throttler requests", []string{"Strategy", "Workload", "Priority"}),
83+
requestsThrottled: env.Exporter().NewCountersWithMultiLabels(_queryThrottlerAppName+"Throttled", "query throttler requests throttled", []string{"Strategy", "Workload", "Priority", "MetricName", "MetricValue", "DryRun"}),
84+
totalLatency: env.Exporter().NewMultiTimings(_queryThrottlerAppName+"TotalLatencyNs", "Total time each request takes in query throttling including evaluation, metric checks, and other overhead (nanoseconds)", []string{"Strategy", "Workload", "Priority"}),
85+
evaluateLatency: env.Exporter().NewMultiTimings(_queryThrottlerAppName+"EvaluateLatencyNs", "Time each request takes to make the throttling decision (nanoseconds)", []string{"Strategy", "Workload", "Priority"}),
8686
},
8787
}
8888

go/vt/vttablet/tabletserver/querythrottler/query_throttler_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,10 @@ func TestQueryThrottler_DryRunMode(t *testing.T) {
273273
strategy: mockStrategy,
274274
env: env,
275275
stats: Stats{
276-
requestsTotal: env.Exporter().NewCountersWithMultiLabels(_queryThrottleAppName+"Requests", "TestThrottler requests", []string{"strategy", "workload", "priority"}),
277-
requestsThrottled: env.Exporter().NewCountersWithMultiLabels(_queryThrottleAppName+"Throttled", "TestThrottler throttled", []string{"strategy", "workload", "priority", "metric_name", "metric_value", "dry_run"}),
278-
totalLatency: env.Exporter().NewMultiTimings(_queryThrottleAppName+"TotalLatencyMs", "Total latency of QueryThrottler.Throttle in milliseconds", []string{"strategy", "workload", "priority"}),
279-
evaluateLatency: env.Exporter().NewMultiTimings(_queryThrottleAppName+"EvaluateLatencyMs", "Latency from Throttle entry to completion of Evaluate in milliseconds", []string{"strategy", "workload", "priority"}),
276+
requestsTotal: env.Exporter().NewCountersWithMultiLabels(_queryThrottlerAppName+"Requests", "TestThrottler requests", []string{"strategy", "workload", "priority"}),
277+
requestsThrottled: env.Exporter().NewCountersWithMultiLabels(_queryThrottlerAppName+"Throttled", "TestThrottler throttled", []string{"strategy", "workload", "priority", "metric_name", "metric_value", "dry_run"}),
278+
totalLatency: env.Exporter().NewMultiTimings(_queryThrottlerAppName+"TotalLatencyMs", "Total latency of QueryThrottler.Throttle in milliseconds", []string{"strategy", "workload", "priority"}),
279+
evaluateLatency: env.Exporter().NewMultiTimings(_queryThrottlerAppName+"EvaluateLatencyMs", "Latency from Throttle entry to completion of Evaluate in milliseconds", []string{"strategy", "workload", "priority"}),
280280
},
281281
}
282282

0 commit comments

Comments
 (0)