JGit metrics: expose total load time for block cache entries
This allows to calculate current average load time within a time interval by dividing increase of total_load_time by increase of load_success_count within a given time interval. The already exposed metric avg_load_time gives the average since the gerrit process was started. Change-Id: I40eb61cc716b7d545aeae4eb522a439cc48bd74d
This commit is contained in:
@@ -139,9 +139,10 @@ topic submissions that concluded successfully.
|
|||||||
|
|
||||||
=== JGit
|
=== JGit
|
||||||
|
|
||||||
* `jgit/block_cache/cache_used`: Bytes of memory retained in JGit block cache.
|
* `jgit/block_cache/cache_used` : Bytes of memory retained in JGit block cache.
|
||||||
* `jgit/block_cache/open_files`: File handles held open by JGit block cache.
|
* `jgit/block_cache/open_files` : File handles held open by JGit block cache.
|
||||||
* `avg_load_time` Average time to load a cache entry for JGit block cache.
|
* `avg_load_time` : Average time to load a cache entry for JGit block cache.
|
||||||
|
* `total_load_time` : Total time to load cache entries for JGit block cache.
|
||||||
* `eviction_count` : Cache evictions for JGit block cache.
|
* `eviction_count` : Cache evictions for JGit block cache.
|
||||||
* `eviction_ratio` : Cache eviction ratio for JGit block cache.
|
* `eviction_ratio` : Cache eviction ratio for JGit block cache.
|
||||||
* `hit_count` : Cache hits for JGit block cache.
|
* `hit_count` : Cache hits for JGit block cache.
|
||||||
|
|||||||
@@ -65,6 +65,17 @@ public class JGitMetricModule extends MetricModule {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
metrics.newCallbackMetric(
|
||||||
|
"jgit/block_cache/total_load_time",
|
||||||
|
Long.class,
|
||||||
|
new Description("Total time to load cache entries for JGit block cache.").setGauge(),
|
||||||
|
new Supplier<Long>() {
|
||||||
|
@Override
|
||||||
|
public Long get() {
|
||||||
|
return WindowCacheStats.getStats().getTotalLoadTime();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
metrics.newCallbackMetric(
|
metrics.newCallbackMetric(
|
||||||
"jgit/block_cache/eviction_count",
|
"jgit/block_cache/eviction_count",
|
||||||
Long.class,
|
Long.class,
|
||||||
|
|||||||
Reference in New Issue
Block a user