Skip to content

Commit

Permalink
feat: 构件传输记录指标增加userId #2448
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoxuwan committed Aug 1, 2024
1 parent a0a939d commit 4d819cd
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import com.tencent.bkrepo.common.artifact.constant.DEFAULT_STORAGE_KEY
import com.tencent.bkrepo.common.artifact.event.ArtifactReceivedEvent
import com.tencent.bkrepo.common.artifact.event.ArtifactResponseEvent
import com.tencent.bkrepo.common.artifact.event.ChunkArtifactTransferEvent
import com.tencent.bkrepo.common.artifact.hash.md5
import com.tencent.bkrepo.common.artifact.metrics.ArtifactCacheMetrics
import com.tencent.bkrepo.common.artifact.metrics.ArtifactMetrics
import com.tencent.bkrepo.common.artifact.metrics.ArtifactMetricsProperties
Expand Down Expand Up @@ -107,7 +108,7 @@ class ArtifactTransferListener(
builderAgentList = artifactMetricsProperties.builderAgentList,
clientAgentList = artifactMetricsProperties.clientAgentList
).name,
userId = SecurityUtils.getUserId()
userId = SecurityUtils.getUserId().md5()
)
if (SecurityUtils.getUserId() != SYSTEM_USER) {
projectUsageStatisticsService.inc(projectId = projectId, receivedBytes = throughput.bytes)
Expand Down Expand Up @@ -153,7 +154,7 @@ class ArtifactTransferListener(
builderAgentList = artifactMetricsProperties.builderAgentList,
clientAgentList = artifactMetricsProperties.clientAgentList
).name,
userId = SecurityUtils.getUserId()
userId = SecurityUtils.getUserId().md5()
)
if (SecurityUtils.getUserId() != SYSTEM_USER) {
projectUsageStatisticsService.inc(projectId = projectId, responseBytes = throughput.bytes)
Expand Down Expand Up @@ -210,7 +211,7 @@ class ArtifactTransferListener(
builderAgentList = artifactMetricsProperties.builderAgentList,
clientAgentList = artifactMetricsProperties.clientAgentList
).name,
userId = SecurityUtils.getUserId()
userId = SecurityUtils.getUserId().md5()
)
if (artifactMetricsProperties.collectByLog) {
logger.info(
Expand Down

0 comments on commit 4d819cd

Please sign in to comment.