OLD | NEW |
---|---|
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 23 matching lines...) Expand all Loading... | |
34 #include "talk/app/webrtc/peerconnectioninterface.h" | 34 #include "talk/app/webrtc/peerconnectioninterface.h" |
35 #include "webrtc/base/thread_checker.h" | 35 #include "webrtc/base/thread_checker.h" |
36 | 36 |
37 namespace webrtc { | 37 namespace webrtc { |
38 | 38 |
39 class FakeMetricsObserver : public MetricsObserverInterface { | 39 class FakeMetricsObserver : public MetricsObserverInterface { |
40 public: | 40 public: |
41 FakeMetricsObserver(); | 41 FakeMetricsObserver(); |
42 void Reset(); | 42 void Reset(); |
43 | 43 |
44 void IncrementCounter(PeerConnectionMetricsCounter type) override; | 44 void IncrementEnumCounter(PeerConnectionEnumCounterType, |
45 int counter, | |
46 int counter_max) override; | |
45 void AddHistogramSample(PeerConnectionMetricsName type, | 47 void AddHistogramSample(PeerConnectionMetricsName type, |
46 int value) override; | 48 int value) override; |
47 void AddHistogramSample(PeerConnectionMetricsName type, | 49 void AddHistogramSample(PeerConnectionMetricsName type, |
48 const std::string& value) override; | 50 const std::string& value) override; |
49 | 51 |
50 // Accessors to be used by the tests. | 52 // Accessors to be used by the tests. |
51 int GetCounter(PeerConnectionMetricsCounter type) const; | 53 int GetCounter(PeerConnectionEnumCounterType type, int counter) const; |
pthatcher1
2015/08/18 18:06:22
If you renamed one to IncrementEnumCounter, should
guoweis_webrtc
2015/08/18 22:33:57
Done.
| |
52 int GetIntHistogramSample(PeerConnectionMetricsName type) const; | 54 int GetIntHistogramSample(PeerConnectionMetricsName type) const; |
53 const std::string& GetStringHistogramSample( | 55 const std::string& GetStringHistogramSample( |
54 PeerConnectionMetricsName type) const; | 56 PeerConnectionMetricsName type) const; |
55 | 57 |
56 protected: | 58 protected: |
57 ~FakeMetricsObserver() {} | 59 ~FakeMetricsObserver() {} |
58 | 60 |
59 private: | 61 private: |
60 rtc::ThreadChecker thread_checker_; | 62 rtc::ThreadChecker thread_checker_; |
61 int counters_[kPeerConnectionMetricsCounter_Max]; | 63 std::vector<std::vector<int>> counters_; |
pthatcher1
2015/08/18 18:06:22
Can you put a comment about what the indexes are (
guoweis_webrtc
2015/08/18 22:33:57
Done.
| |
62 int int_histogram_samples_[kPeerConnectionMetricsCounter_Max]; | 64 int int_histogram_samples_[kPeerConnectionMetricsName_Max]; |
pthatcher1
2015/08/18 18:06:22
It seems like you should have an array of vectors
guoweis_webrtc
2015/08/18 22:33:57
histogram_samples use string to track each sample
| |
63 std::string string_histogram_samples_[kPeerConnectionMetricsName_Max]; | 65 std::string string_histogram_samples_[kPeerConnectionMetricsName_Max]; |
64 }; | 66 }; |
65 | 67 |
66 } // namespace webrtc | 68 } // namespace webrtc |
67 | 69 |
68 #endif // TALK_APP_WEBRTC_FAKEMETRICSOBSERVER_H_ | 70 #endif // TALK_APP_WEBRTC_FAKEMETRICSOBSERVER_H_ |
OLD | NEW |