Allow printing graphs as protobuf in event_log_visualizer.
event_log_visualizer --protobuf_output <file> will print a binary protobuf description of the graphs. Also piggy-backing a couple of trivial spelling fixes in the same CL. Bug: None Change-Id: Ib000aa2706de51659ee72f13b773c4394edafe3e Reviewed-on: https://webrtc-review.googlesource.com/99320 Reviewed-by: Elad Alon <eladalon@webrtc.org> Commit-Queue: Björn Terelius <terelius@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24675}
This commit is contained in:

committed by
Commit Bot

parent
ab49982601
commit
ef73f59de6
@ -14,6 +14,7 @@
|
||||
#include "rtc_base/flags.h"
|
||||
#include "rtc_tools/event_log_visualizer/analyzer.h"
|
||||
#include "rtc_tools/event_log_visualizer/plot_base.h"
|
||||
#include "rtc_tools/event_log_visualizer/plot_protobuf.h"
|
||||
#include "rtc_tools/event_log_visualizer/plot_python.h"
|
||||
#include "system_wrappers/include/field_trial_default.h"
|
||||
#include "test/field_trial.h"
|
||||
@ -161,6 +162,10 @@ DEFINE_bool(normalize_time,
|
||||
true,
|
||||
"Normalize the log timestamps so that the call starts at time 0.");
|
||||
|
||||
DEFINE_bool(protobuf_output,
|
||||
false,
|
||||
"Output charts as protobuf instead of python code.");
|
||||
|
||||
void SetAllPlotFlags(bool setting);
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
@ -237,8 +242,12 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
webrtc::EventLogAnalyzer analyzer(parsed_log, FLAG_normalize_time);
|
||||
std::unique_ptr<webrtc::PlotCollection> collection(
|
||||
new webrtc::PythonPlotCollection());
|
||||
std::unique_ptr<webrtc::PlotCollection> collection;
|
||||
if (FLAG_protobuf_output) {
|
||||
collection.reset(new webrtc::ProtobufPlotCollection());
|
||||
} else {
|
||||
collection.reset(new webrtc::PythonPlotCollection());
|
||||
}
|
||||
|
||||
if (FLAG_plot_incoming_packet_sizes) {
|
||||
analyzer.CreatePacketGraph(webrtc::kIncomingPacket,
|
||||
@ -343,11 +352,11 @@ int main(int argc, char* argv[]) {
|
||||
};
|
||||
analyzer.CreateSenderAndReceiverReportPlot(
|
||||
webrtc::kIncomingPacket, GetHighestSeqNumber,
|
||||
"Highest sequence number (incoming RTCP)", "Seqence number",
|
||||
"Highest sequence number (incoming RTCP)", "Sequence number",
|
||||
collection->AppendNewPlot());
|
||||
analyzer.CreateSenderAndReceiverReportPlot(
|
||||
webrtc::kOutgoingPacket, GetHighestSeqNumber,
|
||||
"Highest sequence number (outgoing RTCP)", "Seqence number",
|
||||
"Highest sequence number (outgoing RTCP)", "Sequence number",
|
||||
collection->AppendNewPlot());
|
||||
|
||||
auto DelaySinceLastSr =
|
||||
|
@ -61,7 +61,11 @@ ProtobufPlotCollection::ProtobufPlotCollection() {}
|
||||
|
||||
ProtobufPlotCollection::~ProtobufPlotCollection() {}
|
||||
|
||||
void ProtobufPlotCollection::Draw() {}
|
||||
void ProtobufPlotCollection::Draw() {
|
||||
webrtc::analytics::ChartCollection collection;
|
||||
ExportProtobuf(&collection);
|
||||
std::cout << collection.SerializeAsString();
|
||||
}
|
||||
|
||||
void ProtobufPlotCollection::ExportProtobuf(
|
||||
webrtc::analytics::ChartCollection* collection) {
|
||||
|
Reference in New Issue
Block a user