Segment stash edit cache stats by basis for hit/miss
authorOri Livneh <ori@wikimedia.org>
Tue, 19 Apr 2016 01:13:08 +0000 (18:13 -0700)
committerOri.livneh <ori@wikimedia.org>
Tue, 19 Apr 2016 01:31:39 +0000 (01:31 +0000)
commit0f1ffa4da707217ab2dc1efae68c8ced24500548
tree13452199dc407b74fb6f7c8ab1e013e1f0d023f0
parentcd3567e88511886861373d0bb1ff5523ec9ee818
Segment stash edit cache stats by basis for hit/miss

Instead of just counting cache hits and misses, segment the counts by reason,
so we can differentiate (for example) timestamp-based cache hits from
staleness-check-survivor cache hits. I want this data so I can determine
whether increasing the cutoff for timestamp-based hits from 3 to 5 seconds has
a substantial enough impact to warrant the slightly weaker consistency.

Also changed 'cache-hit' to 'cache_hit'. MediaWiki normalizes the dash to an
underscore anyway, but the normalization is there for dynamically-constructed
key names (or name segments). In the case of hard-coded values, it is desirable
for the code to be as close as possible to the final form of the metric name,
to simplify metric lookup.

Change-Id: I0cd61da9746e3ca3695e23200f698b8b1371798c
includes/api/ApiStashEdit.php