From: Yin Congmin Date: Tue, 29 Mar 2022 08:59:05 +0000 (+0800) Subject: librbd/cache/pwl: add basic metrics to ImageCacheState X-Git-Tag: v16.2.8~19^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3c419206efa4bb80a93d26abbe53d66f31f9c54a;p=ceph.git librbd/cache/pwl: add basic metrics to ImageCacheState Add basic metrics to ImageCacheState and persist them, including allocated_bytes, cached_bytes, dirty_bytes, free_bytes and hit/miss info. Leverage periodic_stats() timer to call update_image_cache_state. In order to avoid outputting too much debug information, the original statistics output log level is changed to 5. Switch to json_spirit for encoding because encode_json encodes bool as "true"/"false" string. Remove rbd_persistent_cache_log_periodic_stats option because we need to always update cache state. [ idryomov: add cached_bytes and hits_partial; report misses and miss_bytes instead of respective totals; naming ] Fixes: https://tracker.ceph.com/issues/50614 Signed-off-by: Yin Congmin Signed-off-by: Ilya Dryomov (cherry picked from commit 769f3a06ecf85249c1473cbb6bab7503beb1ba78) Conflicts: src/common/options/rbd.yaml.in [ options are defined in src/common/options.cc in pacific ] --- diff --git a/doc/rbd/rbd-persistent-write-back-cache.rst b/doc/rbd/rbd-persistent-write-back-cache.rst index db91e0697f16..604bf46e040a 100644 --- a/doc/rbd/rbd-persistent-write-back-cache.rst +++ b/doc/rbd/rbd-persistent-write-back-cache.rst @@ -59,10 +59,6 @@ Here are some cache configuration settings: - ``rbd_persistent_cache_size`` The cache size per image. The minimum cache size is 1 GB. -- ``rbd_persistent_cache_log_periodic_stats`` This is a debug option. It is - used to emit periodic perf stats to the debug log if ``debug rbd pwl`` is - set to ``1`` or higher. - The above configurations can be set per-host, per-pool, per-image etc. Eg, to set per-host, add the overrides to the appropriate `section`_ in the host's ``ceph.conf`` file. To set per-pool, per-image, etc, please refer to the diff --git a/src/common/options.cc b/src/common/options.cc index 4d281aecd806..9a073faa9ed4 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -8024,10 +8024,6 @@ static std::vector