Skip to content

Commit 86ba85d

Browse files
authored
Merge branch 'master' into 1.1.0
2 parents 1bc399a + e18e46c commit 86ba85d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

internal/common/metrics/constants.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,6 @@ const (
115115
MemoryUsedStack = CadenceMetricsPrefix + "memory-used-stack"
116116
NumGoRoutines = CadenceMetricsPrefix + "num-go-routines"
117117

118-
ConcurrentTaskQuota = CadenceMetricsPrefix + "concurrent-task-quota"
119-
ConcurrentTaskRunning = CadenceMetricsPrefix + "concurrent-task-running"
118+
ConcurrentTaskQuota = CadenceMetricsPrefix + "concurrent-task-quota"
119+
PollerRequestBufferUsage = CadenceMetricsPrefix + "poller-request-buffer-usage"
120120
)

internal/internal_worker_base.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,9 @@ func (bw *baseWorker) runPoller() {
253253
return
254254
case <-bw.pollerRequestCh:
255255
bw.metricsScope.Gauge(metrics.ConcurrentTaskQuota).Update(float64(cap(bw.pollerRequestCh)))
256-
bw.metricsScope.Gauge(metrics.ConcurrentTaskRunning).Update(float64(cap(bw.pollerRequestCh) - len(bw.pollerRequestCh)))
256+
// This metric is used to monitor how many poll requests have been allocated
257+
// and can be used to approximate number of concurrent task running (not pinpoint accurate)
258+
bw.metricsScope.Gauge(metrics.PollerRequestBufferUsage).Update(float64(cap(bw.pollerRequestCh) - len(bw.pollerRequestCh)))
257259
if bw.sessionTokenBucket != nil {
258260
bw.sessionTokenBucket.waitForAvailableToken()
259261
}

0 commit comments

Comments
 (0)