Fix tests to use new statistics API

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
This commit is contained in:
Rafal Stefanowski
2019-12-10 14:59:00 +01:00
parent 60200e9fb8
commit 017ec7196a
7 changed files with 103 additions and 91 deletions

View File

@@ -112,8 +112,8 @@ def test_block_stats_write(cache_mode, zero_stats):
for i in range(iterations):
dd.seek(dd_seek)
dd.run()
cache_stats = cache.get_cache_statistics(stat_filter=[StatsFilter.blk])
core_stats = core.get_core_statistics(stat_filter=[StatsFilter.blk])
cache_stats = cache.get_statistics_deprecated(stat_filter=[StatsFilter.blk])
core_stats = core.get_statistics_deprecated(stat_filter=[StatsFilter.blk])
# Check cache stats
assumed_value = (dd_size.get_value(Unit.Blocks4096) * dd_count) * (i + 1)
@@ -237,8 +237,8 @@ def test_block_stats_read(cache_mode, zero_stats):
for i in range(iterations):
dd.skip(dd_skip)
dd.run()
cache_stats = cache.get_cache_statistics(stat_filter=[StatsFilter.blk])
core_stats = core.get_core_statistics(stat_filter=[StatsFilter.blk])
cache_stats = cache.get_statistics_deprecated(stat_filter=[StatsFilter.blk])
core_stats = core.get_statistics_deprecated(stat_filter=[StatsFilter.blk])
# Check cache stats
assumed_value = (dd_size.get_value(Unit.Blocks4096) * dd_count) * (i + 1)
@@ -283,7 +283,7 @@ def test_block_stats_read(cache_mode, zero_stats):
def flush(cache):
cache.flush_cache()
cache.reset_counters()
stats = cache.get_cache_statistics(stat_filter=[StatsFilter.blk])
stats = cache.get_statistics_deprecated(stat_filter=[StatsFilter.blk])
for key, value in stats.items():
assert value.get_value(Unit.Blocks4096) == 0

View File

@@ -105,11 +105,11 @@ def test_ioclass_stats_sum():
core.unmount()
sync()
cache_stats = cache.get_cache_statistics(
cache_stats = cache.get_statistics_deprecated(
stat_filter=[StatsFilter.usage, StatsFilter.req, StatsFilter.blk]
)
for ioclass_id in ioclass_id_list:
ioclass_stats = cache.get_cache_statistics(
ioclass_stats = cache.get_statistics_deprecated(
stat_filter=[StatsFilter.usage, StatsFilter.req, StatsFilter.blk],
io_class_id=ioclass_id,
)