Merge pull request #293 from Deixx/ioclass-stats-update
Updated parsing IO class statistics for cache/core
This commit is contained in:
commit
f36e7bf3d6
@ -3,14 +3,14 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
#
|
#
|
||||||
|
|
||||||
from api.cas.cli import *
|
|
||||||
from api.cas.casadm_parser import *
|
|
||||||
from test_utils.os_utils import *
|
|
||||||
from api.cas.cache_config import *
|
from api.cas.cache_config import *
|
||||||
from storage_devices.device import Device
|
|
||||||
from core.test_run import TestRun
|
|
||||||
from api.cas.casadm_params import *
|
from api.cas.casadm_params import *
|
||||||
|
from api.cas.casadm_parser import *
|
||||||
|
from api.cas.cli import *
|
||||||
from api.cas.statistics import CacheStats, IoClassStats
|
from api.cas.statistics import CacheStats, IoClassStats
|
||||||
|
from core.test_run import TestRun
|
||||||
|
from storage_devices.device import Device
|
||||||
|
from test_utils.os_utils import *
|
||||||
|
|
||||||
|
|
||||||
class Cache:
|
class Cache:
|
||||||
@ -99,7 +99,7 @@ class Cache:
|
|||||||
percentage_val: bool = False):
|
percentage_val: bool = False):
|
||||||
stats = get_statistics(self.cache_id, None, io_class_id,
|
stats = get_statistics(self.cache_id, None, io_class_id,
|
||||||
stat_filter, percentage_val)
|
stat_filter, percentage_val)
|
||||||
return IoClassStats(stats)
|
return IoClassStats(stats, for_cache=True)
|
||||||
|
|
||||||
def get_statistics(self,
|
def get_statistics(self,
|
||||||
stat_filter: List[StatsFilter] = None,
|
stat_filter: List[StatsFilter] = None,
|
||||||
|
@ -4,17 +4,16 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
from api.cas.cli import *
|
from datetime import timedelta
|
||||||
from api.cas.casadm_parser import *
|
|
||||||
from api.cas.cache import Device
|
from api.cas.cache import Device
|
||||||
|
from api.cas.casadm_parser import *
|
||||||
|
from api.cas.cli import *
|
||||||
|
from api.cas.statistics import CoreStats, IoClassStats
|
||||||
from test_tools import fs_utils
|
from test_tools import fs_utils
|
||||||
from test_utils.os_utils import *
|
from test_utils.os_utils import *
|
||||||
from api.cas.statistics import CoreStats, IoClassStats
|
|
||||||
from datetime import timedelta, datetime
|
|
||||||
from test_utils.os_utils import wait
|
from test_utils.os_utils import wait
|
||||||
|
|
||||||
import time
|
|
||||||
|
|
||||||
|
|
||||||
class CoreStatus(Enum):
|
class CoreStatus(Enum):
|
||||||
empty = 0,
|
empty = 0,
|
||||||
@ -59,7 +58,7 @@ class Core(Device):
|
|||||||
percentage_val: bool = False):
|
percentage_val: bool = False):
|
||||||
stats = get_statistics(self.cache_id, self.core_id, io_class_id,
|
stats = get_statistics(self.cache_id, self.core_id, io_class_id,
|
||||||
stat_filter, percentage_val)
|
stat_filter, percentage_val)
|
||||||
return IoClassStats(stats)
|
return IoClassStats(stats, for_cache=False)
|
||||||
|
|
||||||
def get_statistics(self,
|
def get_statistics(self,
|
||||||
stat_filter: List[StatsFilter] = None,
|
stat_filter: List[StatsFilter] = None,
|
||||||
|
@ -196,7 +196,7 @@ class CoreStats:
|
|||||||
class IoClassStats:
|
class IoClassStats:
|
||||||
stats_list = ["config_stats", "usage_stats", "request_stats", "block_stats"]
|
stats_list = ["config_stats", "usage_stats", "request_stats", "block_stats"]
|
||||||
|
|
||||||
def __init__(self, stats):
|
def __init__(self, stats, for_cache: bool):
|
||||||
try:
|
try:
|
||||||
self.config_stats = IoClassConfigStats(
|
self.config_stats = IoClassConfigStats(
|
||||||
stats["io class id"],
|
stats["io class id"],
|
||||||
@ -230,16 +230,17 @@ class IoClassStats:
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
|
plural = "(s)" if for_cache else ""
|
||||||
self.block_stats = BlockStats(
|
self.block_stats = BlockStats(
|
||||||
stats["reads from core(s)"],
|
stats["reads from core" + plural],
|
||||||
stats["writes to core(s)"],
|
stats["writes to core" + plural],
|
||||||
stats["total to/from core(s)"],
|
stats["total to/from core" + plural],
|
||||||
stats["reads from cache"],
|
stats["reads from cache"],
|
||||||
stats["writes to cache"],
|
stats["writes to cache"],
|
||||||
stats["total to/from cache"],
|
stats["total to/from cache"],
|
||||||
stats["reads from exported object(s)"],
|
stats["reads from exported object" + plural],
|
||||||
stats["writes to exported object(s)"],
|
stats["writes to exported object" + plural],
|
||||||
stats["total to/from exported object(s)"],
|
stats["total to/from exported object" + plural],
|
||||||
)
|
)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user