From 14ffbf29043ee518732d79650b40a2ac34950c34 Mon Sep 17 00:00:00 2001 From: Elias Bermudez Date: Wed, 2 Aug 2023 16:07:49 -0700 Subject: [PATCH] Connect collector to reporter --- src/c++/perf_analyzer/perf_analyzer.cc | 1 + src/c++/perf_analyzer/raw_data_collector.h | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/c++/perf_analyzer/perf_analyzer.cc b/src/c++/perf_analyzer/perf_analyzer.cc index 9d837df6f..f9282d931 100644 --- a/src/c++/perf_analyzer/perf_analyzer.cc +++ b/src/c++/perf_analyzer/perf_analyzer.cc @@ -434,6 +434,7 @@ PerfAnalyzer::WriteReport() void PerfAnalyzer::GenerateProfileExportReport() { + reporter_->ConvertToJson(collector_->GetData(), collector_->GetVersion()); reporter_->OutputToFile(params_->profile_export_file); } diff --git a/src/c++/perf_analyzer/raw_data_collector.h b/src/c++/perf_analyzer/raw_data_collector.h index a7f5a935a..2b837a9bd 100644 --- a/src/c++/perf_analyzer/raw_data_collector.h +++ b/src/c++/perf_analyzer/raw_data_collector.h @@ -83,6 +83,12 @@ class RawDataCollector { /// @param request_records The request information for the current experiment. void AddData(PerfMode& id, std::vector&& request_records); + /// Get the raw experiment data for the profile + /// @return Raw experiment data + std::vector& GetData() { return experiments_; } + + std::string& GetVersion() { return version_; } + private: RawDataCollector() = default; @@ -94,6 +100,6 @@ class RawDataCollector { }; std::vector experiments_{}; - std::string version{VERSION}; + std::string version_{VERSION}; }; }} // namespace triton::perfanalyzer