Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Issue 2241093002: RTCStats and RTCStatsReport added (webrtc/stats) (Closed)

Created:
4 years, 4 months ago by hbos
Modified:
4 years ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, qiang.lu, niklas.enbom, yujie_mao (webrtc), peah-webrtc
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

RTCStats and RTCStatsReport added (webrtc/stats). The old and new getStats are very different. This CL proposes rewriting the new getStats from scratch with a bottom-up approach, starting with the fundamental stats classes. This will allow cleaner and more efficient code that is more aligned with the spec. RTCStats and subclasses are the equivalent to RTCStats and RTCStats- -derived dictionaries from the specs[1][2]. The dictionary members are public member variables of type RTCStatsMember<T>, where T is one of the supported types. All members derive from RTCStatsMemberInterface and iteration of members is possible with RTCStats::Members(). The members are not stored in a map for performance and readability. Type checking is supported with static class variables, kType. Only the supported member types T are specialized and may be instantiated, and sequences are supported with std::vector<...>. Type checking is again supported with static class variables, kType. RTCStatsReport is the equivalent from the spec[3], and maps RTCStats::id to RTCStats-objects. RTCStatsReport is reference counted. It and its contained stats may be destroyed on any thread. When the RTCStatsCollector is added in a follow-up CL, it will return const references to the RTCStatsReports. This means copies don't have to be made for multiple stats observers or when jumping threads. In fact, no copies of any stats will have to be made in surfacing stats to Blink. [1] https://www.w3.org/TR/2016/WD-webrtc-20160531/#rtcstats-dictionary [2] https://w3c.github.io/webrtc-stats/archives/20160526/webrtc-stats.html [3] https://www.w3.org/TR/2016/WD-webrtc-20160531/#rtcstatsreport-object This adds the new folder webrtc/stats/, with target rtc_stats and binary rtc_stats_unittests. Public api headers are placed in webrtc/api/ and .cc files are placed in webrtc/stats/. BUG=chromium:627816 Committed: https://crrev.com/615d3013de815e52a1536a8c4c068b91c814ccdd Cr-Commit-Position: refs/heads/master@{#13879}

Patch Set 1 #

Total comments: 15

Patch Set 2 : Addressed kjellander's comments #

Patch Set 3 : Removed find_bad_constructs and GYP android test dep (but not GN android) #

Total comments: 26

Patch Set 4 : Addressed hta's comments #

Patch Set 5 : WEBRTC_RTCSTATS_IMPL macro avoiding any boilerplate code in RTCStats subclasses #

Patch Set 6 : Updated comments #

Total comments: 14

Patch Set 7 : Addressed hta's comments #

Patch Set 8 : #if condition for EXPECT_DEATH tests #

Total comments: 30

Patch Set 9 : Addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+916 lines, -1 line) Patch
M all.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/BUILD.gn View 1 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/api/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M webrtc/api/api.gyp View 1 chunk +2 lines, -0 lines 0 comments Download
A webrtc/api/rtcstats.h View 1 2 3 4 5 6 7 8 1 chunk +283 lines, -0 lines 0 comments Download
A webrtc/api/rtcstatsreport.h View 1 2 3 4 5 6 7 8 1 chunk +86 lines, -0 lines 0 comments Download
A webrtc/stats/BUILD.gn View 1 2 1 chunk +56 lines, -0 lines 0 comments Download
A + webrtc/stats/DEPS View 1 chunk +1 line, -1 line 0 comments Download
A webrtc/stats/OWNERS View 1 chunk +2 lines, -0 lines 0 comments Download
A webrtc/stats/rtcstats.cc View 1 2 3 4 5 6 7 8 1 chunk +132 lines, -0 lines 0 comments Download
A webrtc/stats/rtcstats_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +219 lines, -0 lines 0 comments Download
A webrtc/stats/rtcstatsreport.cc View 1 1 chunk +86 lines, -0 lines 0 comments Download
A webrtc/stats/stats.gyp View 1 2 1 chunk +45 lines, -0 lines 0 comments Download

Messages

