Bug 875097 - Telemetry for number of calls per session. r=derf

This commit is contained in:
Ben Brittain 2013-08-27 19:22:19 -04:00
parent 163b7b6feb
commit d91f3d0521
5 changed files with 32 additions and 5 deletions

View File

@ -4,6 +4,7 @@
#include "CSFLog.h"
#include "base/histogram.h"
#include "CallControlManager.h"
#include "CC_Device.h"
#include "CC_Call.h"
@ -20,6 +21,8 @@
#include "cpr_socket.h"
#include "debug-psipcc-types.h"
#include "mozilla/Telemetry.h"
#include "nsIObserverService.h"
#include "nsIObserver.h"
#include "mozilla/Services.h"
@ -233,6 +236,11 @@ nsresult PeerConnectionCtx::Initialize() {
PR_NotifyAllCondVar(ccAppReadyToStartCond);
PR_Unlock(ccAppReadyToStartLock);
mConnectionCounter = 0;
#ifdef MOZILLA_INTERNAL_API
Telemetry::GetHistogramById(Telemetry::WEBRTC_CALL_COUNT)->Add(0);
#endif
return NS_OK;
}

View File

@ -72,6 +72,9 @@ class PeerConnectionCtx : public CSF::CC_Observer {
mSipccState = aState;
}
// Telemetry Peer conection counter
int mConnectionCounter;
// SIPCC objects
PeerConnectionImpl::SipccState mSipccState; // TODO(ekr@rtfm.com): refactor this out? What does it do?
CSF::CallControlManagerPtr mCCM;

View File

@ -4,6 +4,7 @@
#include <string>
#include "base/histogram.h"
#include "vcm.h"
#include "CSFLog.h"
#include "ccapi_call_info.h"
@ -248,7 +249,7 @@ public:
mPC->ClearSdpParseErrorMessages();
mObserver->OnSetRemoteDescriptionSuccess();
#ifdef MOZILLA_INTERNAL_API
mPC->setStartTime();
mPC->startCallTelem();
#endif
break;
@ -1557,10 +1558,19 @@ PeerConnectionImpl::GetSdpParseErrors() {
}
#ifdef MOZILLA_INTERNAL_API
//Telemetry set start time
//Telemetry for when calls start
void
PeerConnectionImpl::setStartTime() {
PeerConnectionImpl::startCallTelem() {
// Start time for calls
mStartTime = mozilla::TimeStamp::Now();
// Increment session call counter
#ifdef MOZILLA_INTERNAL_API
int &cnt = PeerConnectionCtx::GetInstance()->mConnectionCounter;
Telemetry::GetHistogramById(Telemetry::WEBRTC_CALL_COUNT)->Subtract(cnt);
cnt++;
Telemetry::GetHistogramById(Telemetry::WEBRTC_CALL_COUNT)->Add(cnt);
#endif
}
#endif

View File

@ -283,8 +283,8 @@ public:
void SetSignalingState_m(SignalingState aSignalingState);
#ifdef MOZILLA_INTERNAL_API
// Set start time for Telemetry
void setStartTime();
// initialize telemetry for when calls start
void startCallTelem();
#endif
private:

View File

@ -3518,6 +3518,12 @@
"n_buckets": "1000",
"description": "The length of time (in seconds) that a call lasted."
},
"WEBRTC_CALL_COUNT":{
"kind": "exponential",
"high": "500",
"n_buckets": "50",
"description": "The number of calls made during a session."
},
"DEVTOOLS_DEBUGGER_RDP_LOCAL_TRACERDETACH_MS": {
"kind": "exponential",
"high": "10000",