| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 #define BWE_TEST_LOGGING_LOG3(name, format, _1, _2, _3) | 84 #define BWE_TEST_LOGGING_LOG3(name, format, _1, _2, _3) |
| 85 #define BWE_TEST_LOGGING_LOG4(name, format, _1, _2, _3, _4) | 85 #define BWE_TEST_LOGGING_LOG4(name, format, _1, _2, _3, _4) |
| 86 #define BWE_TEST_LOGGING_LOG5(name, format, _1, _2, _3, _4, _5) | 86 #define BWE_TEST_LOGGING_LOG5(name, format, _1, _2, _3, _4, _5) |
| 87 | 87 |
| 88 // Print to stdout in tab-separated format suitable for plotting, e.g.: | 88 // Print to stdout in tab-separated format suitable for plotting, e.g.: |
| 89 // PLOT figure Context1_Context2_Name time value | 89 // PLOT figure Context1_Context2_Name time value |
| 90 // |figure| is a figure id. Different figures are plotted in different windows. | 90 // |figure| is a figure id. Different figures are plotted in different windows. |
| 91 // |name| is a char*, std::string or uint32_t to name the plotted value. | 91 // |name| is a char*, std::string or uint32_t to name the plotted value. |
| 92 // |time| is an int64_t time in ms, or -1 to inherit time from previous context. | 92 // |time| is an int64_t time in ms, or -1 to inherit time from previous context. |
| 93 // |value| is a double precision float to be plotted. | 93 // |value| is a double precision float to be plotted. |
| 94 // |ssrc| identifies the source of a stream |
| 94 // |alg_name| is an optional argument, a string | 95 // |alg_name| is an optional argument, a string |
| 95 #define BWE_TEST_LOGGING_PLOT(figure, name, time, value) | 96 #define BWE_TEST_LOGGING_PLOT(figure, name, time, value) |
| 96 #define BWE_TEST_LOGGING_PLOT_WITH_NAME(figure, name, time, value, alg_name) | 97 #define BWE_TEST_LOGGING_PLOT_WITH_NAME(figure, name, time, value, alg_name) |
| 98 #define BWE_TEST_LOGGING_PLOT_WITH_SSRC(figure, name, time, value, ssrc) |
| 99 #define BWE_TEST_LOGGING_PLOT_WITH_NAME_AND_SSRC(figure, name, time, value, \ |
| 100 ssrc, alg_name) |
| 97 | 101 |
| 98 // Print to stdout in tab-separated format suitable for plotting, e.g.: | 102 // Print to stdout in tab-separated format suitable for plotting, e.g.: |
| 99 // BAR figure Context1_Context2_Name x_left width value | 103 // BAR figure Context1_Context2_Name x_left width value |
| 100 // |figure| is a figure id. Different figures are plotted in different windows. | 104 // |figure| is a figure id. Different figures are plotted in different windows. |
| 101 // |name| is a char*, std::string or uint32_t to name the plotted value. | 105 // |name| is a char*, std::string or uint32_t to name the plotted value. |
| 102 // |value| is a double precision float to be plotted. | 106 // |value| is a double precision float to be plotted. |
| 103 // |ylow| and |yhigh| are double precision float for the error line. | 107 // |ylow| and |yhigh| are double precision float for the error line. |
| 104 // |title| is a string and refers to the error label. | 108 // |title| is a string and refers to the error label. |
| 105 // |ymax| is a double precision float for the limit horizontal line. | 109 // |ymax| is a double precision float for the limit horizontal line. |
| 106 // |limit_title| is a string and refers to the limit label. | 110 // |limit_title| is a string and refers to the limit label. |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 } while (0) | 191 } while (0) |
| 188 | 192 |
| 189 #define BWE_TEST_LOGGING_PLOT_WITH_NAME(figure, name, time, value, alg_name) \ | 193 #define BWE_TEST_LOGGING_PLOT_WITH_NAME(figure, name, time, value, alg_name) \ |
| 190 do { \ | 194 do { \ |
| 191 __BWE_TEST_LOGGING_CONTEXT_DECLARE(__bwe_log_, __PLOT__, name, \ | 195 __BWE_TEST_LOGGING_CONTEXT_DECLARE(__bwe_log_, __PLOT__, name, \ |
| 192 static_cast<int64_t>(time), true); \ | 196 static_cast<int64_t>(time), true); \ |
| 193 webrtc::testing::bwe::Logging::GetInstance()->Plot(figure, value, \ | 197 webrtc::testing::bwe::Logging::GetInstance()->Plot(figure, value, \ |
| 194 alg_name); \ | 198 alg_name); \ |
| 195 } while (0) | 199 } while (0) |
| 196 | 200 |
| 201 #define BWE_TEST_LOGGING_PLOT_WITH_SSRC(figure, name, time, value, ssrc) \ |
| 202 do { \ |
| 203 __BWE_TEST_LOGGING_CONTEXT_DECLARE(__bwe_log_, __PLOT__, name, \ |
| 204 static_cast<int64_t>(time), true); \ |
| 205 webrtc::testing::bwe::Logging::GetInstance()->Plot(figure, value, ssrc); \ |
| 206 } while (0) |
| 207 |
| 208 #define BWE_TEST_LOGGING_PLOT_WITH_NAME_AND_SSRC(figure, name, time, value, \ |
| 209 ssrc, alg_name) \ |
| 210 do { \ |
| 211 __BWE_TEST_LOGGING_CONTEXT_DECLARE(__bwe_log_, __PLOT__, name, \ |
| 212 static_cast<int64_t>(time), true); \ |
| 213 webrtc::testing::bwe::Logging::GetInstance()->Plot(figure, value, ssrc, \ |
| 214 alg_name); \ |
| 215 } while (0) |
| 216 |
| 197 #define BWE_TEST_LOGGING_BAR(figure, name, value, flow_id) \ | 217 #define BWE_TEST_LOGGING_BAR(figure, name, value, flow_id) \ |
| 198 do { \ | 218 do { \ |
| 199 BWE_TEST_LOGGING_CONTEXT(name); \ | 219 BWE_TEST_LOGGING_CONTEXT(name); \ |
| 200 webrtc::testing::bwe::Logging::GetInstance()->PlotBar(figure, name, value, \ | 220 webrtc::testing::bwe::Logging::GetInstance()->PlotBar(figure, name, value, \ |
| 201 flow_id); \ | 221 flow_id); \ |
| 202 } while (0) | 222 } while (0) |
| 203 | 223 |
| 204 #define BWE_TEST_LOGGING_BASELINEBAR(figure, name, value, flow_id) \ | 224 #define BWE_TEST_LOGGING_BASELINEBAR(figure, name, value, flow_id) \ |
| 205 do { \ | 225 do { \ |
| 206 BWE_TEST_LOGGING_CONTEXT(name); \ | 226 BWE_TEST_LOGGING_CONTEXT(name); \ |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 static Logging* GetInstance(); | 274 static Logging* GetInstance(); |
| 255 | 275 |
| 256 void SetGlobalContext(uint32_t name); | 276 void SetGlobalContext(uint32_t name); |
| 257 void SetGlobalContext(const std::string& name); | 277 void SetGlobalContext(const std::string& name); |
| 258 void SetGlobalContext(const char* name); | 278 void SetGlobalContext(const char* name); |
| 259 void SetGlobalEnable(bool enabled); | 279 void SetGlobalEnable(bool enabled); |
| 260 | 280 |
| 261 void Log(const char format[], ...); | 281 void Log(const char format[], ...); |
| 262 void Plot(int figure, double value); | 282 void Plot(int figure, double value); |
| 263 void Plot(int figure, double value, const std::string& alg_name); | 283 void Plot(int figure, double value, const std::string& alg_name); |
| 284 void Plot(int figure, double value, uint32_t ssrc); |
| 285 void Plot(int figure, |
| 286 double value, |
| 287 uint32_t ssrc, |
| 288 const std::string& alg_name); |
| 264 void PlotBar(int figure, const std::string& name, double value, int flow_id); | 289 void PlotBar(int figure, const std::string& name, double value, int flow_id); |
| 265 void PlotBaselineBar(int figure, | 290 void PlotBaselineBar(int figure, |
| 266 const std::string& name, | 291 const std::string& name, |
| 267 double value, | 292 double value, |
| 268 int flow_id); | 293 int flow_id); |
| 269 void PlotErrorBar(int figure, | 294 void PlotErrorBar(int figure, |
| 270 const std::string& name, | 295 const std::string& name, |
| 271 double value, | 296 double value, |
| 272 double ylow, | 297 double ylow, |
| 273 double yhigh, | 298 double yhigh, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 ThreadMap thread_map_; | 339 ThreadMap thread_map_; |
| 315 | 340 |
| 316 RTC_DISALLOW_COPY_AND_ASSIGN(Logging); | 341 RTC_DISALLOW_COPY_AND_ASSIGN(Logging); |
| 317 }; | 342 }; |
| 318 } // namespace bwe | 343 } // namespace bwe |
| 319 } // namespace testing | 344 } // namespace testing |
| 320 } // namespace webrtc | 345 } // namespace webrtc |
| 321 | 346 |
| 322 #endif // BWE_TEST_LOGGING_COMPILE_TIME_ENABLE | 347 #endif // BWE_TEST_LOGGING_COMPILE_TIME_ENABLE |
| 323 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_LOGGING_H_ | 348 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_LOGGING_H_ |
| OLD | NEW |