Skip to content

Commit

Permalink
MB-50389: Remove dirtyAge & dirtyAgeHighWat
Browse files Browse the repository at this point in the history
EPStats::dirtyAge records the 'dirty age' of the last mutation to be
flushed - i.e. the duration from when the item was queued into the
CheckpointManger until it was processed by the flusher. In a live
system the duration of the last mutation is pretty meaningless - it's
basically just a single random sample. We already record a histogtram
of the dirty age for _all_ mutations flushed to disk, which is much
more useful.

Similary, EPStats::dirtyAgeHighWat records the maxmimum value for
dirtyAge - which the histogram also records for us.

Remove these two statistics as they just duplicate information
available elsewhere.

Change-Id: Icaaf6c86c89dec5612921b49ee0846b4b328b260
Reviewed-on: https://review.couchbase.org/c/kv_engine/+/169326
Reviewed-by: Richard de Mellow <richard.demellow@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
  • Loading branch information
daverigby committed Jan 26, 2022
1 parent 2fc8b05 commit a7b9668
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 22 deletions.
5 changes: 0 additions & 5 deletions engines/ep/docs/stats.org
Expand Up @@ -27,9 +27,6 @@ For introductory information on stats within Couchbase, start with the
|---------------------------------------+-----------------------------------------|
| uuid | The unique identifier for the bucket |
| ep_version | Version number of ep_engine |
| ep_storage_age | Milliseconds since most recently |
| | stored object was initially queued |
| ep_storage_age_highwat | ep_storage_age high water mark (us) |
| ep_startup_time | System-generated engine startup time |
| ep_data_age | Seconds since most recently |
| | stored object was modified |
Expand Down Expand Up @@ -1406,8 +1403,6 @@ Reset Stats:
| ep_pending_ops_max |
| ep_pending_ops_max_duration |
| ep_pending_ops_total |
| ep_storage_age |
| ep_storage_age_highwat |
| ep_replication_throttled |
| ep_vbucket_del_max_walltime |
| pending_ops |
Expand Down
3 changes: 0 additions & 3 deletions engines/ep/src/ep_bucket.cc
Expand Up @@ -1169,9 +1169,6 @@ void EPBucket::flushOneDelOrSet(TransactionContext& txnCtx,
std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::steady_clock::now() - qi->getQueuedTime());
stats.dirtyAgeHisto.add(dirtyAge);
stats.dirtyAge.store(static_cast<rel_time_t>(dirtyAge.count()));
stats.dirtyAgeHighWat.store(std::max(stats.dirtyAge.load(),
stats.dirtyAgeHighWat.load()));

auto* rwUnderlying = getRWUnderlying(qi->getVBucketId());
if (!deleted) {
Expand Down
2 changes: 0 additions & 2 deletions engines/ep/src/ep_engine.cc
Expand Up @@ -3273,8 +3273,6 @@ cb::engine_errc EventuallyPersistentEngine::doEngineStatsHighCardinality(
collector.addStat(Key::ep_bg_load, epstats.bgLoad);
}

collector.addStat(Key::ep_storage_age, epstats.dirtyAge);
collector.addStat(Key::ep_storage_age_highwat, epstats.dirtyAgeHighWat);
collector.addStat(Key::ep_num_workers,
ExecutorPool::get()->getNumWorkersStat());

Expand Down
4 changes: 0 additions & 4 deletions engines/ep/src/stats.cc
Expand Up @@ -46,8 +46,6 @@ EPStats::EPStats()
expired_pager(0),
beginFailed(0),
commitFailed(0),
dirtyAge(0),
dirtyAgeHighWat(0),
commit_time(0),
vbucketDeletions(0),
vbucketDeletionFail(0),
Expand Down Expand Up @@ -277,8 +275,6 @@ void EPStats::reset() {
tooYoung.store(0);
tooOld.store(0);
totalPersistVBState.store(0);
dirtyAge.store(0);
dirtyAgeHighWat.store(0);
commit_time.store(0);
cursorsDropped.store(0);
memFreedByCheckpointRemoval.store(0);
Expand Down
4 changes: 0 additions & 4 deletions engines/ep/src/stats.h
Expand Up @@ -287,10 +287,6 @@ class EPStats {
Counter beginFailed;
//! Number of times a commit failed.
Counter commitFailed;
//! How long an object is dirty before written.
std::atomic<rel_time_t> dirtyAge;
//! Oldest enqueued object we've seen while persisting.
std::atomic<rel_time_t> dirtyAgeHighWat;
//! Amount of time spent in the commit phase.
std::atomic<rel_time_t> commit_time;
//! Number of times we deleted a vbucket.
Expand Down
2 changes: 0 additions & 2 deletions engines/ep/tests/ep_testsuite.cc
Expand Up @@ -7406,8 +7406,6 @@ static enum test_result test_mb19687_fixed(EngineIface* h) {
"ep_rocksdb_uc_max_size_amplification_percent",
"ep_rollback_count",
"ep_startup_time",
"ep_storage_age",
"ep_storage_age_highwat",
"ep_storedval_num",
"ep_storedval_overhead",
"ep_storedval_size",
Expand Down
2 changes: 0 additions & 2 deletions include/statistics/stats.def.h
Expand Up @@ -133,8 +133,6 @@ STAT(default_engine_maxbytes,
// TODO: applying a "kv_" prefix globally would be consistent but lead to kv_ep_
// for some stats. Providing metric family names without ep_ would avoid this
// "All" stats group (doEngineStats)
STAT(ep_storage_age, , microseconds, , )
STAT(ep_storage_age_highwat, , microseconds, , )
STAT(ep_num_workers, , count, , )
STAT(ep_bucket_priority,
,
Expand Down

0 comments on commit a7b9668

Please sign in to comment.