Skip to content

Commit

Permalink
metrics: rename prefetch_mr_count to prefetch_requests_count
Browse files Browse the repository at this point in the history
Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
  • Loading branch information
changweige committed Nov 28, 2022
1 parent fc69c33 commit c7b3f89
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions storage/src/cache/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ impl AsyncWorkerMgr {
// So the average backend merged request size will be prefetch_data_amount/prefetch_mr_count.
// We can measure merging possibility by this.
let metrics = mgr.metrics.clone();
metrics.prefetch_mr_count.inc();
metrics.prefetch_requests_count.inc();
metrics.prefetch_data_amount.add(size);

if let Some(obj) = cache.get_blob_object() {
Expand Down Expand Up @@ -414,7 +414,7 @@ impl AsyncWorkerMgr {
// Record how much prefetch data is requested from storage backend.
// So the average backend merged request size will be prefetch_data_amount/prefetch_mr_count.
// We can measure merging possibility by this.
mgr.metrics.prefetch_mr_count.inc();
mgr.metrics.prefetch_requests_count.inc();
mgr.metrics.prefetch_data_amount.add(blob_size);

if let Some(obj) = cache.get_blob_object() {
Expand Down
13 changes: 12 additions & 1 deletion utils/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -739,13 +739,24 @@ pub struct BlobcacheMetrics {
// to estimate the possibility to merge backend IOs.
// In unit of Bytes
pub prefetch_data_amount: BasicMetric,
pub prefetch_mr_count: BasicMetric,
// Total prefetch requests issued from storage/blobs or rafs filesystem layer for each file that needs prefetch
pub prefetch_requests_count: BasicMetric,
pub prefetch_workers: AtomicUsize,
pub prefetch_unmerged_chunks: BasicMetric,
// Cumulative time latencies of each prefetch request which can be handled in parallel.
// It starts when the request is born including nydusd processing and schedule and end when the chunk is downloaded and stored.
// Then the average prefetch latency can be calculated by
// `prefetch_cumulative_time_millis / prefetch_requests_count`
pub prefetch_cumulative_time_millis: BasicMetric,
// The time seconds part when nydusd begins to prefetch
// We can calculate prefetch average bandwidth by
// `prefetch_data_amount / (prefetch_end_time_secs - prefetch_begin_time_secs)`. Note, it does not take milliseconds into account yet.s
pub prefetch_begin_time_secs: BasicMetric,
// The time milliseconds part when nydusd begins to prefetch
pub prefetch_begin_time_millis: BasicMetric,
// The time seconds part when nydusd ends prefetching
pub prefetch_end_time_secs: BasicMetric,
// The time milliseconds part when nydusd ends prefetching
pub prefetch_end_time_millis: BasicMetric,
pub buffered_backend_size: BasicMetric,
pub data_all_ready: AtomicBool,
Expand Down

0 comments on commit c7b3f89

Please sign in to comment.