Total messages: 48 (21 generated)
hbos
Please take a look, tommi, hta and kjellander. tommi/hta for everything. kjellander primarily for the ...
4 years, 4 months ago (2016-08-13 08:31:39 UTC) #9
hbos
pthatcher, can you take a look? tommi is OOO for two weeks.
4 years, 4 months ago (2016-08-15 09:21:14 UTC) #12
kjellander_webrtc
https://codereview.webrtc.org/2241093002/diff/40001/webrtc/BUILD.gn File webrtc/BUILD.gn (right): https://codereview.webrtc.org/2241093002/diff/40001/webrtc/BUILD.gn#newcode262 webrtc/BUILD.gn:262: "stats:rtc_stats", On 2016/08/13 08:31:39, hbos wrote: > Should I ...
4 years, 4 months ago (2016-08-15 11:21:51 UTC) #13
hbos
PTAL kjellander https://codereview.webrtc.org/2241093002/diff/40001/webrtc/BUILD.gn File webrtc/BUILD.gn (right): https://codereview.webrtc.org/2241093002/diff/40001/webrtc/BUILD.gn#newcode262 webrtc/BUILD.gn:262: "stats:rtc_stats", On 2016/08/15 11:21:51, kjellander_webrtc wrote: > ...
4 years, 4 months ago (2016-08-15 13:27:12 UTC) #14
kjellander_webrtc
https://codereview.webrtc.org/2241093002/diff/40001/webrtc/stats/BUILD.gn File webrtc/stats/BUILD.gn (right): https://codereview.webrtc.org/2241093002/diff/40001/webrtc/stats/BUILD.gn#newcode25 webrtc/stats/BUILD.gn:25: configs -= [ "//build/config/clang:find_bad_constructs" ] On 2016/08/15 13:27:11, hbos ...
4 years, 4 months ago (2016-08-15 13:34:20 UTC) #15
hbos
There we go. https://codereview.webrtc.org/2241093002/diff/40001/webrtc/stats/BUILD.gn File webrtc/stats/BUILD.gn (right): https://codereview.webrtc.org/2241093002/diff/40001/webrtc/stats/BUILD.gn#newcode25 webrtc/stats/BUILD.gn:25: configs -= [ "//build/config/clang:find_bad_constructs" ] On ...
4 years, 4 months ago (2016-08-15 13:57:58 UTC) #16
kjellander_webrtc
lgtm
4 years, 4 months ago (2016-08-15 14:37:14 UTC) #17
hbos
Cool, looksies pthatcher and hta? :)
4 years, 4 months ago (2016-08-15 14:38:58 UTC) #18
hta - Chromium
Looks good, as usual a bunch of nits wrt (hopefully) making the code more readable. ...
4 years, 4 months ago (2016-08-15 15:14:57 UTC) #20
hbos
PTAL hta, pthatcher. https://codereview.webrtc.org/2241093002/diff/80001/webrtc/api/rtcstats.h File webrtc/api/rtcstats.h (right): https://codereview.webrtc.org/2241093002/diff/80001/webrtc/api/rtcstats.h#newcode27 webrtc/api/rtcstats.h:27: // http://rawgit.com/w3c/webrtc-stats/master/webrtc-stats.html. On 2016/08/15 15:14:57, hta ...
4 years, 4 months ago (2016-08-15 22:46:44 UTC) #21
hbos
Update, patch set 5: I was able to solve the problem of having to write ...
4 years, 4 months ago (2016-08-16 11:10:38 UTC) #22
hbos
Bump, PTAL pthatcher and hta.
4 years, 4 months ago (2016-08-18 08:10:11 UTC) #24
hta-webrtc
Reviewed the files that changed since my last review. I would like someone with more ...
4 years, 4 months ago (2016-08-22 07:01:53 UTC) #25
hbos
Please take a look, nisse. rtcstats.[h/cc] uses the C++ wizardry of macros and templates. https://codereview.webrtc.org/2241093002/diff/160001/webrtc/api/rtcstats.h ...
4 years, 4 months ago (2016-08-22 15:17:37 UTC) #28
nisse-webrtc
I've had a first read, focusing on the macrology. https://codereview.webrtc.org/2241093002/diff/220001/webrtc/api/rtcstats.h File webrtc/api/rtcstats.h (right): https://codereview.webrtc.org/2241093002/diff/220001/webrtc/api/rtcstats.h#newcode66 webrtc/api/rtcstats.h:66: ...
4 years, 4 months ago (2016-08-23 08:27:29 UTC) #29
hta - Chromium
lgtm I think I like this one now (modulo nisse's commentary + a few nits). ...
4 years, 4 months ago (2016-08-23 14:25:13 UTC) #30
hbos
PTAL nisse, pthatcher. https://codereview.webrtc.org/2241093002/diff/220001/webrtc/api/rtcstats.h File webrtc/api/rtcstats.h (right): https://codereview.webrtc.org/2241093002/diff/220001/webrtc/api/rtcstats.h#newcode66 webrtc/api/rtcstats.h:66: virtual const char* const* type() const ...
4 years, 4 months ago (2016-08-23 16:21:18 UTC) #32
hta-webrtc
lgtm
4 years, 4 months ago (2016-08-23 16:27:16 UTC) #33
hta-webrtc
lgtm
4 years, 4 months ago (2016-08-23 16:27:20 UTC) #34
hbos
glaznev, can you take a look as a webrtc/api OWNER? (Both pthatcher and tommi have ...
4 years, 4 months ago (2016-08-23 16:31:42 UTC) #36
AlexG
On 2016/08/23 16:31:42, hbos wrote: > glaznev, can you take a look as a webrtc/api ...
4 years, 4 months ago (2016-08-23 22:37:53 UTC) #38
AlexG
lgtm
4 years, 4 months ago (2016-08-23 22:38:45 UTC) #39
nisse-webrtc
lgtm
4 years, 4 months ago (2016-08-24 08:17:33 UTC) #40
hbos
On 2016/08/23 22:37:53, AlexG wrote: > On 2016/08/23 16:31:42, hbos wrote: > > glaznev, can ...
4 years, 4 months ago (2016-08-24 08:24:12 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2241093002/260001
4 years, 4 months ago (2016-08-24 08:24:33 UTC) #44
commit-bot: I haz the power
Committed patchset #9 (id:260001)
4 years, 4 months ago (2016-08-24 08:33:17 UTC) #46
commit-bot: I haz the power
4 years, 4 months ago (2016-08-24 08:33:23 UTC) #48
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/615d3013de815e52a1536a8c4c068b91c814ccdd
Cr-Commit-Position: refs/heads/master@{#13879}

Powered by Google App Engine
This is Rietveld 408576698