Add method to extract triage alerts from RTC event log analyzer.

Bug: webrtc:11566
Change-Id: I8315895be4fe93513247c49452c50ec23e9d1e11
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186560
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32292}
This commit is contained in:
Bjorn Terelius
2020-10-02 14:53:50 +02:00
committed by Commit Bot
parent 09ceed2165
commit 7634ea7240
2 changed files with 19 additions and 9 deletions

View File

@ -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<void(int, float, std::string)> f) {
for (const auto& alert : triage_alerts_) {
f(alert.second.count, alert.second.first_occurrence,
alert.second.explanation);
}
}
} // namespace webrtc

View File

@ -57,6 +57,8 @@ class TriageHelper {
PacketDirection direction);
void Print(FILE* file);
void ProcessAlerts(std::function<void(int, float, std::string)> f);
private:
AnalyzerConfig config_;
std::map<TriageAlertType, TriageAlert> triage_alerts_;