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
de7b8ee8
Commit
de7b8ee8
authored
Dec 21, 2025
by
ligaowei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update UnifiedEventProcessor to use OptimizedEventProcessingService with object pooling
parent
b41a4454
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
UnifiedEventProcessor.ts
frontend/src/services/UnifiedEventProcessor.ts
+13
-2
No files found.
frontend/src/services/UnifiedEventProcessor.ts
View file @
de7b8ee8
...
@@ -2,16 +2,19 @@
...
@@ -2,16 +2,19 @@
import
type
{
TimelineEvent
}
from
'../types/timeline'
import
type
{
TimelineEvent
}
from
'../types/timeline'
import
{
EventProcessingService
}
from
'./EventProcessingService'
import
{
EventProcessingService
}
from
'./EventProcessingService'
import
{
EventDeduplicationService
}
from
'./EventDeduplicationService'
import
{
EventDeduplicationService
}
from
'./EventDeduplicationService'
import
{
OptimizedEventProcessingService
}
from
'./OptimizedEventProcessingService'
export
class
UnifiedEventProcessor
{
export
class
UnifiedEventProcessor
{
private
eventProcessingService
:
EventProcessingService
private
eventProcessingService
:
EventProcessingService
private
eventDeduplicationService
:
EventDeduplicationService
private
eventDeduplicationService
:
EventDeduplicationService
private
optimizedEventProcessingService
:
OptimizedEventProcessingService
private
eventHandlers
:
Array
<
(
event
:
TimelineEvent
)
=>
void
>
=
[]
private
eventHandlers
:
Array
<
(
event
:
TimelineEvent
)
=>
void
>
=
[]
private
processedEvents
:
TimelineEvent
[]
=
[]
private
processedEvents
:
TimelineEvent
[]
=
[]
constructor
()
{
constructor
()
{
this
.
eventProcessingService
=
new
EventProcessingService
()
this
.
eventProcessingService
=
new
EventProcessingService
()
this
.
eventDeduplicationService
=
new
EventDeduplicationService
()
this
.
eventDeduplicationService
=
new
EventDeduplicationService
()
this
.
optimizedEventProcessingService
=
new
OptimizedEventProcessingService
()
}
}
/**
/**
...
@@ -36,8 +39,8 @@ export class UnifiedEventProcessor {
...
@@ -36,8 +39,8 @@ export class UnifiedEventProcessor {
// 处理事件类型转换
// 处理事件类型转换
const
processedEvent
=
this
.
eventProcessingService
.
processEventType
(
rawData
)
const
processedEvent
=
this
.
eventProcessingService
.
processEventType
(
rawData
)
// 标准化事件对象
// 标准化事件对象
(使用优化的服务)
const
normalizedEvent
=
this
.
e
ventProcessingService
.
normalizeEvent
(
processedEvent
)
const
normalizedEvent
=
this
.
optimizedE
ventProcessingService
.
normalizeEvent
(
processedEvent
)
// 添加到已处理事件列表
// 添加到已处理事件列表
this
.
processedEvents
.
push
(
normalizedEvent
)
this
.
processedEvents
.
push
(
normalizedEvent
)
...
@@ -94,4 +97,12 @@ export class UnifiedEventProcessor {
...
@@ -94,4 +97,12 @@ export class UnifiedEventProcessor {
this
.
processedEvents
=
[]
this
.
processedEvents
=
[]
this
.
eventDeduplicationService
.
clearEventHashSet
()
this
.
eventDeduplicationService
.
clearEventHashSet
()
}
}
/**
* 获取性能统计信息
* @returns 性能统计信息
*/
getPerformanceStats
():
{
totalProcessed
:
number
;
totalReused
:
number
;
reuseRate
:
number
}
{
return
this
.
optimizedEventProcessingService
.
getPerformanceStats
();
}
}
}
\ No newline at end of file
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