diff --git a/src/c++/perf_analyzer/raw_data_reporter.cc b/src/c++/perf_analyzer/raw_data_reporter.cc index 592eb7ff1..854cdc3cc 100644 --- a/src/c++/perf_analyzer/raw_data_reporter.cc +++ b/src/c++/perf_analyzer/raw_data_reporter.cc @@ -27,6 +27,10 @@ #include "raw_data_reporter.h" +#include +#include +#include + #include "client_backend/client_backend.h" namespace triton { namespace perfanalyzer { @@ -143,8 +147,27 @@ RawDataReporter::AddVersion(std::string& raw_version) document_.AddMember("version", version, document_.GetAllocator()); } -// print to std::cout // print to file +void +RawDataReporter::Print() +{ + OStreamWrapper out(std::cout); + Writer writer(out); + document_.Accept(writer); +} + +void +RawDataReporter::OutputToFile() +{ + FILE* fp = fopen("fix_me", "w"); + char writeBuffer[65536]; + FileWriteStream os(fp, writeBuffer, sizeof(writeBuffer)); + + Writer writer(os); + document_.Accept(writer); + + fclose(fp); +} }} // namespace triton::perfanalyzer diff --git a/src/c++/perf_analyzer/raw_data_reporter.h b/src/c++/perf_analyzer/raw_data_reporter.h index 52236dd92..99aa8a283 100644 --- a/src/c++/perf_analyzer/raw_data_reporter.h +++ b/src/c++/perf_analyzer/raw_data_reporter.h @@ -47,6 +47,11 @@ class RawDataReporter { void ConvertToJson( std::vector& raw_experiments, std::string& raw_version); + /// Output to stdout + void Print(); + + void OutputToFile(); + private: RawDataReporter() = default; void ClearDocument();