diff --git a/src/backend/ci/core/stream/biz-stream/src/main/kotlin/com/tencent/devops/stream/trigger/StreamYamlBaseBuild.kt b/src/backend/ci/core/stream/biz-stream/src/main/kotlin/com/tencent/devops/stream/trigger/StreamYamlBaseBuild.kt index e45219ab496..6c9b3c0f850 100644 --- a/src/backend/ci/core/stream/biz-stream/src/main/kotlin/com/tencent/devops/stream/trigger/StreamYamlBaseBuild.kt +++ b/src/backend/ci/core/stream/biz-stream/src/main/kotlin/com/tencent/devops/stream/trigger/StreamYamlBaseBuild.kt @@ -341,7 +341,7 @@ class StreamYamlBaseBuild @Autowired constructor( gitRequestEventDao.updateChangeYamlList(dslContext, action.data.context.requestEventId!!, forkMrYamlList) } - action.data.watcherStart("streamYamlBaseBuild.startBuild.StreamBuildLock") + action.data.watcherStart("streamYamlBaseBuild.startBuild.StreamBuildLock.locked") // 修改流水线并启动构建,需要加锁保证事务性 val buildLock = StreamBuildLock( redisOperation = redisOperation, @@ -351,6 +351,7 @@ class StreamYamlBaseBuild @Autowired constructor( var buildId = "" try { buildLock.lock() + action.data.watcherStart("streamYamlBaseBuild.startBuild.StreamBuildLock") logger.info( "StreamYamlBaseBuild|startBuild|start|gitProjectId|${action.data.getGitProjectId()}|" + "pipelineId|${pipeline.pipelineId}|gitBuildId|$gitBuildId" @@ -434,6 +435,7 @@ class StreamYamlBaseBuild @Autowired constructor( ignore: Throwable, yamlTransferData: YamlTransferData? ) { + action.data.watcherStart("streamYamlBaseBuild.errorStartBuild") logger.warn( "StreamYamlBaseBuild|errorStartBuild|${action.data.getGitProjectId()}|" + "${pipeline.pipelineId}|$gitBuildId", diff --git a/src/backend/ci/core/stream/biz-stream/src/main/kotlin/com/tencent/devops/stream/trigger/StreamYamlTrigger.kt b/src/backend/ci/core/stream/biz-stream/src/main/kotlin/com/tencent/devops/stream/trigger/StreamYamlTrigger.kt index 4ca35b79585..deebfd40373 100644 --- a/src/backend/ci/core/stream/biz-stream/src/main/kotlin/com/tencent/devops/stream/trigger/StreamYamlTrigger.kt +++ b/src/backend/ci/core/stream/biz-stream/src/main/kotlin/com/tencent/devops/stream/trigger/StreamYamlTrigger.kt @@ -194,7 +194,7 @@ class StreamYamlTrigger @Autowired constructor( action: BaseAction, triggerEvent: Pair?, TriggerResult>? ): Boolean { - action.data.watcherStart("streamYamlTrigger.triggerBuild") + action.data.watcherStart("streamYamlTrigger.triggerBuild.start") logger.info( "StreamYamlTrigger|triggerBuild|requestEventId" + "|${action.data.context.requestEventId}|action|${action.format()}" @@ -253,6 +253,7 @@ class StreamYamlTrigger @Autowired constructor( )!! action.data.setting = action.data.setting.copy(gitHttpUrl = gitProjectInfo.gitHttpUrl) + action.data.watcherStart("streamYamlTrigger.triggerBuild.isMatch") // 前面使用缓存触发器判断过得就不用再判断了 // 同时使用缓存触发成功的肯定不用在重复注册各类事件了 val tr = if (triggerEvent?.second != null) { @@ -427,6 +428,7 @@ class StreamYamlTrigger @Autowired constructor( fun prepareCIBuildYaml( action: BaseAction ): YamlReplaceResult? { + action.data.watcherStart("streamYamlTrigger.prepareCIBuildYaml") logger.info( "StreamYamlTrigger|prepareCIBuildYaml" + "|requestEventId|${action.data.context.requestEventId}|action|${action.format()}" @@ -493,6 +495,7 @@ class StreamYamlTrigger @Autowired constructor( concurrency = concurrency ) } + action.data.watcherStart("streamYamlTrigger.prepareCIBuildYaml.end") return YamlReplaceResult( preYaml = newPreYamlObject, normalYaml = normalYaml, diff --git a/src/backend/ci/core/stream/biz-stream/src/main/kotlin/com/tencent/devops/stream/trigger/exception/handler/StreamTriggerExceptionHandler.kt b/src/backend/ci/core/stream/biz-stream/src/main/kotlin/com/tencent/devops/stream/trigger/exception/handler/StreamTriggerExceptionHandler.kt index 239407b7122..eb2ba5fa112 100644 --- a/src/backend/ci/core/stream/biz-stream/src/main/kotlin/com/tencent/devops/stream/trigger/exception/handler/StreamTriggerExceptionHandler.kt +++ b/src/backend/ci/core/stream/biz-stream/src/main/kotlin/com/tencent/devops/stream/trigger/exception/handler/StreamTriggerExceptionHandler.kt @@ -88,7 +88,7 @@ class StreamTriggerExceptionHandler @Autowired constructor( } finally { if (action.data.isWatcherInitialized) { action.data.watcher.stop() - LogUtils.printCostTimeWE(action.data.watcher, warnThreshold = 1000, errorThreshold = 5000) + LogUtils.printCostTimeWE(action.data.watcher, warnThreshold = 5000, errorThreshold = 10000) } } } diff --git a/src/backend/ci/core/stream/biz-stream/src/main/kotlin/com/tencent/devops/stream/trigger/exception/handler/StreamTriggerExceptionHandlerUtil.kt b/src/backend/ci/core/stream/biz-stream/src/main/kotlin/com/tencent/devops/stream/trigger/exception/handler/StreamTriggerExceptionHandlerUtil.kt index 1a5e8454426..4242671aedf 100644 --- a/src/backend/ci/core/stream/biz-stream/src/main/kotlin/com/tencent/devops/stream/trigger/exception/handler/StreamTriggerExceptionHandlerUtil.kt +++ b/src/backend/ci/core/stream/biz-stream/src/main/kotlin/com/tencent/devops/stream/trigger/exception/handler/StreamTriggerExceptionHandlerUtil.kt @@ -89,7 +89,7 @@ object StreamTriggerExceptionHandlerUtil { } finally { if (action.data.isWatcherInitialized) { action.data.watcher.stop() - LogUtils.printCostTimeWE(action.data.watcher, warnThreshold = 1000, errorThreshold = 5000) + LogUtils.printCostTimeWE(action.data.watcher, warnThreshold = 5000, errorThreshold = 10000) } } }