From d07ce54f2174556c234666b2ccddf3bc908d7319 Mon Sep 17 00:00:00 2001 From: yiqianxu Date: Wed, 10 May 2023 15:13:06 +0800 Subject: [PATCH] [front]Fix span data deduplication issue (#511) Signed-off-by: yiqianxu --- CHANGELOG.md | 2 ++ camera-front/src/containers/thread/camera/util.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9039327a3..bfa6659cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ ## Unreleased ### New features - Display scheduler run queue latency on Trace-Profiling chart. To learn more about the concept of 'Run Queue Latency', refer to [this blog post](https://www.brendangregg.com/blog/2016-10-08/linux-bcc-runqlat.html). You can also find a use case for this feature in [this blog post](http://kindling.harmonycloud.cn/blogs/use-cases/optimize-cpu/). ([#494](https://github.com/KindlingProject/kindling/pull/494)) +### Bug fixes +- Fix span data deduplication issue.([#511](https://github.com/KindlingProject/kindling/pull/511)) ## v0.7.2 - 2023-04-24 ### Enhancements diff --git a/camera-front/src/containers/thread/camera/util.ts b/camera-front/src/containers/thread/camera/util.ts index 987aa4228..8aec7f0c7 100644 --- a/camera-front/src/containers/thread/camera/util.ts +++ b/camera-front/src/containers/thread/camera/util.ts @@ -558,7 +558,7 @@ export const dataHandle = (data: any, timeRange, trace: any) => { let cpuEvents = _.chain(list).map('cpuEvents').flatten().uniqBy('startTime').value(); let javaFutexEvents = _.chain(list).map('javaFutexEvents').flatten().uniqBy('startTime').value(); let transactionIdsList = _.chain(list).map('transactionIds').flatten().value(); - let spanList = _.chain(list).map('spans').flatten().uniqBy('startTime').compact().value(); + let spanList = _.chain(list).map('spans').flatten().uniqWith((a, b) => a.startTime === b.startTime && a.name === b.name && a.endTime === b.endTime).compact().value(); let innerCallsList = _.chain(list).map('innerCalls').flatten().uniqBy('startTime').compact().value(); threadObj.innerCalls = innerCallsList;