MCPcopy Create free account
hub / github.com/astercloud/aster / GetTimelineFiltered

Method GetTimelineFiltered

pkg/events/bus.go:534–545  ·  view source on GitHub ↗

GetTimelineFiltered 获取过滤后的时间线

(filter func(types.AgentEventEnvelope) bool)

Source from the content-addressed store, hash-verified

532
533// GetTimelineFiltered 获取过滤后的时间线
534func (eb *EventBus) GetTimelineFiltered(filter func(types.AgentEventEnvelope) bool) []types.AgentEventEnvelope {
535 eb.mu.RLock()
536 defer eb.mu.RUnlock()
537
538 result := make([]types.AgentEventEnvelope, 0)
539 for _, envelope := range eb.timeline {
540 if filter(envelope) {
541 result = append(result, envelope)
542 }
543 }
544 return result
545}
546
547// GetTimelineCount 获取当前时间线事件数量
548func (eb *EventBus) GetTimelineCount() int {

Callers 6

TestGetTimelineFilteredFunction · 0.95
GetOverviewStatsMethod · 0.80
GetTokenUsageMethod · 0.80
QueryTracesMethod · 0.80
GetPerformanceStatsMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestGetTimelineFilteredFunction · 0.76