Skip to content

Commit 8dc580d

Browse files
authored
Merge branch 'uber-go:master' into expose-history
2 parents 91c76d4 + 9909396 commit 8dc580d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

internal/common/metrics/constants.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,7 @@ const (
114114
MemoryUsedHeap = CadenceMetricsPrefix + "memory-used-heap"
115115
MemoryUsedStack = CadenceMetricsPrefix + "memory-used-stack"
116116
NumGoRoutines = CadenceMetricsPrefix + "num-go-routines"
117+
118+
ConcurrentTaskQuota = CadenceMetricsPrefix + "concurrent-task-quota"
119+
ConcurrentTaskRunning = CadenceMetricsPrefix + "concurrent-task-running"
117120
)

internal/internal_worker_base.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ func (bw *baseWorker) runPoller() {
248248
case <-bw.shutdownCh:
249249
return
250250
case <-bw.pollerRequestCh:
251+
bw.metricsScope.Gauge(metrics.ConcurrentTaskQuota).Update(float64(cap(bw.pollerRequestCh)))
252+
bw.metricsScope.Gauge(metrics.ConcurrentTaskRunning).Update(float64(cap(bw.pollerRequestCh) - len(bw.pollerRequestCh)))
251253
if bw.sessionTokenBucket != nil {
252254
bw.sessionTokenBucket.waitForAvailableToken()
253255
}

0 commit comments

Comments
 (0)