Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(650)

Side by Side Diff: webrtc/tools/event_log_visualizer/main.cc

Issue 2499283002: Add support for field trials to event log visualizer. (Closed)
Patch Set: . Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/tools/event_log_visualizer/analyzer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include <iostream> 11 #include <iostream>
12 12
13 #include "gflags/gflags.h" 13 #include "gflags/gflags.h"
14 #include "webrtc/logging/rtc_event_log/rtc_event_log_parser.h" 14 #include "webrtc/logging/rtc_event_log/rtc_event_log_parser.h"
15 #include "webrtc/test/field_trial.h"
15 #include "webrtc/tools/event_log_visualizer/analyzer.h" 16 #include "webrtc/tools/event_log_visualizer/analyzer.h"
16 #include "webrtc/tools/event_log_visualizer/plot_base.h" 17 #include "webrtc/tools/event_log_visualizer/plot_base.h"
17 #include "webrtc/tools/event_log_visualizer/plot_python.h" 18 #include "webrtc/tools/event_log_visualizer/plot_python.h"
18 19
19 DEFINE_bool(incoming, true, "Plot statistics for incoming packets."); 20 DEFINE_bool(incoming, true, "Plot statistics for incoming packets.");
20 DEFINE_bool(outgoing, true, "Plot statistics for outgoing packets."); 21 DEFINE_bool(outgoing, true, "Plot statistics for outgoing packets.");
21 DEFINE_bool(plot_all, true, "Plot all different data types."); 22 DEFINE_bool(plot_all, true, "Plot all different data types.");
22 DEFINE_bool(plot_packets, 23 DEFINE_bool(plot_packets,
23 false, 24 false,
24 "Plot bar graph showing the size of each packet."); 25 "Plot bar graph showing the size of each packet.");
(...skipping 26 matching lines...) Expand all
51 "Run the bandwidth estimator with the logged rtp and rtcp and plot " 52 "Run the bandwidth estimator with the logged rtp and rtcp and plot "
52 "the output."); 53 "the output.");
53 DEFINE_bool(plot_network_delay_feedback, 54 DEFINE_bool(plot_network_delay_feedback,
54 false, 55 false,
55 "Compute network delay based on sent packets and the received " 56 "Compute network delay based on sent packets and the received "
56 "transport feedback."); 57 "transport feedback.");
57 DEFINE_bool(plot_fraction_loss, 58 DEFINE_bool(plot_fraction_loss,
58 false, 59 false,
59 "Plot packet loss in percent for outgoing packets (as perceived by " 60 "Plot packet loss in percent for outgoing packets (as perceived by "
60 "the send-side bandwidth estimator)."); 61 "the send-side bandwidth estimator).");
62 DEFINE_string(
63 force_fieldtrials,
64 "",
65 "Field trials control experimental feature code which can be forced. "
66 "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enabled/"
67 " will assign the group Enabled to field trial WebRTC-FooFeature. Multiple "
68 "trials are separated by \"/\"");
61 69
62 int main(int argc, char* argv[]) { 70 int main(int argc, char* argv[]) {
63 std::string program_name = argv[0]; 71 std::string program_name = argv[0];
64 std::string usage = 72 std::string usage =
65 "A tool for visualizing WebRTC event logs.\n" 73 "A tool for visualizing WebRTC event logs.\n"
66 "Example usage:\n" + 74 "Example usage:\n" +
67 program_name + " <logfile> | python\n" + "Run " + program_name + 75 program_name + " <logfile> | python\n" + "Run " + program_name +
68 " --help for a list of command line options\n"; 76 " --help for a list of command line options\n";
69 google::SetUsageMessage(usage); 77 google::SetUsageMessage(usage);
70 google::ParseCommandLineFlags(&argc, &argv, true); 78 google::ParseCommandLineFlags(&argc, &argv, true);
71 79
72 if (argc != 2) { 80 if (argc != 2) {
73 // Print usage information. 81 // Print usage information.
74 std::cout << google::ProgramUsage(); 82 std::cout << google::ProgramUsage();
75 return 0; 83 return 0;
76 } 84 }
77 85
86 webrtc::test::InitFieldTrialsFromString(FLAGS_force_fieldtrials);
87
78 std::string filename = argv[1]; 88 std::string filename = argv[1];
79 89
80 webrtc::ParsedRtcEventLog parsed_log; 90 webrtc::ParsedRtcEventLog parsed_log;
81 91
82 if (!parsed_log.ParseFile(filename)) { 92 if (!parsed_log.ParseFile(filename)) {
83 std::cerr << "Could not parse the entire log file." << std::endl; 93 std::cerr << "Could not parse the entire log file." << std::endl;
84 std::cerr << "Proceeding to analyze the first " 94 std::cerr << "Proceeding to analyze the first "
85 << parsed_log.GetNumberOfEvents() << " events in the file." 95 << parsed_log.GetNumberOfEvents() << " events in the file."
86 << std::endl; 96 << std::endl;
87 } 97 }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } 177 }
168 178
169 if (FLAGS_plot_all || FLAGS_plot_network_delay_feedback) { 179 if (FLAGS_plot_all || FLAGS_plot_network_delay_feedback) {
170 analyzer.CreateNetworkDelayFeedbackGraph(collection->AppendNewPlot()); 180 analyzer.CreateNetworkDelayFeedbackGraph(collection->AppendNewPlot());
171 } 181 }
172 182
173 collection->Draw(); 183 collection->Draw();
174 184
175 return 0; 185 return 0;
176 } 186 }
OLDNEW
« no previous file with comments | « webrtc/tools/event_log_visualizer/analyzer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698