Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion iocore/cache/Cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,7 @@ CacheProcessor::cacheInitialized()
vol_total_cache_bytes = gvol[i]->len - gvol[i]->dirlen();
total_cache_bytes += vol_total_cache_bytes;
CACHE_VOL_SUM_DYN_STAT(cache_bytes_total_stat, vol_total_cache_bytes);
CACHE_VOL_SUM_DYN_STAT(cache_stripes_stat, 1); // Count the cache stripes
Debug("cache_init", "CacheProcessor::cacheInitialized - total_cache_bytes = %" PRId64 " = %" PRId64 "Mb",
total_cache_bytes, total_cache_bytes / (1024 * 1024));

Expand Down Expand Up @@ -2690,6 +2691,7 @@ cplist_reconfigure()
int volume_number;
off_t size_in_blocks;
ConfigVol *config_vol;
int assignedVol = 0; // Number of assigned volumes

gnvol = 0;
if (config_volumes.num_volumes == 0) {
Expand Down Expand Up @@ -2727,7 +2729,6 @@ cplist_reconfigure()
cp->num_vols += dp[0]->num_volblocks;
cp->disk_vols[i] = dp[0];
}

} else {
for (int i = 0; i < gndisks; i++) {
if (gdisks[i]->header->num_volumes == 1 && gdisks[i]->disk_vols[0]->vol_number == 0) {
Expand All @@ -2748,6 +2749,8 @@ cplist_reconfigure()
// in such a way forced volumes will not impact volume percentage calculations.
if (-1 == gdisks[i]->forced_volume_num) {
tot_space_in_blks += (gdisks[i]->num_usable_blocks / blocks_per_vol) * blocks_per_vol;
} else {
++assignedVol;
}
}

Expand Down Expand Up @@ -2915,6 +2918,9 @@ cplist_reconfigure()
gnvol += cp->num_vols;
}
}

GLOBAL_CACHE_SET_DYN_STAT(cache_stripes_stat, gnvol + assignedVol);

return 0;
}

Expand Down Expand Up @@ -3055,6 +3061,7 @@ register_cache_stats(RecRawStatBlock *rsb, const char *prefix)
reg_int("bytes_used", cache_bytes_used_stat, rsb, prefix, cache_stats_bytes_used_cb);

REG_INT("bytes_total", cache_bytes_total_stat);
REG_INT("stripes", cache_stripes_stat);
REG_INT("ram_cache.total_bytes", cache_ram_cache_bytes_total_stat);
REG_INT("ram_cache.bytes_used", cache_ram_cache_bytes_stat);
REG_INT("ram_cache.hits", cache_ram_cache_hits_stat);
Expand Down
1 change: 1 addition & 0 deletions iocore/cache/P_CacheInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ struct EvacuationBlock;
enum {
cache_bytes_used_stat,
cache_bytes_total_stat,
cache_stripes_stat,
cache_ram_cache_bytes_stat,
cache_ram_cache_bytes_total_stat,
cache_direntries_total_stat,
Expand Down