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
5 changes: 1 addition & 4 deletions src/iocore/cache/Cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1492,7 +1492,6 @@ cplist_reconfigure()
int volume_number;
off_t size_in_blocks;
ConfigVol *config_vol;
int assignedVol = 0; // Number of assigned volumes

gnstripes = 0;
if (config_volumes.num_volumes == 0) {
Expand Down Expand Up @@ -1550,8 +1549,6 @@ 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 @@ -1721,7 +1718,7 @@ cplist_reconfigure()
}
}

Metrics::Gauge::store(cache_rsb.stripes, gnstripes + assignedVol);
Metrics::Gauge::store(cache_rsb.stripes, gnstripes);

return 0;
}
Expand Down
7 changes: 7 additions & 0 deletions tests/gold_tests/cache/gold/storage_metrics_2_stdout.gold
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
``
proxy.process.cache.stripes 1
``
proxy.process.cache.span.online 1
``
proxy.process.cache.volume_1.stripes 1
``
19 changes: 16 additions & 3 deletions tests/gold_tests/cache/storage-metrics.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"volume": '''
# empty
'''
},
{
}, {
"case": 1,
"description": "four equally devided volumes",
"storage": '''
Expand All @@ -46,7 +45,19 @@
volume=3 scheme=http size=25%
volume=4 scheme=http size=25%
'''
},
}, {
"case": 2,
"description": "exclusive span",
"storage": '''
storage 256M volume=1
''',
"volume": '''
volume=1 scheme=http size=262144
''',
"hosting": '''
hostname=* volume=1
'''
}
]


Expand All @@ -65,6 +76,8 @@ def run(self):
ts = Test.MakeATSProcess(f"ts_{i}")
ts.Disk.storage_config.AddLine(config["storage"])
ts.Disk.volume_config.AddLine(config["volume"])
if "hosting" in config:
ts.Disk.hosting_config.AddLine(config["hosting"])
ts.Disk.records_config.update({
'proxy.config.diags.debug.enabled': 1,
'proxy.config.diags.debug.tags': 'cache',
Expand Down