mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 03:49:42 +00:00
Bug 1024639 - Added telemetry tracking for used, total, and unused telemetry connections. r=hurley
This commit is contained in:
parent
1250af0c6a
commit
7df04cd9fc
@ -33,6 +33,8 @@
|
||||
#include "mozilla/ChaosMode.h"
|
||||
#include "mozilla/unused.h"
|
||||
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
// defined by the socket transport service while active
|
||||
extern PRThread *gSocketThread;
|
||||
|
||||
@ -1373,6 +1375,8 @@ nsHttpConnectionMgr::MakeNewConnection(nsConnectionEntry *ent,
|
||||
"Found a speculative half open connection\n",
|
||||
ent->mConnInfo->HashKey().get()));
|
||||
ent->mHalfOpens[i]->SetSpeculative(false);
|
||||
Telemetry::AutoCounter<Telemetry::HTTPCONNMGR_USED_SPECULATIVE_CONN> usedSpeculativeConn;
|
||||
++usedSpeculativeConn;
|
||||
|
||||
// return OK because we have essentially opened a new connection
|
||||
// by converting a speculative half-open to general use
|
||||
@ -2028,8 +2032,12 @@ nsHttpConnectionMgr::CreateTransport(nsConnectionEntry *ent,
|
||||
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
|
||||
|
||||
nsRefPtr<nsHalfOpenSocket> sock = new nsHalfOpenSocket(ent, trans, caps);
|
||||
if (speculative)
|
||||
if (speculative) {
|
||||
sock->SetSpeculative(true);
|
||||
Telemetry::AutoCounter<Telemetry::HTTPCONNMGR_TOTAL_SPECULATIVE_CONN> totalSpeculativeConn;
|
||||
++totalSpeculativeConn;
|
||||
}
|
||||
|
||||
nsresult rv = sock->SetupPrimaryStreams();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
@ -3003,6 +3011,11 @@ nsHttpConnectionMgr::nsHalfOpenSocket::CancelBackupTimer()
|
||||
void
|
||||
nsHttpConnectionMgr::nsHalfOpenSocket::Abandon()
|
||||
{
|
||||
if (IsSpeculative()) {
|
||||
Telemetry::AutoCounter<Telemetry::HTTPCONNMGR_UNUSED_SPECULATIVE_CONN> unusedSpeculativeConn;
|
||||
++unusedSpeculativeConn;
|
||||
}
|
||||
|
||||
LOG(("nsHalfOpenSocket::Abandon [this=%p ent=%s]",
|
||||
this, mEnt->mConnInfo->Host()));
|
||||
|
||||
|
@ -2294,6 +2294,30 @@
|
||||
"n_buckets": 50,
|
||||
"description": "Number of times startup count overflowed"
|
||||
},
|
||||
"HTTPCONNMGR_TOTAL_SPECULATIVE_CONN": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "exponential",
|
||||
"high": "1000 * 1000",
|
||||
"n_buckets": 50,
|
||||
"extended_statistics_ok": true,
|
||||
"description": "How many speculative http connections are created"
|
||||
},
|
||||
"HTTPCONNMGR_USED_SPECULATIVE_CONN": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "exponential",
|
||||
"high": "1000 * 1000",
|
||||
"n_buckets": 50,
|
||||
"extended_statistics_ok": true,
|
||||
"description": "How many speculative http connections are actually used"
|
||||
},
|
||||
"HTTPCONNMGR_UNUSED_SPECULATIVE_CONN": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "exponential",
|
||||
"high": "1000 * 1000",
|
||||
"n_buckets": 50,
|
||||
"extended_statistics_ok": true,
|
||||
"description": "How many speculative connections are made needlessly"
|
||||
},
|
||||
"FIND_PLUGINS": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "exponential",
|
||||
|
Loading…
x
Reference in New Issue
Block a user