|
|
Created:
3 years, 3 months ago by ilnik Modified:
3 years, 3 months ago CC:
webrtc-reviews_webrtc.org, video-team_agora.io, yujie_mao (webrtc), zhengzhonghou_agora.io, stefan-webrtc, tterriberry_mozilla.com, kwiberg-webrtc, the sun, mflodman Target Ref:
refs/heads/master Project:
webrtc Visibility:
Public. |
DescriptionImplement googContentType GetStats metric reported on receive side.
Reported per video stream as a string.
BUG=webrtc:8174
Review-Url: https://codereview.webrtc.org/3009793002
Cr-Commit-Position: refs/heads/master@{#19667}
Committed: https://chromium.googlesource.com/external/webrtc/+/2e1b40bdf63743b07388628707c4b8e349495807
Patch Set 1 #
Total comments: 2
Patch Set 2 : fix identation #Patch Set 3 : rebase #Patch Set 4 : rebase #Patch Set 5 : Fix ce #
Total comments: 16
Patch Set 6 : Implement Tommi@ comments #Patch Set 7 : Change content_type to be enum until the latest possible point #Patch Set 8 : Fix uninitialized variable error #Patch Set 9 : Fix uninitialized value error pass 2 #
Total comments: 2
Patch Set 10 : Implement Tommi@ comments #Patch Set 11 : Rebase #Patch Set 12 : Fix broken tests on ASAN #
Depends on Patchset: Messages
Total messages: 64 (39 generated)
ilnik@webrtc.org changed reviewers: + deadbeef@webrtc.org, sprang@webrtc.org
Hello, please review it in Wednesday morning, as we really want this metric landed before the chromium roll cut.
lgtm https://codereview.webrtc.org/3009793002/diff/1/webrtc/pc/statscollector.cc File webrtc/pc/statscollector.cc (right): https://codereview.webrtc.org/3009793002/diff/1/webrtc/pc/statscollector.cc#n... webrtc/pc/statscollector.cc:274: info.content_type); nit: indentation
https://codereview.webrtc.org/3009793002/diff/1/webrtc/pc/statscollector.cc File webrtc/pc/statscollector.cc (right): https://codereview.webrtc.org/3009793002/diff/1/webrtc/pc/statscollector.cc#n... webrtc/pc/statscollector.cc:274: info.content_type); On 2017/08/29 16:38:13, sprang_webrtc wrote: > nit: indentation Done.
lgtm
On 2017/08/29 16:53:47, Taylor Brandstetter wrote: > lgtm Thank you for very fast review!
The CQ bit was checked by ilnik@webrtc.org
The patchset sent to the CQ was uploaded after l-g-t-m from sprang@webrtc.org Link to the patchset: https://codereview.webrtc.org/3009793002/#ps20001 (title: "fix identation")
The CQ bit was unchecked by ilnik@webrtc.org
The CQ bit was checked by ilnik@webrtc.org
The patchset sent to the CQ was uploaded after l-g-t-m from sprang@webrtc.org, deadbeef@webrtc.org Link to the patchset: https://codereview.webrtc.org/3009793002/#ps60001 (title: "rebase")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: ios64_sim_ios10_dbg on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/ios64_sim_ios10_dbg/bui...) ios_arm64_dbg on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/ios_arm64_dbg/builds/23421)
The CQ bit was checked by ilnik@webrtc.org
The patchset sent to the CQ was uploaded after l-g-t-m from sprang@webrtc.org, deadbeef@webrtc.org Link to the patchset: https://codereview.webrtc.org/3009793002/#ps80001 (title: "Fix ce")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: presubmit on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/presubmit/builds/20965)
Description was changed from ========== Implement googContentType GetStats metric reported on receive side. Reported per video stream as a string. BUG=webrtc:8174 ========== to ========== Implement googContentType GetStats metric reported on receive side. Reported per video stream as a string. BUG=webrtc:8174 ==========
ilnik@webrtc.org changed reviewers: + stefan@webrtc.org
The CQ bit was checked by ilnik@webrtc.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
tommi@webrtc.org changed reviewers: + tommi@webrtc.org
https://codereview.webrtc.org/3009793002/diff/80001/webrtc/api/statstypes.cc File webrtc/api/statstypes.cc (right): https://codereview.webrtc.org/3009793002/diff/80001/webrtc/api/statstypes.cc#... webrtc/api/statstypes.cc:523: case kStatsValueNameContentType: see for example where kStatsValueNameCurrentDelayMs is, in the header file. https://codereview.webrtc.org/3009793002/diff/80001/webrtc/api/statstypes.h File webrtc/api/statstypes.h (right): https://codereview.webrtc.org/3009793002/diff/80001/webrtc/api/statstypes.h#n... webrtc/api/statstypes.h:108: kStatsValueNameContentType, is this stats value not an 'internal' StatsValue name? (see below) In general we should avoid adding 'goog' prefixed values and if we do, then I think (iirc) that those should be considered internal. https://codereview.webrtc.org/3009793002/diff/80001/webrtc/call/video_receive... File webrtc/call/video_receive_stream.h (right): https://codereview.webrtc.org/3009793002/diff/80001/webrtc/call/video_receive... webrtc/call/video_receive_stream.h:90: // "screen" vs "realtime". if these are fixed constants, can we use const char* instead of allocating memory and make construction/destruction slightly more complex? Alternatively, can this be an enum? https://codereview.webrtc.org/3009793002/diff/80001/webrtc/media/base/mediach... File webrtc/media/base/mediachannel.h (right): https://codereview.webrtc.org/3009793002/diff/80001/webrtc/media/base/mediach... webrtc/media/base/mediachannel.h:799: std::string content_type; same concern here as in the other header https://codereview.webrtc.org/3009793002/diff/80001/webrtc/video/receive_stat... File webrtc/video/receive_statistics_proxy.cc (right): https://codereview.webrtc.org/3009793002/diff/80001/webrtc/video/receive_stat... webrtc/video/receive_statistics_proxy.cc:505: stats_.content_type = "realtime"; fyi - the code generation for this statement generates code for two calls to the assignment operator. An alternative could be: stats_.content_type = videocontenttypehelpers::IsScreenshare(last_content_type_) : "screen" : "realtime"; https://codereview.webrtc.org/3009793002/diff/80001/webrtc/video/receive_stat... File webrtc/video/receive_statistics_proxy_unittest.cc (right): https://codereview.webrtc.org/3009793002/diff/80001/webrtc/video/receive_stat... webrtc/video/receive_statistics_proxy_unittest.cc:104: VideoContentType::SCREENSHARE); indentation seems off. can you run git cl format?
https://codereview.webrtc.org/3009793002/diff/80001/webrtc/api/statstypes.cc File webrtc/api/statstypes.cc (right): https://codereview.webrtc.org/3009793002/diff/80001/webrtc/api/statstypes.cc#... webrtc/api/statstypes.cc:523: case kStatsValueNameContentType: On 2017/08/30 15:03:27, tommi wrote: > see for example where kStatsValueNameCurrentDelayMs is, in the header file. Moved it to alphabetically correct place. https://codereview.webrtc.org/3009793002/diff/80001/webrtc/api/statstypes.h File webrtc/api/statstypes.h (right): https://codereview.webrtc.org/3009793002/diff/80001/webrtc/api/statstypes.h#n... webrtc/api/statstypes.h:108: kStatsValueNameContentType, On 2017/08/30 15:03:27, tommi wrote: > is this stats value not an 'internal' StatsValue name? (see below) > In general we should avoid adding 'goog' prefixed values and if we do, then I > think (iirc) that those should be considered internal. Yes, It should be in the internal values below. Moved it and another one I've added recently there. https://codereview.webrtc.org/3009793002/diff/80001/webrtc/call/video_receive... File webrtc/call/video_receive_stream.h (right): https://codereview.webrtc.org/3009793002/diff/80001/webrtc/call/video_receive... webrtc/call/video_receive_stream.h:90: // "screen" vs "realtime". On 2017/08/30 15:03:27, tommi wrote: > if these are fixed constants, can we use const char* instead of allocating > memory and make construction/destruction slightly more complex? Alternatively, > can this be an enum? Enum is absolutely not suitable here, as we want it to be flexible. Also, another enum for ContentType is annoying. char* is problematic for the same reasons. What if we decide to put additional information in here (like simulcast layers and experiment id). https://codereview.webrtc.org/3009793002/diff/80001/webrtc/media/base/mediach... File webrtc/media/base/mediachannel.h (right): https://codereview.webrtc.org/3009793002/diff/80001/webrtc/media/base/mediach... webrtc/media/base/mediachannel.h:799: std::string content_type; On 2017/08/30 15:03:27, tommi wrote: > same concern here as in the other header See the answer in the other header. https://codereview.webrtc.org/3009793002/diff/80001/webrtc/video/receive_stat... File webrtc/video/receive_statistics_proxy.cc (right): https://codereview.webrtc.org/3009793002/diff/80001/webrtc/video/receive_stat... webrtc/video/receive_statistics_proxy.cc:505: stats_.content_type = "realtime"; On 2017/08/30 15:03:28, tommi wrote: > fyi - the code generation for this statement generates code for two calls to the > assignment operator. An alternative could be: > > stats_.content_type = videocontenttypehelpers::IsScreenshare(last_content_type_) > : "screen" : "realtime"; Done. https://codereview.webrtc.org/3009793002/diff/80001/webrtc/video/receive_stat... File webrtc/video/receive_statistics_proxy_unittest.cc (right): https://codereview.webrtc.org/3009793002/diff/80001/webrtc/video/receive_stat... webrtc/video/receive_statistics_proxy_unittest.cc:104: VideoContentType::SCREENSHARE); On 2017/08/30 15:03:28, tommi wrote: > indentation seems off. can you run git cl format? Done.
https://codereview.webrtc.org/3009793002/diff/80001/webrtc/call/video_receive... File webrtc/call/video_receive_stream.h (right): https://codereview.webrtc.org/3009793002/diff/80001/webrtc/call/video_receive... webrtc/call/video_receive_stream.h:90: // "screen" vs "realtime". On 2017/08/30 15:30:24, ilnik wrote: > On 2017/08/30 15:03:27, tommi wrote: > > if these are fixed constants, can we use const char* instead of allocating > > memory and make construction/destruction slightly more complex? > Alternatively, > > can this be an enum? > > Enum is absolutely not suitable here, as we want it to be flexible. Also, > another enum for ContentType is annoying. > > char* is problematic for the same reasons. What if we decide to put additional > information in here (like simulcast layers and experiment id). Since stats gathering is a notoriously performance sensitive process, can you clarify what you mean with 'annoying'? :) Does it cause problems at the upper javascript layers? In my mind, it would be much less desirable to have to compare a string in chrome to some other definition of "screen" vs "realtime" vs whatever else might be introduced. Further still, if one value gets removed or modified, it would be much better to catch that as a build break rather than a string mismatch that silently makes it into production. And then there are cycles, locks and code bytes to consider :)
https://codereview.webrtc.org/3009793002/diff/80001/webrtc/call/video_receive... File webrtc/call/video_receive_stream.h (right): https://codereview.webrtc.org/3009793002/diff/80001/webrtc/call/video_receive... webrtc/call/video_receive_stream.h:90: // "screen" vs "realtime". On 2017/08/30 17:54:42, tommi wrote: > On 2017/08/30 15:30:24, ilnik wrote: > > On 2017/08/30 15:03:27, tommi wrote: > > > if these are fixed constants, can we use const char* instead of allocating > > > memory and make construction/destruction slightly more complex? > > Alternatively, > > > can this be an enum? > > > > Enum is absolutely not suitable here, as we want it to be flexible. Also, > > another enum for ContentType is annoying. > > > > char* is problematic for the same reasons. What if we decide to put additional > > information in here (like simulcast layers and experiment id). > > Since stats gathering is a notoriously performance sensitive process, can you > clarify what you mean with 'annoying'? :) > > Does it cause problems at the upper javascript layers? In my mind, it would be > much less desirable to have to compare a string in chrome to some other > definition of "screen" vs "realtime" vs whatever else might be introduced. > Further still, if one value gets removed or modified, it would be much better to > catch that as a build break rather than a string mismatch that silently makes it > into production. And then there are cycles, locks and code bytes to consider :) If we introduce a second enum, it will be quite error prone to add new values to all the relevant enums and there's a copy-paste. If we use a content type enum from api/video_codecs it's a strange dependency we will need to put both in pc and ortc. Finally, old GetStats is ultimately reporting all values as strings. This means, that string conversion will still happen at the end. By using enums here we will just delay that to the later moment. But now, at the cost of a single additional string copy at each GetStats call (at most 10 calls per second in some experiments. Default is 0.1 call per second) I get a code, arguably easier to maintain. This is mainly because if i decide to change something about the content type reporting value, all the changes will be contained in the ReceiveStatisticsProxy, which my team is responsible for and it will be fast and easy to make them.
https://codereview.webrtc.org/3009793002/diff/80001/webrtc/call/video_receive... File webrtc/call/video_receive_stream.h (right): https://codereview.webrtc.org/3009793002/diff/80001/webrtc/call/video_receive... webrtc/call/video_receive_stream.h:90: // "screen" vs "realtime". On 2017/08/30 18:12:18, ilnik wrote: > On 2017/08/30 17:54:42, tommi wrote: > > On 2017/08/30 15:30:24, ilnik wrote: > > > On 2017/08/30 15:03:27, tommi wrote: > > > > if these are fixed constants, can we use const char* instead of allocating > > > > memory and make construction/destruction slightly more complex? > > > Alternatively, > > > > can this be an enum? > > > > > > Enum is absolutely not suitable here, as we want it to be flexible. Also, > > > another enum for ContentType is annoying. > > > > > > char* is problematic for the same reasons. What if we decide to put > additional > > > information in here (like simulcast layers and experiment id). > > > > Since stats gathering is a notoriously performance sensitive process, can you > > clarify what you mean with 'annoying'? :) > > > > Does it cause problems at the upper javascript layers? In my mind, it would > be > > much less desirable to have to compare a string in chrome to some other > > definition of "screen" vs "realtime" vs whatever else might be introduced. > > Further still, if one value gets removed or modified, it would be much better > to > > catch that as a build break rather than a string mismatch that silently makes > it > > into production. And then there are cycles, locks and code bytes to consider > :) > > If we introduce a second enum, it will be quite error prone to add new values to > all the relevant enums and there's a copy-paste. If we use a content type enum > from api/video_codecs it's a strange dependency we will need to put both in pc > and ortc. Sorry for being slow but I'm still not fully underrstanding. Does "all the relevant enums" mean individual values in the enumeration or other enum types? Would it not be possible to have an enum type at the same place as "screen" and "realtime" are today? If it's a requirement that multiple values need to be encoded in the string, then I'm wondering if this is the appropriate representation. Ideally these values should eventually be standardized so we should not be adding/removing 'goog' stats without thinking those things through. This affects code and databases in many places. > Finally, old GetStats is ultimately reporting all values as strings. This means, > that string conversion will still happen at the end. By using enums here we will > just delay that to the later moment. But now, at the cost of a single additional > string copy at each GetStats call (at most 10 calls per second in some > experiments. Default is 0.1 call per second) I get a code, arguably easier to > maintain. This is mainly because if i decide to change something about the > content type reporting value, all the changes will be contained in the > ReceiveStatisticsProxy, which my team is responsible for and it will be fast and > easy to make them. The old getStats API is being removed partially because of excessive string copying and lack of strong types.
https://codereview.webrtc.org/3009793002/diff/80001/webrtc/call/video_receive... File webrtc/call/video_receive_stream.h (right): https://codereview.webrtc.org/3009793002/diff/80001/webrtc/call/video_receive... webrtc/call/video_receive_stream.h:90: // "screen" vs "realtime". On 2017/08/31 07:28:48, tommi wrote: > On 2017/08/30 18:12:18, ilnik wrote: > > On 2017/08/30 17:54:42, tommi wrote: > > > On 2017/08/30 15:30:24, ilnik wrote: > > > > On 2017/08/30 15:03:27, tommi wrote: > > > > > if these are fixed constants, can we use const char* instead of > allocating > > > > > memory and make construction/destruction slightly more complex? > > > > Alternatively, > > > > > can this be an enum? > > > > > > > > Enum is absolutely not suitable here, as we want it to be flexible. Also, > > > > another enum for ContentType is annoying. > > > > > > > > char* is problematic for the same reasons. What if we decide to put > > additional > > > > information in here (like simulcast layers and experiment id). > > > > > > Since stats gathering is a notoriously performance sensitive process, can > you > > > clarify what you mean with 'annoying'? :) > > > > > > Does it cause problems at the upper javascript layers? In my mind, it would > > be > > > much less desirable to have to compare a string in chrome to some other > > > definition of "screen" vs "realtime" vs whatever else might be introduced. > > > Further still, if one value gets removed or modified, it would be much > better > > to > > > catch that as a build break rather than a string mismatch that silently > makes > > it > > > into production. And then there are cycles, locks and code bytes to > consider > > :) > > > > If we introduce a second enum, it will be quite error prone to add new values > to > > all the relevant enums and there's a copy-paste. If we use a content type enum > > from api/video_codecs it's a strange dependency we will need to put both in pc > > and ortc. > > Sorry for being slow but I'm still not fully underrstanding. Does "all the > relevant enums" mean individual values in the enumeration or other enum types? > Would it not be possible to have an enum type at the same place as "screen" and > "realtime" are today? > > If it's a requirement that multiple values need to be encoded in the string, > then I'm wondering if this is the appropriate representation. Ideally these > values should eventually be standardized so we should not be adding/removing > 'goog' stats without thinking those things through. This affects code and > databases in many places. > > > Finally, old GetStats is ultimately reporting all values as strings. This > means, > > that string conversion will still happen at the end. By using enums here we > will > > just delay that to the later moment. But now, at the cost of a single > additional > > string copy at each GetStats call (at most 10 calls per second in some > > experiments. Default is 0.1 call per second) I get a code, arguably easier to > > maintain. This is mainly because if i decide to change something about the > > content type reporting value, all the changes will be contained in the > > ReceiveStatisticsProxy, which my team is responsible for and it will be fast > and > > easy to make them. > > The old getStats API is being removed partially because of excessive string > copying and lack of strong types. Ok, I've made it enum everythere. Converting to string code now is in the api/video_content_type.cc. I sure don't want to introduce another enum for content type. Again, main reason i wanted to leave it as a string was that all the logic was in the place it could be easy modify later. Maybe it's too selfish. Of course, quality of codebase is more important here.
The CQ bit was checked by ilnik@webrtc.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_msan on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/linux_msan/builds/23443)
The CQ bit was checked by ilnik@webrtc.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_asan on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/linux_asan/builds/27801) linux_tsan2 on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/linux_tsan2/builds/25649)
tommi, PTAL, it's done as you suggested now. New stat is propagated in GetStats as enum and is converted at the very end.
The CQ bit was checked by ilnik@webrtc.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
sorry for the delay - one last request https://codereview.webrtc.org/3009793002/diff/160001/webrtc/pc/statscollector.cc File webrtc/pc/statscollector.cc (right): https://codereview.webrtc.org/3009793002/diff/160001/webrtc/pc/statscollector... webrtc/pc/statscollector.cc:276: webrtc::videocontenttypehelpers::ToString(info.content_type)); since AddString supports static literals, can we change ToString() to not create copies of the literals but instead just return const char*?
https://codereview.webrtc.org/3009793002/diff/160001/webrtc/pc/statscollector.cc File webrtc/pc/statscollector.cc (right): https://codereview.webrtc.org/3009793002/diff/160001/webrtc/pc/statscollector... webrtc/pc/statscollector.cc:276: webrtc::videocontenttypehelpers::ToString(info.content_type)); On 2017/09/04 09:27:42, tommi wrote: > since AddString supports static literals, can we change ToString() to not create > copies of the literals but instead just return const char*? Done.
lgtm
The CQ bit was checked by ilnik@webrtc.org
The patchset sent to the CQ was uploaded after l-g-t-m from sprang@webrtc.org, deadbeef@webrtc.org Link to the patchset: https://codereview.webrtc.org/3009793002/#ps180001 (title: "Implement Tommi@ comments")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: mac_baremetal on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/mac_baremetal/builds/24680)
The CQ bit was checked by ilnik@webrtc.org
The patchset sent to the CQ was uploaded after l-g-t-m from tommi@webrtc.org, sprang@webrtc.org, deadbeef@webrtc.org Link to the patchset: https://codereview.webrtc.org/3009793002/#ps200001 (title: "Rebase")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by ilnik@webrtc.org
The CQ bit was checked by ilnik@webrtc.org
The patchset sent to the CQ was uploaded after l-g-t-m from tommi@webrtc.org, sprang@webrtc.org, deadbeef@webrtc.org Link to the patchset: https://codereview.webrtc.org/3009793002/#ps220001 (title: "Fix broken tests on ASAN")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
CQ is committing da patch. Bot data: {"patchset_id": 220001, "attempt_start_ts": 1504528751004130, "parent_rev": "f33cee7534f0469330b6b7aa57f84eec4b082598", "commit_rev": "2e1b40bdf63743b07388628707c4b8e349495807"}
Message was sent while issue was closed.
Description was changed from ========== Implement googContentType GetStats metric reported on receive side. Reported per video stream as a string. BUG=webrtc:8174 ========== to ========== Implement googContentType GetStats metric reported on receive side. Reported per video stream as a string. BUG=webrtc:8174 Review-Url: https://codereview.webrtc.org/3009793002 Cr-Commit-Position: refs/heads/master@{#19667} Committed: https://chromium.googlesource.com/external/webrtc/+/2e1b40bdf63743b0738862870... ==========
Message was sent while issue was closed.
Committed patchset #12 (id:220001) as https://chromium.googlesource.com/external/webrtc/+/2e1b40bdf63743b0738862870... |