sbcli-pre 1.4.6__zip → 1.4.8__zip
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/PKG-INFO +1 -1
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/env_var +1 -1
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/sbcli_pre.egg-info/PKG-INFO +1 -1
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/sbcli_pre.egg-info/SOURCES.txt +1 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_cli/cli.py +12 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/constants.py +3 -2
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/controllers/caching_node_controller.py +40 -1
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/controllers/lvol_controller.py +11 -3
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/kv_store.py +5 -1
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/stats.py +4 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/docker-compose-swarm.yml +11 -0
- sbcli_pre-1.4.8/simplyblock_core/services/cached_lvol_stat_collector.py +89 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/README.md +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/pyproject.toml +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/sbcli_pre.egg-info/dependency_links.txt +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/sbcli_pre.egg-info/entry_points.txt +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/sbcli_pre.egg-info/requires.txt +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/sbcli_pre.egg-info/top_level.txt +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/setup.cfg +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/setup.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_cli/main.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/__init__.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/cluster_ops.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/cnode_client.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/compute_node_ops.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/controllers/__init__.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/controllers/cluster_events.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/controllers/device_controller.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/controllers/device_events.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/controllers/events_controller.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/controllers/health_controller.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/controllers/lvol_events.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/controllers/mgmt_events.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/controllers/pool_controller.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/controllers/pool_events.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/controllers/snapshot_controller.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/controllers/snapshot_events.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/controllers/storage_events.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/controllers/tasks_controller.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/controllers/tasks_events.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/distr_controller.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/mgmt_node_ops.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/__init__.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/base_model.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/caching_node.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/cluster.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/compute_node.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/deployer.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/events.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/global_settings.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/iface.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/job_schedule.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/lvol_model.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/mgmt_node.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/nvme_device.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/pool.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/port_stat.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/snapshot.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/models/storage_node.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/pci_utils.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/rpc_client.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/__init__.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/alerting/alert_resources.yaml.j2 +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/alerting/alert_rules.yaml +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/clean_local_storage_deploy.sh +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/config_docker.sh +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/dashboard.yml +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/dashboards/cluster.json +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/dashboards/devices.json +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/dashboards/lvols.json +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/dashboards/node-exporter.json +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/dashboards/nodes.json +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/dashboards/pools.json +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/datasource.yml +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/db_config_double.sh +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/db_config_single.sh +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/deploy_stack.sh +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/docker-compose-swarm-monitoring.yml +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/haproxy.cfg +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/install_deps.sh +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/objstore.yml +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/prometheus.yml +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/run_ssh.sh +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/set_db_config.sh +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/stack_deploy_wait.sh +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/__init__.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/caching_node_monitor.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/cap_monitor.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/capacity_and_stats_collector.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/device_monitor.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/distr_event_collector.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/health_check_service.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/install_service.sh +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/log_agg_service.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/lvol_monitor.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/lvol_stat_collector.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/mgmt_node_monitor.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/port_stat_collector.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/remove_service.sh +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/service_template.service +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/storage_node_monitor.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/tasks_runner_migration.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/tasks_runner_restart.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/shell_utils.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/snode_client.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/storage_node_ops.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/utils.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/__init__.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/app.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/auth_middleware.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/blueprints/__init__.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/blueprints/caching_node_ops.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/blueprints/caching_node_ops_k8s.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/blueprints/node_api_basic.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/blueprints/node_api_caching_docker.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/blueprints/node_api_caching_ks.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/blueprints/snode_ops.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/blueprints/web_api_caching_node.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/blueprints/web_api_cluster.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/blueprints/web_api_deployer.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/blueprints/web_api_device.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/blueprints/web_api_lvol.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/blueprints/web_api_mgmt_node.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/blueprints/web_api_pool.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/blueprints/web_api_snapshot.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/blueprints/web_api_storage_node.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/caching_node_app.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/caching_node_app_k8s.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/node_utils.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/node_webapp.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/snode_app.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/static/delete.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/static/deploy.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/static/deploy_cnode.yaml +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/static/deploy_spdk.yaml +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/static/is_up.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/static/list_deps.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/static/rpac.yaml +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/static/tst.py +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/templates/deploy_spdk.yaml.j2 +0 -0
- {sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_web/utils.py +0 -0
@@ -85,6 +85,7 @@ simplyblock_core/scripts/dashboards/node-exporter.json
|
|
85
85
|
simplyblock_core/scripts/dashboards/nodes.json
|
86
86
|
simplyblock_core/scripts/dashboards/pools.json
|
87
87
|
simplyblock_core/services/__init__.py
|
88
|
+
simplyblock_core/services/cached_lvol_stat_collector.py
|
88
89
|
simplyblock_core/services/caching_node_monitor.py
|
89
90
|
simplyblock_core/services/cap_monitor.py
|
90
91
|
simplyblock_core/services/capacity_and_stats_collector.py
|
@@ -608,6 +608,12 @@ class CLIWrapper:
|
|
608
608
|
sub_command = self.add_sub_command(subparser, 'recreate', 'recreate Caching node bdevs')
|
609
609
|
sub_command.add_argument("node_id", help='Caching node UUID')
|
610
610
|
|
611
|
+
sub_command = self.add_sub_command(subparser, 'get-lvol-stats', 'Get LVol stats')
|
612
|
+
sub_command.add_argument("lvol_id", help='LVol UUID')
|
613
|
+
sub_command.add_argument("--history", help='(XXdYYh), list history records (one for every 15 minutes) '
|
614
|
+
'for XX days and YY hours (up to 10 days in total).')
|
615
|
+
|
616
|
+
|
611
617
|
def init_parser(self):
|
612
618
|
self.parser = argparse.ArgumentParser(prog=constants.SIMPLY_BLOCK_CLI_NAME, description='SimplyBlock management CLI')
|
613
619
|
self.parser.add_argument("-d", '--debug', help='Print debug messages', required=False, action='store_true')
|
@@ -1104,6 +1110,12 @@ class CLIWrapper:
|
|
1104
1110
|
if sub_command == "recreate":
|
1105
1111
|
ret = caching_node_controller.recreate(args.node_id)
|
1106
1112
|
|
1113
|
+
if sub_command == "get-lvol-stats":
|
1114
|
+
data = caching_node_controller.get_io_stats(args.lvol_id, args.history)
|
1115
|
+
if data:
|
1116
|
+
ret = utils.print_table(data)
|
1117
|
+
else:
|
1118
|
+
return False
|
1107
1119
|
|
1108
1120
|
else:
|
1109
1121
|
self.parser.print_help()
|
@@ -14,8 +14,8 @@ INSTALL_DIR = os.path.dirname(os.path.realpath(__file__))
|
|
14
14
|
NODE_MONITOR_INTERVAL_SEC = 3
|
15
15
|
DEVICE_MONITOR_INTERVAL_SEC = 5
|
16
16
|
STAT_COLLECTOR_INTERVAL_SEC = 60*5 # 5 minutes
|
17
|
-
LVOL_STAT_COLLECTOR_INTERVAL_SEC =
|
18
|
-
LVOL_MONITOR_INTERVAL_SEC =
|
17
|
+
LVOL_STAT_COLLECTOR_INTERVAL_SEC = 5
|
18
|
+
LVOL_MONITOR_INTERVAL_SEC = 120
|
19
19
|
DEV_MONITOR_INTERVAL_SEC = 10
|
20
20
|
DEV_STAT_COLLECTOR_INTERVAL_SEC = 2
|
21
21
|
PROT_STAT_COLLECTOR_INTERVAL_SEC = 2
|
@@ -23,6 +23,7 @@ DISTR_EVENT_COLLECTOR_INTERVAL_SEC = 2
|
|
23
23
|
DISTR_EVENT_COLLECTOR_NUM_OF_EVENTS = 10
|
24
24
|
CAP_MONITOR_INTERVAL_SEC = 30
|
25
25
|
SSD_VENDOR_WHITE_LIST = ["1d0f:cd01", "1d0f:cd00"]
|
26
|
+
CACHED_LVOL_STAT_COLLECTOR_INTERVAL_SEC = 5
|
26
27
|
|
27
28
|
PMEM_DIR = '/tmp/pmem'
|
28
29
|
|
@@ -478,7 +478,7 @@ def connect(caching_node_id, lvol_id):
|
|
478
478
|
logger.info(f"Device path: {dev_path}")
|
479
479
|
|
480
480
|
cached_lvol = CachedLVol()
|
481
|
-
cached_lvol.uuid =
|
481
|
+
cached_lvol.uuid = lvol.get_id()
|
482
482
|
cached_lvol.lvol_id = lvol.get_id()
|
483
483
|
cached_lvol.lvol = lvol
|
484
484
|
cached_lvol.hostname = cnode.hostname
|
@@ -731,3 +731,42 @@ def remove_node(node_id, force=False):
|
|
731
731
|
|
732
732
|
snode.remove(db_controller.kv_store)
|
733
733
|
logger.info("done")
|
734
|
+
|
735
|
+
|
736
|
+
def get_io_stats(lvol_uuid, history, records_count=20, parse_sizes=True):
|
737
|
+
lvol = db_controller.get_lvol_by_id(lvol_uuid)
|
738
|
+
if not lvol:
|
739
|
+
logger.error(f"LVol not found: {lvol_uuid}")
|
740
|
+
return False
|
741
|
+
|
742
|
+
if history:
|
743
|
+
records_number = utils.parse_history_param(history)
|
744
|
+
if not records_number:
|
745
|
+
logger.error(f"Error parsing history string: {history}")
|
746
|
+
return False
|
747
|
+
else:
|
748
|
+
records_number = 20
|
749
|
+
|
750
|
+
records_list = db_controller.get_cached_lvol_stats(lvol.get_id(), limit=records_number)
|
751
|
+
if not records_list:
|
752
|
+
return False
|
753
|
+
new_records = utils.process_records(records_list, min(records_count, len(records_list)))
|
754
|
+
|
755
|
+
if not parse_sizes:
|
756
|
+
return new_records
|
757
|
+
|
758
|
+
out = []
|
759
|
+
for record in new_records:
|
760
|
+
out.append({
|
761
|
+
"Date": time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(record['date'])),
|
762
|
+
"Read bytes": utils.humanbytes(record["read_bytes"]),
|
763
|
+
"Read speed": utils.humanbytes(record['read_bytes_ps']),
|
764
|
+
"Read IOPS": record['read_io_ps'],
|
765
|
+
"Read lat": record['read_latency_ps'],
|
766
|
+
"Write bytes": utils.humanbytes(record["write_bytes"]),
|
767
|
+
"Write speed": utils.humanbytes(record['write_bytes_ps']),
|
768
|
+
"Write IOPS": record['write_io_ps'],
|
769
|
+
"Write lat": record['write_latency_ps'],
|
770
|
+
})
|
771
|
+
return out
|
772
|
+
|
@@ -9,9 +9,8 @@ import uuid
|
|
9
9
|
from typing import Tuple
|
10
10
|
|
11
11
|
from simplyblock_core import utils, constants, distr_controller
|
12
|
-
from simplyblock_core.controllers import snapshot_controller, pool_controller, lvol_events
|
12
|
+
from simplyblock_core.controllers import snapshot_controller, pool_controller, lvol_events, caching_node_controller
|
13
13
|
from simplyblock_core.kv_store import DBController
|
14
|
-
from simplyblock_core.models.cluster import Cluster
|
15
14
|
from simplyblock_core.models.nvme_device import NVMeDevice
|
16
15
|
from simplyblock_core.models.pool import Pool
|
17
16
|
from simplyblock_core.models.lvol_model import LVol
|
@@ -1016,6 +1015,13 @@ def delete_lvol(id_or_name, force_delete=False):
|
|
1016
1015
|
lvol.status = LVol.STATUS_IN_DELETION
|
1017
1016
|
lvol.write_to_db(db_controller.kv_store)
|
1018
1017
|
|
1018
|
+
# disconnect from caching nodes:
|
1019
|
+
cnodes = db_controller.get_caching_nodes()
|
1020
|
+
for cnode in cnodes:
|
1021
|
+
for lv in cnode.lvols:
|
1022
|
+
if lv.lvol_id == lvol.get_id():
|
1023
|
+
caching_node_controller.disconnect(cnode.get_id(), lvol.get_id())
|
1024
|
+
|
1019
1025
|
if lvol.ha_type == 'single':
|
1020
1026
|
ret = delete_lvol_from_node(lvol.get_id(), lvol.node_id)
|
1021
1027
|
if not ret:
|
@@ -1339,7 +1345,9 @@ def get_io_stats(lvol_uuid, history, records_count=20, parse_sizes=True):
|
|
1339
1345
|
records_number = 20
|
1340
1346
|
|
1341
1347
|
records_list = db_controller.get_lvol_stats(lvol, limit=records_number)
|
1342
|
-
|
1348
|
+
if not records_list:
|
1349
|
+
return False
|
1350
|
+
new_records = utils.process_records(records_list, min(records_count, len(records_list)))
|
1343
1351
|
|
1344
1352
|
if not parse_sizes:
|
1345
1353
|
return new_records
|
@@ -19,7 +19,7 @@ from simplyblock_core.models.mgmt_node import MgmtNode
|
|
19
19
|
from simplyblock_core.models.pool import Pool
|
20
20
|
from simplyblock_core.models.snapshot import SnapShot
|
21
21
|
from simplyblock_core.models.stats import DeviceStatObject, NodeStatObject, ClusterStatObject, LVolStatObject, \
|
22
|
-
PoolStatObject
|
22
|
+
PoolStatObject, CachedLVolStatObject
|
23
23
|
from simplyblock_core.models.storage_node import StorageNode
|
24
24
|
from simplyblock_core.models.lvol_model import LVol
|
25
25
|
|
@@ -232,6 +232,10 @@ class DBController:
|
|
232
232
|
stats = LVolStatObject().read_from_db(self.kv_store, id="%s/%s" % (lvol.pool_uuid, lvol.uuid), limit=limit, reverse=True)
|
233
233
|
return stats
|
234
234
|
|
235
|
+
def get_cached_lvol_stats(self, lvol_id, limit=20):
|
236
|
+
stats = CachedLVolStatObject().read_from_db(self.kv_store, id="%s/%s" % (lvol_id, lvol_id), limit=limit, reverse=True)
|
237
|
+
return stats
|
238
|
+
|
235
239
|
def get_pool_stats(self, pool, limit=20):
|
236
240
|
stats = PoolStatObject().read_from_db(self.kv_store, id="%s/%s" % (pool.get_id(), pool.get_id()), limit=limit, reverse=True)
|
237
241
|
return stats
|
@@ -79,6 +79,17 @@ services:
|
|
79
79
|
networks:
|
80
80
|
- hostnet
|
81
81
|
|
82
|
+
CachedLVolStatsCollector:
|
83
|
+
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
84
|
+
command: "python simplyblock_core/services/cached_lvol_stat_collector.py"
|
85
|
+
deploy:
|
86
|
+
placement:
|
87
|
+
constraints: [node.role == manager]
|
88
|
+
volumes:
|
89
|
+
- "/etc/foundationdb:/etc/foundationdb"
|
90
|
+
networks:
|
91
|
+
- hostnet
|
92
|
+
|
82
93
|
PortStatsCollector:
|
83
94
|
image: $SIMPLYBLOCK_DOCKER_IMAGE
|
84
95
|
command: "python simplyblock_core/services/port_stat_collector.py"
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# coding=utf-8
|
2
|
+
import time
|
3
|
+
|
4
|
+
from simplyblock_core import constants, kv_store, utils
|
5
|
+
from simplyblock_core.models.stats import CachedLVolStatObject
|
6
|
+
from simplyblock_core.rpc_client import RPCClient
|
7
|
+
|
8
|
+
|
9
|
+
logger = utils.get_logger(__name__)
|
10
|
+
|
11
|
+
last_object_record = {}
|
12
|
+
|
13
|
+
|
14
|
+
def add_lvol_stats(lvol, stats_dict):
|
15
|
+
now = int(time.time())
|
16
|
+
data = {
|
17
|
+
"cluster_id": lvol.get_id(),
|
18
|
+
"uuid": lvol.get_id(),
|
19
|
+
"date": now}
|
20
|
+
|
21
|
+
if stats_dict and stats_dict['bdevs']:
|
22
|
+
stats = stats_dict['bdevs'][0]
|
23
|
+
data.update({
|
24
|
+
"read_bytes": stats['bytes_read'],
|
25
|
+
"read_io": stats['num_read_ops'],
|
26
|
+
"read_latency_ticks": stats['read_latency_ticks'],
|
27
|
+
|
28
|
+
"write_bytes": stats['bytes_written'],
|
29
|
+
"write_io": stats['num_write_ops'],
|
30
|
+
"write_latency_ticks": stats['write_latency_ticks'],
|
31
|
+
|
32
|
+
"unmap_bytes": stats['bytes_unmapped'],
|
33
|
+
"unmap_io": stats['num_unmap_ops'],
|
34
|
+
"unmap_latency_ticks": stats['unmap_latency_ticks'],
|
35
|
+
})
|
36
|
+
|
37
|
+
last_record = None
|
38
|
+
if lvol.get_id() in last_object_record:
|
39
|
+
last_record = last_object_record[lvol.get_id()]
|
40
|
+
else:
|
41
|
+
records = db_controller.get_cached_lvol_stats(lvol.get_id(), limit=1)
|
42
|
+
if records:
|
43
|
+
last_record = records[0]
|
44
|
+
|
45
|
+
if last_record:
|
46
|
+
time_diff = (now - last_record.date)
|
47
|
+
if time_diff > 0:
|
48
|
+
data['record_duration'] = time_diff
|
49
|
+
data['read_bytes_ps'] = int((data['read_bytes'] - last_record['read_bytes']) / time_diff)
|
50
|
+
data['read_io_ps'] = int((data['read_io'] - last_record['read_io']) / time_diff)
|
51
|
+
data['read_latency_ps'] = int(
|
52
|
+
(data['read_latency_ticks'] - last_record['read_latency_ticks']) / time_diff)
|
53
|
+
|
54
|
+
data['write_bytes_ps'] = int((data['write_bytes'] - last_record['write_bytes']) / time_diff)
|
55
|
+
data['write_io_ps'] = int((data['write_io'] - last_record['write_io']) / time_diff)
|
56
|
+
data['write_latency_ps'] = int(
|
57
|
+
(data['write_latency_ticks'] - last_record['write_latency_ticks']) / time_diff)
|
58
|
+
|
59
|
+
data['unmap_bytes_ps'] = int((data['unmap_bytes'] - last_record['unmap_bytes']) / time_diff)
|
60
|
+
data['unmap_io_ps'] = int((data['unmap_io'] - last_record['unmap_io']) / time_diff)
|
61
|
+
data['unmap_latency_ps'] = int(
|
62
|
+
(data['unmap_latency_ticks'] - last_record['unmap_latency_ticks']) / time_diff)
|
63
|
+
|
64
|
+
else:
|
65
|
+
logger.warning("last record not found")
|
66
|
+
else:
|
67
|
+
logger.error("Error getting stats")
|
68
|
+
|
69
|
+
stat_obj = CachedLVolStatObject(data=data)
|
70
|
+
stat_obj.write_to_db(db_controller.kv_store)
|
71
|
+
last_object_record[lvol.get_id()] = stat_obj
|
72
|
+
return stat_obj
|
73
|
+
|
74
|
+
|
75
|
+
db_store = kv_store.KVStore()
|
76
|
+
db_controller = kv_store.DBController()
|
77
|
+
|
78
|
+
logger.info("Starting stats collector...")
|
79
|
+
while True:
|
80
|
+
cnodes = db_controller.get_caching_nodes()
|
81
|
+
for node in cnodes:
|
82
|
+
rpc_client = RPCClient(node.mgmt_ip, node.rpc_port, node.rpc_username, node.rpc_password, timeout=3, retry=1)
|
83
|
+
for cached_lvol in node.lvols:
|
84
|
+
logger.info("Getting lVol stats: %s", cached_lvol.uuid)
|
85
|
+
stats_dict = rpc_client.get_lvol_stats(cached_lvol.ocf_bdev)
|
86
|
+
add_lvol_stats(cached_lvol.lvol, stats_dict)
|
87
|
+
|
88
|
+
logger.info(f"Sleeping for {constants.CACHED_LVOL_STAT_COLLECTOR_INTERVAL_SEC} seconds")
|
89
|
+
time.sleep(constants.CACHED_LVOL_STAT_COLLECTOR_INTERVAL_SEC)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/alerting/alert_resources.yaml.j2
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/scripts/docker-compose-swarm-monitoring.yml
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{sbcli_pre-1.4.6 → sbcli_pre-1.4.8}/simplyblock_core/services/capacity_and_stats_collector.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|