MCPcopy Create free account
hub / github.com/PiSCSI/piscsi / GetStatistics

Method GetStatistics

cpp/devices/disk_cache.cpp:192–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192vector<PbStatistics> DiskCache::GetStatistics(bool is_read_only) const
193{
194 vector<PbStatistics> statistics;
195
196 PbStatistics s;
197
198 s.set_category(PbStatisticsCategory::CATEGORY_INFO);
199
200 s.set_key(CACHE_MISS_READ_COUNT);
201 s.set_value(cache_miss_read_count);
202 statistics.push_back(s);
203
204 if (!is_read_only) {
205 s.set_key(CACHE_MISS_WRITE_COUNT);
206 s.set_value(cache_miss_write_count);
207 statistics.push_back(s);
208 }
209
210 s.set_category(PbStatisticsCategory::CATEGORY_ERROR);
211
212 s.set_key(READ_ERROR_COUNT);
213 s.set_value(read_error_count);
214 statistics.push_back(s);
215
216 if (!is_read_only) {
217 s.set_key(WRITE_ERROR_COUNT);
218 s.set_value(write_error_count);
219 statistics.push_back(s);
220 }
221
222 return statistics;
223}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected