Skip to content

Commit

Permalink
feat:流水线/Job并发和排队数据落地 TencentBlueKing#10997
Browse files Browse the repository at this point in the history
  • Loading branch information
yongyiduan committed Oct 25, 2024
1 parent 062527c commit 4baa8dc
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,15 @@ class MetricsUserService @Autowired constructor(
labels = labels
)
local[key]?.meters?.add(buildGauge)
val buildStatusGauge = registerBuildStatusGauge(
projectId = projectId,
pipelineId = pipelineId,
buildId = buildId,
status = status,
description = "build status metrics for $buildId",
labels = labels
)
local[key]?.meters?.add(buildStatusGauge)
}

CallBackEvent.BUILD_START -> {
Expand All @@ -353,6 +362,7 @@ class MetricsUserService @Autowired constructor(
)
local[key]?.meters?.add(buildStatusGauge)
}

CallBackEvent.BUILD_JOB_QUEUE -> {
val buildJobGauge = registerBuildJobQueueGauge(
key = key,
Expand Down Expand Up @@ -450,6 +460,9 @@ class MetricsUserService @Autowired constructor(
metrics.meters.find { it.id.name == MetricsUserConfig.gaugeBuildQueueKey }?.run {
metricsCacheService.removeCache(key)
}
metrics.meters.find { it.id.name == MetricsUserConfig.gaugeBuildStatusKey }?.run {
metricsCacheService.removeCache(key)
}
}

CallBackEvent.BUILD_END -> {
Expand Down

0 comments on commit 4baa8dc

Please sign in to comment.