Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Pangea-Agent
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gavin-Group
Pangea-Agent
Commits
b599196d
Commit
b599196d
authored
Dec 21, 2025
by
ligaowei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add performance monitoring to TimelineContainer component
parent
de7b8ee8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
TimelineContainer.vue
frontend/src/components/TimelineContainer.vue
+24
-2
No files found.
frontend/src/components/TimelineContainer.vue
View file @
b599196d
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
</
template
>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
onUnmounted
}
from
'vue'
import
{
ref
,
onUnmounted
,
onMounted
}
from
'vue'
import
TimelinePanel
from
'./TimelinePanel.vue'
import
TimelinePanel
from
'./TimelinePanel.vue'
import
{
TimelineEventStateManager
}
from
'../services/timelineEventStateManager'
import
{
TimelineEventStateManager
}
from
'../services/timelineEventStateManager'
import
{
CacheService
}
from
'../services/CacheService'
import
{
CacheService
}
from
'../services/CacheService'
...
@@ -82,10 +82,18 @@ const handleClearTimeline = () => {
...
@@ -82,10 +82,18 @@ const handleClearTimeline = () => {
cacheService
.
clearAllCaches
();
cacheService
.
clearAllCaches
();
};
};
// 显示性能统计信息
const
showPerformanceStats
=
()
=>
{
const
stats
=
eventProcessor
.
getPerformanceStats
();
console
.
log
(
'[TimelineContainer] 性能统计:'
,
stats
);
alert
(
`总处理事件数:
${
stats
.
totalProcessed
}
\n重用事件数:
${
stats
.
totalReused
}
\n重用率:
${
stats
.
reuseRate
}
%`
);
};
// 暴露方法供父组件调用
// 暴露方法供父组件调用
defineExpose
({
defineExpose
({
addEvent
,
addEvent
,
clearTimeline
:
handleClearTimeline
clearTimeline
:
handleClearTimeline
,
showPerformanceStats
});
});
// 组件卸载时清理资源
// 组件卸载时清理资源
...
@@ -93,6 +101,20 @@ onUnmounted(() => {
...
@@ -93,6 +101,20 @@ onUnmounted(() => {
stateManager
.
clearAllStates
();
stateManager
.
clearAllStates
();
cacheService
.
clearAllCaches
();
cacheService
.
clearAllCaches
();
});
});
// 组件挂载时启动定期性能监控
onMounted
(()
=>
{
// 每30秒输出一次性能统计
const
perfInterval
=
setInterval
(()
=>
{
const
stats
=
eventProcessor
.
getPerformanceStats
();
console
.
log
(
'[TimelineContainer] 定期性能统计:'
,
stats
);
},
30000
);
// 组件卸载时清除定时器
onUnmounted
(()
=>
{
clearInterval
(
perfInterval
);
});
});
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment