Open Bug 585752 Opened 15 years ago Updated 3 years ago

Instrument Disk Cache to Notify Observers of Evictions

Categories

(Core :: Networking: Cache, defect, P5)

x86_64
Linux
defect

Tracking

()

People

(Reporter: byronm, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-would-take])

Attachments

(1 file)

There are numerous reasons that an eviction can occur in our disk cache: due to a key collision, because an entry is greater than half the size of the cache, because an entry is greater than the maximum allowed entry size, because we are inserting an entry and the cache is just plain full... This patch provides notifications whenever an eviction occurs in the disk cache. Such notifications are useful in analyzing the behavior of the cache and in order to make improvements. A few notes on the implementation: The cache code does not run on the main thread, so notifications must be dispatched to the main thread as nsIRunnables. Because notifications occur after the actual reported events, we cannot trust that the entry the notification corresponds to is still in the cache. Therefor, notifications cannot provide pointers to actual cached data. Currently, I just notify on a topic and provide the key of the entry as extra data. I'll update this patch shortly to include some stats about the entry being reported on as well.
Blocks: http_cache
Whiteboard: [necko-would-take]
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: