@@ -23,6 +23,11 @@ public class DebuggerSink {
23
23
private static final long LOW_RATE_INITIAL_FLUSH_INTERVAL = 1000 ;
24
24
static final long LOW_RATE_STEP_SIZE = 200 ;
25
25
private static final String PREFIX = "debugger.sink." ;
26
+ private static final String DROPPED_REQ_METRIC = PREFIX + "dropped.requests" ;
27
+ private static final String UPLOAD_REMAINING_CAP_METRIC =
28
+ PREFIX + "upload.queue.remaining.capacity" ;
29
+ private static final String CURRENT_FLUSH_INTERVAL_METRIC = PREFIX + "current.flush.interval" ;
30
+ private static final String SKIP_METRIC = PREFIX + "skip" ;
26
31
27
32
private final ProbeStatusSink probeStatusSink ;
28
33
private final SnapshotSink snapshotSink ;
@@ -109,7 +114,7 @@ public SymbolSink getSymbolSink() {
109
114
public void addSnapshot (Snapshot snapshot ) {
110
115
boolean added = snapshotSink .addLowRate (snapshot );
111
116
if (!added ) {
112
- debuggerMetrics .count (PREFIX + "dropped.requests" , 1 );
117
+ debuggerMetrics .count (DROPPED_REQ_METRIC , 1 );
113
118
} else {
114
119
probeStatusSink .addEmitting (snapshot .getProbe ().getProbeId ());
115
120
}
@@ -120,7 +125,7 @@ public void addHighRateSnapshot(Snapshot snapshot) {
120
125
if (!added ) {
121
126
long dropped = highRateDropped .incrementAndGet ();
122
127
if (dropped % 100 == 0 ) {
123
- debuggerMetrics .count (PREFIX + "dropped.requests" , 100 );
128
+ debuggerMetrics .count (DROPPED_REQ_METRIC , 100 );
124
129
}
125
130
} else {
126
131
probeStatusSink .addEmitting (snapshot .getProbe ().getProbeId ());
@@ -151,9 +156,8 @@ void lowRateFlush(DebuggerSink ignored) {
151
156
}
152
157
153
158
private void reconsiderLowRateFlushInterval (DebuggerSink debuggerSink ) {
154
- debuggerMetrics .histogram (
155
- PREFIX + "upload.queue.remaining.capacity" , snapshotSink .remainingCapacity ());
156
- debuggerMetrics .histogram (PREFIX + "current.flush.interval" , currentLowRateFlushInterval );
159
+ debuggerMetrics .histogram (UPLOAD_REMAINING_CAP_METRIC , snapshotSink .remainingCapacity ());
160
+ debuggerMetrics .histogram (CURRENT_FLUSH_INTERVAL_METRIC , currentLowRateFlushInterval );
157
161
doReconsiderLowRateFlushInterval ();
158
162
}
159
163
@@ -225,7 +229,7 @@ private void reportError(ProbeId probeId, DiagnosticMessage msg) {
225
229
226
230
/** Notifies the snapshot was skipped for one of the SkipCause reason */
227
231
public void skipSnapshot (String probeId , SkipCause cause ) {
228
- debuggerMetrics .incrementCounter (PREFIX + "skip" , cause .tag (), "probe_id:" + probeId );
232
+ debuggerMetrics .incrementCounter (SKIP_METRIC , cause .tag (), "probe_id:" + probeId );
229
233
}
230
234
231
235
long getCurrentLowRateFlushInterval () {
0 commit comments