| // This file was GENERATED by command: |
| // pump.py benchmark_internal.h.pump |
| // DO NOT EDIT BY HAND!!! |
| |
| // |
| // Copyright 2015 Google Inc. All Rights Reserved. |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| // |
| |
| #include "base/compiler_specific.h" |
| |
| // clang-format off |
| |
| #define TRACE_EVENT_BENCHMARK1(benchmark, event_name_1, measurement_type_1)\ |
| MSVC_PUSH_DISABLE_WARNING(6326)\ |
| class benchmark : public cobalt::trace_event::Benchmark {\ |
| public:\ |
| void Experiment() override;\ |
| void AnalyzeTraceEvent(\ |
| const scoped_refptr<cobalt::trace_event::EventParser::ScopedEvent>& \ |
| event)\ |
| override {\ |
| if (event->name() == event_name_1) {\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_1_last_begin_time_.is_null()) {\ |
| event_1_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_1_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_1_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| }\ |
| std::vector<Result> CompileResults() override {\ |
| std::vector<Result> results;\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " flow duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " in-scope duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " time between event starts in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| }\ |
| return results;\ |
| }\ |
| private:\ |
| std::vector<double> event_1_samples_;\ |
| base::TimeTicks event_1_last_begin_time_;\ |
| };\ |
| \ |
| TRACE_EVENT_REGISTER_BENCHMARK(benchmark)\ |
| \ |
| void benchmark::Experiment()\ |
| MSVC_POP_WARNING() |
| |
| #define TRACE_EVENT_BENCHMARK2(benchmark, event_name_1, measurement_type_1, \ |
| event_name_2, measurement_type_2)\ |
| MSVC_PUSH_DISABLE_WARNING(6326)\ |
| class benchmark : public cobalt::trace_event::Benchmark {\ |
| public:\ |
| void Experiment() override;\ |
| void AnalyzeTraceEvent(\ |
| const scoped_refptr<cobalt::trace_event::EventParser::ScopedEvent>& \ |
| event)\ |
| override {\ |
| if (event->name() == event_name_1) {\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_1_last_begin_time_.is_null()) {\ |
| event_1_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_1_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_1_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_2) {\ |
| switch (measurement_type_2) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_2_last_begin_time_.is_null()) {\ |
| event_2_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_2_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_2_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| }\ |
| std::vector<Result> CompileResults() override {\ |
| std::vector<Result> results;\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " flow duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " in-scope duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " time between event starts in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_2) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " flow duration in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " in-scope duration in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " time between event starts in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| }\ |
| return results;\ |
| }\ |
| private:\ |
| std::vector<double> event_1_samples_;\ |
| base::TimeTicks event_1_last_begin_time_;\ |
| std::vector<double> event_2_samples_;\ |
| base::TimeTicks event_2_last_begin_time_;\ |
| };\ |
| \ |
| TRACE_EVENT_REGISTER_BENCHMARK(benchmark)\ |
| \ |
| void benchmark::Experiment()\ |
| MSVC_POP_WARNING() |
| |
| #define TRACE_EVENT_BENCHMARK3(benchmark, event_name_1, measurement_type_1, \ |
| event_name_2, measurement_type_2, event_name_3, measurement_type_3)\ |
| MSVC_PUSH_DISABLE_WARNING(6326)\ |
| class benchmark : public cobalt::trace_event::Benchmark {\ |
| public:\ |
| void Experiment() override;\ |
| void AnalyzeTraceEvent(\ |
| const scoped_refptr<cobalt::trace_event::EventParser::ScopedEvent>& \ |
| event)\ |
| override {\ |
| if (event->name() == event_name_1) {\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_1_last_begin_time_.is_null()) {\ |
| event_1_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_1_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_1_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_2) {\ |
| switch (measurement_type_2) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_2_last_begin_time_.is_null()) {\ |
| event_2_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_2_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_2_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_3) {\ |
| switch (measurement_type_3) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_3_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_3_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_3_last_begin_time_.is_null()) {\ |
| event_3_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_3_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_3_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| }\ |
| std::vector<Result> CompileResults() override {\ |
| std::vector<Result> results;\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " flow duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " in-scope duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " time between event starts in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_2) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " flow duration in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " in-scope duration in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " time between event starts in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_3) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " flow duration in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " in-scope duration in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " time between event starts in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| }\ |
| return results;\ |
| }\ |
| private:\ |
| std::vector<double> event_1_samples_;\ |
| base::TimeTicks event_1_last_begin_time_;\ |
| std::vector<double> event_2_samples_;\ |
| base::TimeTicks event_2_last_begin_time_;\ |
| std::vector<double> event_3_samples_;\ |
| base::TimeTicks event_3_last_begin_time_;\ |
| };\ |
| \ |
| TRACE_EVENT_REGISTER_BENCHMARK(benchmark)\ |
| \ |
| void benchmark::Experiment()\ |
| MSVC_POP_WARNING() |
| |
| #define TRACE_EVENT_BENCHMARK4(benchmark, event_name_1, measurement_type_1, \ |
| event_name_2, measurement_type_2, event_name_3, measurement_type_3, \ |
| event_name_4, measurement_type_4)\ |
| MSVC_PUSH_DISABLE_WARNING(6326)\ |
| class benchmark : public cobalt::trace_event::Benchmark {\ |
| public:\ |
| void Experiment() override;\ |
| void AnalyzeTraceEvent(\ |
| const scoped_refptr<cobalt::trace_event::EventParser::ScopedEvent>& \ |
| event)\ |
| override {\ |
| if (event->name() == event_name_1) {\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_1_last_begin_time_.is_null()) {\ |
| event_1_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_1_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_1_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_2) {\ |
| switch (measurement_type_2) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_2_last_begin_time_.is_null()) {\ |
| event_2_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_2_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_2_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_3) {\ |
| switch (measurement_type_3) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_3_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_3_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_3_last_begin_time_.is_null()) {\ |
| event_3_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_3_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_3_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_4) {\ |
| switch (measurement_type_4) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_4_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_4_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_4_last_begin_time_.is_null()) {\ |
| event_4_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_4_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_4_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| }\ |
| std::vector<Result> CompileResults() override {\ |
| std::vector<Result> results;\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " flow duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " in-scope duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " time between event starts in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_2) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " flow duration in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " in-scope duration in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " time between event starts in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_3) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " flow duration in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " in-scope duration in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " time between event starts in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_4) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " flow duration in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " in-scope duration in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " time between event starts in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| }\ |
| return results;\ |
| }\ |
| private:\ |
| std::vector<double> event_1_samples_;\ |
| base::TimeTicks event_1_last_begin_time_;\ |
| std::vector<double> event_2_samples_;\ |
| base::TimeTicks event_2_last_begin_time_;\ |
| std::vector<double> event_3_samples_;\ |
| base::TimeTicks event_3_last_begin_time_;\ |
| std::vector<double> event_4_samples_;\ |
| base::TimeTicks event_4_last_begin_time_;\ |
| };\ |
| \ |
| TRACE_EVENT_REGISTER_BENCHMARK(benchmark)\ |
| \ |
| void benchmark::Experiment()\ |
| MSVC_POP_WARNING() |
| |
| #define TRACE_EVENT_BENCHMARK5(benchmark, event_name_1, measurement_type_1, \ |
| event_name_2, measurement_type_2, event_name_3, measurement_type_3, \ |
| event_name_4, measurement_type_4, event_name_5, measurement_type_5)\ |
| MSVC_PUSH_DISABLE_WARNING(6326)\ |
| class benchmark : public cobalt::trace_event::Benchmark {\ |
| public:\ |
| void Experiment() override;\ |
| void AnalyzeTraceEvent(\ |
| const scoped_refptr<cobalt::trace_event::EventParser::ScopedEvent>& \ |
| event)\ |
| override {\ |
| if (event->name() == event_name_1) {\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_1_last_begin_time_.is_null()) {\ |
| event_1_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_1_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_1_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_2) {\ |
| switch (measurement_type_2) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_2_last_begin_time_.is_null()) {\ |
| event_2_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_2_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_2_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_3) {\ |
| switch (measurement_type_3) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_3_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_3_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_3_last_begin_time_.is_null()) {\ |
| event_3_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_3_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_3_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_4) {\ |
| switch (measurement_type_4) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_4_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_4_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_4_last_begin_time_.is_null()) {\ |
| event_4_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_4_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_4_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_5) {\ |
| switch (measurement_type_5) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_5_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_5_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_5_last_begin_time_.is_null()) {\ |
| event_5_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_5_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_5_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| }\ |
| std::vector<Result> CompileResults() override {\ |
| std::vector<Result> results;\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " flow duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " in-scope duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " time between event starts in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_2) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " flow duration in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " in-scope duration in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " time between event starts in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_3) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " flow duration in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " in-scope duration in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " time between event starts in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_4) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " flow duration in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " in-scope duration in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " time between event starts in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_5) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_5) +\ |
| " flow duration in seconds", \ |
| event_5_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_5) +\ |
| " in-scope duration in seconds", \ |
| event_5_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_5) +\ |
| " time between event starts in seconds", \ |
| event_5_samples_));\ |
| } break;\ |
| }\ |
| return results;\ |
| }\ |
| private:\ |
| std::vector<double> event_1_samples_;\ |
| base::TimeTicks event_1_last_begin_time_;\ |
| std::vector<double> event_2_samples_;\ |
| base::TimeTicks event_2_last_begin_time_;\ |
| std::vector<double> event_3_samples_;\ |
| base::TimeTicks event_3_last_begin_time_;\ |
| std::vector<double> event_4_samples_;\ |
| base::TimeTicks event_4_last_begin_time_;\ |
| std::vector<double> event_5_samples_;\ |
| base::TimeTicks event_5_last_begin_time_;\ |
| };\ |
| \ |
| TRACE_EVENT_REGISTER_BENCHMARK(benchmark)\ |
| \ |
| void benchmark::Experiment()\ |
| MSVC_POP_WARNING() |
| |
| #define TRACE_EVENT_BENCHMARK6(benchmark, event_name_1, measurement_type_1, \ |
| event_name_2, measurement_type_2, event_name_3, measurement_type_3, \ |
| event_name_4, measurement_type_4, event_name_5, measurement_type_5, \ |
| event_name_6, measurement_type_6)\ |
| MSVC_PUSH_DISABLE_WARNING(6326)\ |
| class benchmark : public cobalt::trace_event::Benchmark {\ |
| public:\ |
| void Experiment() override;\ |
| void AnalyzeTraceEvent(\ |
| const scoped_refptr<cobalt::trace_event::EventParser::ScopedEvent>& \ |
| event)\ |
| override {\ |
| if (event->name() == event_name_1) {\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_1_last_begin_time_.is_null()) {\ |
| event_1_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_1_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_1_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_2) {\ |
| switch (measurement_type_2) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_2_last_begin_time_.is_null()) {\ |
| event_2_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_2_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_2_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_3) {\ |
| switch (measurement_type_3) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_3_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_3_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_3_last_begin_time_.is_null()) {\ |
| event_3_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_3_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_3_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_4) {\ |
| switch (measurement_type_4) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_4_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_4_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_4_last_begin_time_.is_null()) {\ |
| event_4_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_4_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_4_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_5) {\ |
| switch (measurement_type_5) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_5_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_5_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_5_last_begin_time_.is_null()) {\ |
| event_5_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_5_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_5_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_6) {\ |
| switch (measurement_type_6) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_6_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_6_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_6_last_begin_time_.is_null()) {\ |
| event_6_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_6_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_6_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| }\ |
| std::vector<Result> CompileResults() override {\ |
| std::vector<Result> results;\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " flow duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " in-scope duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " time between event starts in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_2) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " flow duration in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " in-scope duration in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " time between event starts in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_3) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " flow duration in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " in-scope duration in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " time between event starts in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_4) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " flow duration in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " in-scope duration in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " time between event starts in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_5) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_5) +\ |
| " flow duration in seconds", \ |
| event_5_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_5) +\ |
| " in-scope duration in seconds", \ |
| event_5_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_5) +\ |
| " time between event starts in seconds", \ |
| event_5_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_6) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_6) +\ |
| " flow duration in seconds", \ |
| event_6_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_6) +\ |
| " in-scope duration in seconds", \ |
| event_6_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_6) +\ |
| " time between event starts in seconds", \ |
| event_6_samples_));\ |
| } break;\ |
| }\ |
| return results;\ |
| }\ |
| private:\ |
| std::vector<double> event_1_samples_;\ |
| base::TimeTicks event_1_last_begin_time_;\ |
| std::vector<double> event_2_samples_;\ |
| base::TimeTicks event_2_last_begin_time_;\ |
| std::vector<double> event_3_samples_;\ |
| base::TimeTicks event_3_last_begin_time_;\ |
| std::vector<double> event_4_samples_;\ |
| base::TimeTicks event_4_last_begin_time_;\ |
| std::vector<double> event_5_samples_;\ |
| base::TimeTicks event_5_last_begin_time_;\ |
| std::vector<double> event_6_samples_;\ |
| base::TimeTicks event_6_last_begin_time_;\ |
| };\ |
| \ |
| TRACE_EVENT_REGISTER_BENCHMARK(benchmark)\ |
| \ |
| void benchmark::Experiment()\ |
| MSVC_POP_WARNING() |
| |
| #define TRACE_EVENT_BENCHMARK7(benchmark, event_name_1, measurement_type_1, \ |
| event_name_2, measurement_type_2, event_name_3, measurement_type_3, \ |
| event_name_4, measurement_type_4, event_name_5, measurement_type_5, \ |
| event_name_6, measurement_type_6, event_name_7, measurement_type_7)\ |
| MSVC_PUSH_DISABLE_WARNING(6326)\ |
| class benchmark : public cobalt::trace_event::Benchmark {\ |
| public:\ |
| void Experiment() override;\ |
| void AnalyzeTraceEvent(\ |
| const scoped_refptr<cobalt::trace_event::EventParser::ScopedEvent>& \ |
| event)\ |
| override {\ |
| if (event->name() == event_name_1) {\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_1_last_begin_time_.is_null()) {\ |
| event_1_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_1_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_1_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_2) {\ |
| switch (measurement_type_2) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_2_last_begin_time_.is_null()) {\ |
| event_2_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_2_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_2_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_3) {\ |
| switch (measurement_type_3) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_3_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_3_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_3_last_begin_time_.is_null()) {\ |
| event_3_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_3_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_3_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_4) {\ |
| switch (measurement_type_4) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_4_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_4_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_4_last_begin_time_.is_null()) {\ |
| event_4_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_4_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_4_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_5) {\ |
| switch (measurement_type_5) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_5_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_5_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_5_last_begin_time_.is_null()) {\ |
| event_5_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_5_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_5_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_6) {\ |
| switch (measurement_type_6) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_6_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_6_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_6_last_begin_time_.is_null()) {\ |
| event_6_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_6_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_6_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_7) {\ |
| switch (measurement_type_7) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_7_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_7_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_7_last_begin_time_.is_null()) {\ |
| event_7_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_7_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_7_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| }\ |
| std::vector<Result> CompileResults() override {\ |
| std::vector<Result> results;\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " flow duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " in-scope duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " time between event starts in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_2) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " flow duration in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " in-scope duration in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " time between event starts in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_3) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " flow duration in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " in-scope duration in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " time between event starts in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_4) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " flow duration in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " in-scope duration in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " time between event starts in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_5) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_5) +\ |
| " flow duration in seconds", \ |
| event_5_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_5) +\ |
| " in-scope duration in seconds", \ |
| event_5_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_5) +\ |
| " time between event starts in seconds", \ |
| event_5_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_6) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_6) +\ |
| " flow duration in seconds", \ |
| event_6_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_6) +\ |
| " in-scope duration in seconds", \ |
| event_6_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_6) +\ |
| " time between event starts in seconds", \ |
| event_6_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_7) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_7) +\ |
| " flow duration in seconds", \ |
| event_7_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_7) +\ |
| " in-scope duration in seconds", \ |
| event_7_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_7) +\ |
| " time between event starts in seconds", \ |
| event_7_samples_));\ |
| } break;\ |
| }\ |
| return results;\ |
| }\ |
| private:\ |
| std::vector<double> event_1_samples_;\ |
| base::TimeTicks event_1_last_begin_time_;\ |
| std::vector<double> event_2_samples_;\ |
| base::TimeTicks event_2_last_begin_time_;\ |
| std::vector<double> event_3_samples_;\ |
| base::TimeTicks event_3_last_begin_time_;\ |
| std::vector<double> event_4_samples_;\ |
| base::TimeTicks event_4_last_begin_time_;\ |
| std::vector<double> event_5_samples_;\ |
| base::TimeTicks event_5_last_begin_time_;\ |
| std::vector<double> event_6_samples_;\ |
| base::TimeTicks event_6_last_begin_time_;\ |
| std::vector<double> event_7_samples_;\ |
| base::TimeTicks event_7_last_begin_time_;\ |
| };\ |
| \ |
| TRACE_EVENT_REGISTER_BENCHMARK(benchmark)\ |
| \ |
| void benchmark::Experiment()\ |
| MSVC_POP_WARNING() |
| |
| #define TRACE_EVENT_BENCHMARK8(benchmark, event_name_1, measurement_type_1, \ |
| event_name_2, measurement_type_2, event_name_3, measurement_type_3, \ |
| event_name_4, measurement_type_4, event_name_5, measurement_type_5, \ |
| event_name_6, measurement_type_6, event_name_7, measurement_type_7, \ |
| event_name_8, measurement_type_8)\ |
| MSVC_PUSH_DISABLE_WARNING(6326)\ |
| class benchmark : public cobalt::trace_event::Benchmark {\ |
| public:\ |
| void Experiment() override;\ |
| void AnalyzeTraceEvent(\ |
| const scoped_refptr<cobalt::trace_event::EventParser::ScopedEvent>& \ |
| event)\ |
| override {\ |
| if (event->name() == event_name_1) {\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_1_last_begin_time_.is_null()) {\ |
| event_1_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_1_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_1_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_2) {\ |
| switch (measurement_type_2) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_2_last_begin_time_.is_null()) {\ |
| event_2_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_2_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_2_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_3) {\ |
| switch (measurement_type_3) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_3_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_3_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_3_last_begin_time_.is_null()) {\ |
| event_3_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_3_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_3_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_4) {\ |
| switch (measurement_type_4) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_4_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_4_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_4_last_begin_time_.is_null()) {\ |
| event_4_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_4_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_4_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_5) {\ |
| switch (measurement_type_5) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_5_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_5_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_5_last_begin_time_.is_null()) {\ |
| event_5_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_5_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_5_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_6) {\ |
| switch (measurement_type_6) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_6_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_6_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_6_last_begin_time_.is_null()) {\ |
| event_6_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_6_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_6_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_7) {\ |
| switch (measurement_type_7) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_7_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_7_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_7_last_begin_time_.is_null()) {\ |
| event_7_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_7_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_7_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_8) {\ |
| switch (measurement_type_8) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_8_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_8_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_8_last_begin_time_.is_null()) {\ |
| event_8_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_8_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_8_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| }\ |
| std::vector<Result> CompileResults() override {\ |
| std::vector<Result> results;\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " flow duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " in-scope duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " time between event starts in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_2) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " flow duration in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " in-scope duration in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " time between event starts in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_3) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " flow duration in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " in-scope duration in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " time between event starts in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_4) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " flow duration in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " in-scope duration in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " time between event starts in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_5) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_5) +\ |
| " flow duration in seconds", \ |
| event_5_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_5) +\ |
| " in-scope duration in seconds", \ |
| event_5_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_5) +\ |
| " time between event starts in seconds", \ |
| event_5_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_6) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_6) +\ |
| " flow duration in seconds", \ |
| event_6_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_6) +\ |
| " in-scope duration in seconds", \ |
| event_6_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_6) +\ |
| " time between event starts in seconds", \ |
| event_6_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_7) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_7) +\ |
| " flow duration in seconds", \ |
| event_7_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_7) +\ |
| " in-scope duration in seconds", \ |
| event_7_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_7) +\ |
| " time between event starts in seconds", \ |
| event_7_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_8) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_8) +\ |
| " flow duration in seconds", \ |
| event_8_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_8) +\ |
| " in-scope duration in seconds", \ |
| event_8_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_8) +\ |
| " time between event starts in seconds", \ |
| event_8_samples_));\ |
| } break;\ |
| }\ |
| return results;\ |
| }\ |
| private:\ |
| std::vector<double> event_1_samples_;\ |
| base::TimeTicks event_1_last_begin_time_;\ |
| std::vector<double> event_2_samples_;\ |
| base::TimeTicks event_2_last_begin_time_;\ |
| std::vector<double> event_3_samples_;\ |
| base::TimeTicks event_3_last_begin_time_;\ |
| std::vector<double> event_4_samples_;\ |
| base::TimeTicks event_4_last_begin_time_;\ |
| std::vector<double> event_5_samples_;\ |
| base::TimeTicks event_5_last_begin_time_;\ |
| std::vector<double> event_6_samples_;\ |
| base::TimeTicks event_6_last_begin_time_;\ |
| std::vector<double> event_7_samples_;\ |
| base::TimeTicks event_7_last_begin_time_;\ |
| std::vector<double> event_8_samples_;\ |
| base::TimeTicks event_8_last_begin_time_;\ |
| };\ |
| \ |
| TRACE_EVENT_REGISTER_BENCHMARK(benchmark)\ |
| \ |
| void benchmark::Experiment()\ |
| MSVC_POP_WARNING() |
| |
| #define TRACE_EVENT_BENCHMARK9(benchmark, event_name_1, measurement_type_1, \ |
| event_name_2, measurement_type_2, event_name_3, measurement_type_3, \ |
| event_name_4, measurement_type_4, event_name_5, measurement_type_5, \ |
| event_name_6, measurement_type_6, event_name_7, measurement_type_7, \ |
| event_name_8, measurement_type_8, event_name_9, measurement_type_9)\ |
| MSVC_PUSH_DISABLE_WARNING(6326)\ |
| class benchmark : public cobalt::trace_event::Benchmark {\ |
| public:\ |
| void Experiment() override;\ |
| void AnalyzeTraceEvent(\ |
| const scoped_refptr<cobalt::trace_event::EventParser::ScopedEvent>& \ |
| event)\ |
| override {\ |
| if (event->name() == event_name_1) {\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_1_last_begin_time_.is_null()) {\ |
| event_1_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_1_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_1_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_2) {\ |
| switch (measurement_type_2) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_2_last_begin_time_.is_null()) {\ |
| event_2_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_2_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_2_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_3) {\ |
| switch (measurement_type_3) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_3_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_3_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_3_last_begin_time_.is_null()) {\ |
| event_3_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_3_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_3_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_4) {\ |
| switch (measurement_type_4) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_4_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_4_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_4_last_begin_time_.is_null()) {\ |
| event_4_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_4_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_4_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_5) {\ |
| switch (measurement_type_5) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_5_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_5_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_5_last_begin_time_.is_null()) {\ |
| event_5_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_5_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_5_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_6) {\ |
| switch (measurement_type_6) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_6_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_6_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_6_last_begin_time_.is_null()) {\ |
| event_6_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_6_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_6_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_7) {\ |
| switch (measurement_type_7) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_7_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_7_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_7_last_begin_time_.is_null()) {\ |
| event_7_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_7_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_7_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_8) {\ |
| switch (measurement_type_8) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_8_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_8_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_8_last_begin_time_.is_null()) {\ |
| event_8_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_8_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_8_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_9) {\ |
| switch (measurement_type_9) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_9_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_9_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_9_last_begin_time_.is_null()) {\ |
| event_9_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_9_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_9_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| }\ |
| std::vector<Result> CompileResults() override {\ |
| std::vector<Result> results;\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " flow duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " in-scope duration in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_1) +\ |
| " time between event starts in seconds", \ |
| event_1_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_2) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " flow duration in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " in-scope duration in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_2) +\ |
| " time between event starts in seconds", \ |
| event_2_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_3) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " flow duration in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " in-scope duration in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_3) +\ |
| " time between event starts in seconds", \ |
| event_3_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_4) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " flow duration in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " in-scope duration in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_4) +\ |
| " time between event starts in seconds", \ |
| event_4_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_5) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_5) +\ |
| " flow duration in seconds", \ |
| event_5_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_5) +\ |
| " in-scope duration in seconds", \ |
| event_5_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_5) +\ |
| " time between event starts in seconds", \ |
| event_5_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_6) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_6) +\ |
| " flow duration in seconds", \ |
| event_6_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_6) +\ |
| " in-scope duration in seconds", \ |
| event_6_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_6) +\ |
| " time between event starts in seconds", \ |
| event_6_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_7) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_7) +\ |
| " flow duration in seconds", \ |
| event_7_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_7) +\ |
| " in-scope duration in seconds", \ |
| event_7_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_7) +\ |
| " time between event starts in seconds", \ |
| event_7_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_8) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_8) +\ |
| " flow duration in seconds", \ |
| event_8_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_8) +\ |
| " in-scope duration in seconds", \ |
| event_8_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_8) +\ |
| " time between event starts in seconds", \ |
| event_8_samples_));\ |
| } break;\ |
| }\ |
| switch (measurement_type_9) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_9) +\ |
| " flow duration in seconds", \ |
| event_9_samples_));\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| results.push_back(\ |
| Result(std::string(event_name_9) +\ |
| " in-scope duration in seconds", \ |
| event_9_samples_));\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| results.push_back(\ |
| Result(std::string(event_name_9) +\ |
| " time between event starts in seconds", \ |
| event_9_samples_));\ |
| } break;\ |
| }\ |
| return results;\ |
| }\ |
| private:\ |
| std::vector<double> event_1_samples_;\ |
| base::TimeTicks event_1_last_begin_time_;\ |
| std::vector<double> event_2_samples_;\ |
| base::TimeTicks event_2_last_begin_time_;\ |
| std::vector<double> event_3_samples_;\ |
| base::TimeTicks event_3_last_begin_time_;\ |
| std::vector<double> event_4_samples_;\ |
| base::TimeTicks event_4_last_begin_time_;\ |
| std::vector<double> event_5_samples_;\ |
| base::TimeTicks event_5_last_begin_time_;\ |
| std::vector<double> event_6_samples_;\ |
| base::TimeTicks event_6_last_begin_time_;\ |
| std::vector<double> event_7_samples_;\ |
| base::TimeTicks event_7_last_begin_time_;\ |
| std::vector<double> event_8_samples_;\ |
| base::TimeTicks event_8_last_begin_time_;\ |
| std::vector<double> event_9_samples_;\ |
| base::TimeTicks event_9_last_begin_time_;\ |
| };\ |
| \ |
| TRACE_EVENT_REGISTER_BENCHMARK(benchmark)\ |
| \ |
| void benchmark::Experiment()\ |
| MSVC_POP_WARNING() |
| |
| #define TRACE_EVENT_BENCHMARK10(benchmark, event_name_1, measurement_type_1, \ |
| event_name_2, measurement_type_2, event_name_3, measurement_type_3, \ |
| event_name_4, measurement_type_4, event_name_5, measurement_type_5, \ |
| event_name_6, measurement_type_6, event_name_7, measurement_type_7, \ |
| event_name_8, measurement_type_8, event_name_9, measurement_type_9, \ |
| event_name_10, measurement_type_10)\ |
| MSVC_PUSH_DISABLE_WARNING(6326)\ |
| class benchmark : public cobalt::trace_event::Benchmark {\ |
| public:\ |
| void Experiment() override;\ |
| void AnalyzeTraceEvent(\ |
| const scoped_refptr<cobalt::trace_event::EventParser::ScopedEvent>& \ |
| event)\ |
| override {\ |
| if (event->name() == event_name_1) {\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_1_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_1_last_begin_time_.is_null()) {\ |
| event_1_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_1_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_1_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_2) {\ |
| switch (measurement_type_2) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_2_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_2_last_begin_time_.is_null()) {\ |
| event_2_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_2_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_2_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_3) {\ |
| switch (measurement_type_3) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_3_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_3_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_3_last_begin_time_.is_null()) {\ |
| event_3_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_3_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_3_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_4) {\ |
| switch (measurement_type_4) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_4_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_4_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_4_last_begin_time_.is_null()) {\ |
| event_4_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_4_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_4_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_5) {\ |
| switch (measurement_type_5) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_5_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_5_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_5_last_begin_time_.is_null()) {\ |
| event_5_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_5_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_5_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_6) {\ |
| switch (measurement_type_6) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_6_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_6_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_6_last_begin_time_.is_null()) {\ |
| event_6_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_6_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_6_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_7) {\ |
| switch (measurement_type_7) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_7_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_7_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_7_last_begin_time_.is_null()) {\ |
| event_7_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_7_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_7_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_8) {\ |
| switch (measurement_type_8) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_8_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_8_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_8_last_begin_time_.is_null()) {\ |
| event_8_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_8_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_8_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_9) {\ |
| switch (measurement_type_9) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_9_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_9_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_9_last_begin_time_.is_null()) {\ |
| event_9_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_9_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_9_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| if (event->name() == event_name_10) {\ |
| switch (measurement_type_10) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| if (event->flow_duration()) {\ |
| event_10_samples_.push_back(\ |
| event->flow_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::IN_SCOPE_DURATION: {\ |
| if (event->in_scope_duration()) {\ |
| event_10_samples_.push_back(\ |
| event->in_scope_duration()->InSecondsF());\ |
| }\ |
| } break;\ |
| case cobalt::trace_event::TIME_BETWEEN_EVENT_STARTS: {\ |
| if (!event_10_last_begin_time_.is_null()) {\ |
| event_10_samples_.push_back(\ |
| (event->begin_event().timestamp() -\ |
| event_10_last_begin_time_).InSecondsF());\ |
| }\ |
| } break;\ |
| }\ |
| \ |
| event_10_last_begin_time_ = event->begin_event().timestamp();\ |
| }\ |
| }\ |
| std::vector<Result> CompileResults() override {\ |
| std::vector<Result> results;\ |
| switch (measurement_type_1) {\ |
| case cobalt::trace_event::FLOW_DURATION: {\ |
| results.push_back(\ |
| |