diff --git a/rtc_tools/rtc_event_log_visualizer/alerts.cc b/rtc_tools/rtc_event_log_visualizer/alerts.cc index 86372de4cf..2d1868fa28 100644 --- a/rtc_tools/rtc_event_log_visualizer/alerts.cc +++ b/rtc_tools/rtc_event_log_visualizer/alerts.cc @@ -26,15 +26,6 @@ namespace webrtc { -void TriageHelper::Print(FILE* file) { - fprintf(file, "========== TRIAGE NOTIFICATIONS ==========\n"); - for (const auto& alert : triage_alerts_) { - fprintf(file, "%d %s. First occurrence at %3.3lf\n", alert.second.count, - alert.second.explanation.c_str(), alert.second.first_occurrence); - } - fprintf(file, "========== END TRIAGE NOTIFICATIONS ==========\n"); -} - void TriageHelper::AnalyzeStreamGaps(const ParsedRtcEventLog& parsed_log, PacketDirection direction) { // With 100 packets/s (~800kbps), false positives would require 10 s without @@ -224,4 +215,21 @@ void TriageHelper::AnalyzeLog(const ParsedRtcEventLog& parsed_log) { } } +void TriageHelper::Print(FILE* file) { + fprintf(file, "========== TRIAGE NOTIFICATIONS ==========\n"); + for (const auto& alert : triage_alerts_) { + fprintf(file, "%d %s. First occurrence at %3.3lf\n", alert.second.count, + alert.second.explanation.c_str(), alert.second.first_occurrence); + } + fprintf(file, "========== END TRIAGE NOTIFICATIONS ==========\n"); +} + +void TriageHelper::ProcessAlerts( + std::function f) { + for (const auto& alert : triage_alerts_) { + f(alert.second.count, alert.second.first_occurrence, + alert.second.explanation); + } +} + } // namespace webrtc diff --git a/rtc_tools/rtc_event_log_visualizer/alerts.h b/rtc_tools/rtc_event_log_visualizer/alerts.h index 7bd9f05270..d3e41666aa 100644 --- a/rtc_tools/rtc_event_log_visualizer/alerts.h +++ b/rtc_tools/rtc_event_log_visualizer/alerts.h @@ -57,6 +57,8 @@ class TriageHelper { PacketDirection direction); void Print(FILE* file); + void ProcessAlerts(std::function f); + private: AnalyzerConfig config_; std::map triage_alerts_;