Skip to content

Commit 19a78a9

Browse files
committed
lint, "test fail"
1 parent cc9e0db commit 19a78a9

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

.github/resources/slo-report-thresholds.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ metrics:
6666
direction: lower_is_better
6767
warning_max: 0.1
6868
critical_max: 1.0
69-
- pattern: "*_node_hints.misses*"
69+
- pattern: "*_node_hints_misses_total*"
7070
direction: lower_is_better
7171
critical_max: 0 # more than zero and node_hints workload fails

tests/slo/internal/metrics/metrics.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type (
4646
retriesSuccessTotal otelmetric.Int64Counter
4747
retriesFailureTotal otelmetric.Int64Counter
4848
pendingOperations otelmetric.Int64UpDownCounter
49-
nodeHintMissesPresent otelmetric.Int64Counter
49+
nodeHintMissesPresent otelmetric.Int64UpDownCounter
5050
}
5151
)
5252

@@ -202,7 +202,7 @@ func New(endpoint, ref, label, jobName string, reportPeriodMs int) (*Metrics, er
202202
if err != nil {
203203
return nil, fmt.Errorf("failed to create pendingOperations counter: %w", err)
204204
}
205-
m.nodeHintMissesPresent, err = m.meter.Int64Counter(
205+
m.nodeHintMissesPresent, err = m.meter.Int64UpDownCounter(
206206
"workload.node_hints.misses",
207207
otelmetric.WithDescription("Exclusively for node_hints SLO workload: Signals GRPC requests to wrong node"),
208208
)
@@ -262,9 +262,9 @@ func (m *Metrics) Start(name SpanName) Span {
262262
return j
263263
}
264264

265-
func (m *Metrics) ReportNodeHintMisses() {
265+
func (m *Metrics) ReportNodeHintMisses(val int64) {
266266
if m.meter != nil {
267-
m.nodeHintMissesPresent.Add(m.ctx, 1)
267+
m.nodeHintMissesPresent.Add(m.ctx, val)
268268
}
269269
}
270270

tests/slo/internal/workers/workers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ func NewWithBatch(cfg *config.Config, s BatchReadWriter, ref, label, jobName str
5858
}, nil
5959
}
6060

61-
func (w *Workers) ReportNodeHintMisses() {
61+
func (w *Workers) ReportNodeHintMisses(val int64) {
6262
if w.m != nil {
63-
w.m.ReportNodeHintMisses()
63+
w.m.ReportNodeHintMisses(val)
6464
}
6565
}
6666

tests/slo/native/node_hints/dynnode_traffic.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,5 +143,6 @@ func (e *Estimator) OnlyThisNode(ctx context.Context, nodeID uint32) error {
143143
e.NodeRequests[nodeID], nodeNow,
144144
)
145145
}
146+
146147
return nil
147148
}

tests/slo/native/node_hints/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ func main() {
114114
if err != nil {
115115
panic(fmt.Errorf("create workers failed: %w", err))
116116
}
117+
w.ReportNodeHintMisses(1)
117118
ns := s.nodeSelector.Load()
118119
idx, nodeID := ns.GetRandomNodeID(gen)
119120
log.Println("all requests to node id: ", nodeID)
@@ -150,7 +151,7 @@ func main() {
150151
defer ecancel()
151152
err = estimator.OnlyThisNode(ectx, nodeID)
152153
if err != nil {
153-
w.ReportNodeHintMisses()
154+
w.ReportNodeHintMisses(-1)
154155
time.Sleep(w.ExportInterval())
155156
}
156157
default:

0 commit comments

Comments
 (0)