mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Backed out changeset 5038112b5f78 (bug 1277275) for bustage
This commit is contained in:
parent
ee7057c5e9
commit
7433982068
@ -14,54 +14,6 @@
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
||||
namespace { // anon
|
||||
|
||||
class CacheIOTelemetry
|
||||
{
|
||||
public:
|
||||
typedef CacheIOThread::EventQueue::size_type size_type;
|
||||
static size_type mMinLengthToReport[CacheIOThread::LAST_LEVEL];
|
||||
static void Report(uint32_t aLevel, uint32_t aLength);
|
||||
};
|
||||
|
||||
static CacheIOTelemetry::size_type const kGranularity = 30;
|
||||
|
||||
uint32_t CacheIOTelemetry::mMinLengthToReport[CacheIOThread::LAST_LEVEL] = {
|
||||
kGranularity, kGranularity, kGranularity, kGranularity,
|
||||
kGranularity, kGranularity, kGranularity, kGranularity
|
||||
};
|
||||
|
||||
// static
|
||||
void CacheIOTelemetry::Report(uint32_t aLevel, size_type aLength)
|
||||
{
|
||||
if (mMinLengthToReport[aLevel] > aLength) {
|
||||
return;
|
||||
}
|
||||
|
||||
static Telemetry::ID telemetryID[] = {
|
||||
Telemetry::HTTP_CACHE_IO_QUEUE_OPEN_PRIORITY,
|
||||
Telemetry::HTTP_CACHE_IO_QUEUE_READ_PRIORITY,
|
||||
Telemetry::HTTP_CACHE_IO_QUEUE_OPEN,
|
||||
Telemetry::HTTP_CACHE_IO_QUEUE_READ,
|
||||
Telemetry::HTTP_CACHE_IO_QUEUE_MANAGEMENT,
|
||||
Telemetry::HTTP_CACHE_IO_QUEUE_WRITE,
|
||||
Telemetry::HTTP_CACHE_IO_QUEUE_INDEX,
|
||||
Telemetry::HTTP_CACHE_IO_QUEUE_EVICT
|
||||
};
|
||||
|
||||
// Each bucket is a multiply of kGranularity (30, 60, 90..., 300+)
|
||||
aLength = (aLength / kGranularity);
|
||||
// Next time report only when over the current length + kGranularity
|
||||
mMinLengthToReport[aLevel] = (aLength + 1) * kGranularity;
|
||||
|
||||
// 10 is number of buckets we have in each probe
|
||||
aLength = std::min<size_type>(aLength, 10);
|
||||
|
||||
Telemetry::Accumulate(telemetryID[aLevel], aLength - 1); // counted from 0
|
||||
}
|
||||
|
||||
} // anon
|
||||
|
||||
CacheIOThread* CacheIOThread::sSelf = nullptr;
|
||||
|
||||
NS_IMPL_ISUPPORTS(CacheIOThread, nsIThreadObserver)
|
||||
@ -303,18 +255,32 @@ loopStart:
|
||||
threadInternal->SetObserver(nullptr);
|
||||
}
|
||||
|
||||
static const char* const sLevelTraceName[] = {
|
||||
"net::cache::io::level(0)",
|
||||
"net::cache::io::level(1)",
|
||||
"net::cache::io::level(2)",
|
||||
"net::cache::io::level(3)",
|
||||
"net::cache::io::level(4)",
|
||||
"net::cache::io::level(5)",
|
||||
"net::cache::io::level(6)",
|
||||
"net::cache::io::level(7)",
|
||||
"net::cache::io::level(8)",
|
||||
"net::cache::io::level(9)",
|
||||
"net::cache::io::level(10)",
|
||||
"net::cache::io::level(11)",
|
||||
"net::cache::io::level(12)"
|
||||
};
|
||||
|
||||
void CacheIOThread::LoopOneLevel(uint32_t aLevel)
|
||||
{
|
||||
EventQueue events;
|
||||
nsTArray<nsCOMPtr<nsIRunnable> > events;
|
||||
events.SwapElements(mEventQueue[aLevel]);
|
||||
EventQueue::size_type length = events.Length();
|
||||
uint32_t length = events.Length();
|
||||
|
||||
mCurrentlyExecutingLevel = aLevel;
|
||||
|
||||
bool returnEvents = false;
|
||||
bool reportTelementry = true;
|
||||
|
||||
EventQueue::size_type index;
|
||||
uint32_t index;
|
||||
{
|
||||
MonitorAutoUnlock unlock(mMonitor);
|
||||
|
||||
@ -326,11 +292,6 @@ void CacheIOThread::LoopOneLevel(uint32_t aLevel)
|
||||
break;
|
||||
}
|
||||
|
||||
if (reportTelementry) {
|
||||
reportTelementry = false;
|
||||
CacheIOTelemetry::Report(aLevel, length);
|
||||
}
|
||||
|
||||
// Drop any previous flagging, only an event on the current level may set
|
||||
// this flag.
|
||||
mRerunCurrentEvent = false;
|
||||
|
@ -29,9 +29,7 @@ public:
|
||||
|
||||
CacheIOThread();
|
||||
|
||||
typedef nsTArray<nsCOMPtr<nsIRunnable>> EventQueue;
|
||||
|
||||
enum ELevel : uint32_t {
|
||||
enum ELevel {
|
||||
OPEN_PRIORITY,
|
||||
READ_PRIORITY,
|
||||
OPEN,
|
||||
@ -93,8 +91,7 @@ private:
|
||||
Atomic<nsIThread *> mXPCOMThread;
|
||||
Atomic<uint32_t, Relaxed> mLowestLevelWaiting;
|
||||
uint32_t mCurrentlyExecutingLevel;
|
||||
|
||||
EventQueue mEventQueue[LAST_LEVEL];
|
||||
nsTArray<nsCOMPtr<nsIRunnable> > mEventQueue[LAST_LEVEL];
|
||||
|
||||
Atomic<bool, Relaxed> mHasXPCOMEvents;
|
||||
bool mRerunCurrentEvent;
|
||||
|
@ -1800,54 +1800,6 @@
|
||||
"kind": "boolean",
|
||||
"description": "Rate of page load from offline cache"
|
||||
},
|
||||
"HTTP_CACHE_IO_QUEUE_OPEN_PRIORITY": {
|
||||
"expires_in_version": "54",
|
||||
"kind": "enumerated",
|
||||
"n_values": 10,
|
||||
"description": "HTTP Cache IO queue length"
|
||||
},
|
||||
"HTTP_CACHE_IO_QUEUE_READ_PRIORITY": {
|
||||
"expires_in_version": "54",
|
||||
"kind": "enumerated",
|
||||
"n_values": 10,
|
||||
"description": "HTTP Cache IO queue length"
|
||||
},
|
||||
"HTTP_CACHE_IO_QUEUE_OPEN": {
|
||||
"expires_in_version": "54",
|
||||
"kind": "enumerated",
|
||||
"n_values": 10,
|
||||
"description": "HTTP Cache IO queue length"
|
||||
},
|
||||
"HTTP_CACHE_IO_QUEUE_READ": {
|
||||
"expires_in_version": "54",
|
||||
"kind": "enumerated",
|
||||
"n_values": 10,
|
||||
"description": "HTTP Cache IO queue length"
|
||||
},
|
||||
"HTTP_CACHE_IO_QUEUE_MANAGEMENT": {
|
||||
"expires_in_version": "54",
|
||||
"kind": "enumerated",
|
||||
"n_values": 10,
|
||||
"description": "HTTP Cache IO queue length"
|
||||
},
|
||||
"HTTP_CACHE_IO_QUEUE_WRITE": {
|
||||
"expires_in_version": "54",
|
||||
"kind": "enumerated",
|
||||
"n_values": 10,
|
||||
"description": "HTTP Cache IO queue length"
|
||||
},
|
||||
"HTTP_CACHE_IO_QUEUE_INDEX": {
|
||||
"expires_in_version": "54",
|
||||
"kind": "enumerated",
|
||||
"n_values": 10,
|
||||
"description": "HTTP Cache IO queue length"
|
||||
},
|
||||
"HTTP_CACHE_IO_QUEUE_EVICT": {
|
||||
"expires_in_version": "54",
|
||||
"kind": "enumerated",
|
||||
"n_values": 10,
|
||||
"description": "HTTP Cache IO queue length"
|
||||
},
|
||||
"CACHE_DEVICE_SEARCH_2": {
|
||||
"expires_in_version": "never",
|
||||
"kind": "exponential",
|
||||
|
@ -518,14 +518,6 @@
|
||||
"HTTP_MEMORY_CACHE_DISPOSITION_2",
|
||||
"HTTP_OFFLINE_CACHE_DISPOSITION_2",
|
||||
"HTTP_OFFLINE_CACHE_DOCUMENT_LOAD",
|
||||
"HTTP_CACHE_IO_QUEUE_OPEN_PRIORITY",
|
||||
"HTTP_CACHE_IO_QUEUE_READ_PRIORITY",
|
||||
"HTTP_CACHE_IO_QUEUE_OPEN",
|
||||
"HTTP_CACHE_IO_QUEUE_READ",
|
||||
"HTTP_CACHE_IO_QUEUE_MANAGEMENT",
|
||||
"HTTP_CACHE_IO_QUEUE_WRITE",
|
||||
"HTTP_CACHE_IO_QUEUE_INDEX",
|
||||
"HTTP_CACHE_IO_QUEUE_EVICT",
|
||||
"HTTP_PAGELOAD_IS_SSL",
|
||||
"HTTP_PAGE_CACHE_READ_TIME",
|
||||
"HTTP_PAGE_CACHE_READ_TIME_V2",
|
||||
@ -1685,14 +1677,6 @@
|
||||
"HTTP_MEMORY_CACHE_DISPOSITION_2",
|
||||
"HTTP_OFFLINE_CACHE_DISPOSITION_2",
|
||||
"HTTP_OFFLINE_CACHE_DOCUMENT_LOAD",
|
||||
"HTTP_CACHE_IO_QUEUE_OPEN_PRIORITY",
|
||||
"HTTP_CACHE_IO_QUEUE_READ_PRIORITY",
|
||||
"HTTP_CACHE_IO_QUEUE_OPEN",
|
||||
"HTTP_CACHE_IO_QUEUE_READ",
|
||||
"HTTP_CACHE_IO_QUEUE_MANAGEMENT",
|
||||
"HTTP_CACHE_IO_QUEUE_WRITE",
|
||||
"HTTP_CACHE_IO_QUEUE_INDEX",
|
||||
"HTTP_CACHE_IO_QUEUE_EVICT",
|
||||
"HTTP_PAGELOAD_IS_SSL",
|
||||
"HTTP_PAGE_CACHE_READ_TIME",
|
||||
"HTTP_PAGE_CACHE_READ_TIME_V2",
|
||||
|
Loading…
Reference in New Issue
Block a user