Commit 610da6c9 authored by tommi@chromium.org's avatar tommi@chromium.org

Add tracing to measure the entire time it takes to satisfy a getStats request.

BUG=369796

Review URL: https://codereview.chromium.org/306923008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274220 0039d316-1c4b-4281-b951-d872f2087c98
parent e53302f7
...@@ -235,7 +235,10 @@ class SetSessionDescriptionRequest ...@@ -235,7 +235,10 @@ class SetSessionDescriptionRequest
class StatsResponse : public webrtc::StatsObserver { class StatsResponse : public webrtc::StatsObserver {
public: public:
explicit StatsResponse(const scoped_refptr<LocalRTCStatsRequest>& request) explicit StatsResponse(const scoped_refptr<LocalRTCStatsRequest>& request)
: request_(request.get()), response_(request_->createResponse().get()) {} : request_(request.get()), response_(request_->createResponse().get()) {
// Measure the overall time it takes to satisfy a getStats request.
TRACE_EVENT_ASYNC_BEGIN0("webrtc", "getStats_Native", this);
}
virtual void OnComplete( virtual void OnComplete(
const std::vector<webrtc::StatsReport>& reports) OVERRIDE { const std::vector<webrtc::StatsReport>& reports) OVERRIDE {
...@@ -246,6 +249,12 @@ class StatsResponse : public webrtc::StatsObserver { ...@@ -246,6 +249,12 @@ class StatsResponse : public webrtc::StatsObserver {
AddReport(*it); AddReport(*it);
} }
} }
// Record the getSync operation as done before calling into Blink so that
// we don't skew the perf measurements of the native code with whatever the
// callback might be doing.
TRACE_EVENT_ASYNC_END0("webrtc", "getStats_Native", this);
request_->requestSucceeded(response_); request_->requestSucceeded(response_);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment