Skip to content

Commit

Permalink
Merge pull request #43 from weka/back_time_stats
Browse files Browse the repository at this point in the history
Back time stats
  • Loading branch information
vince-weka authored Mar 9, 2023
2 parents af7e294 + 1ff6e05 commit 4228570
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ def __init__(self, config, cluster_obj): # wekaCollector
self.max_procs = exporter['max_procs']
self.max_threads_per_proc = exporter['max_threads_per_proc']
self.backends_only = exporter['backends_only']
self.datapoints_per_collect = exporter['datapoints_per_collect']
if 'datapoints_per_collect' in exporter:
self.datapoints_per_collect = exporter['datapoints_per_collect']
else:
self.datapoints_per_collect = 1
self.map_registry = config["map_registry"]

self.cluster = cluster_obj
Expand Down Expand Up @@ -349,7 +352,7 @@ def gather(self):
raise
except Exception as exc:
log.error(f"Cluster refresh failed on cluster '{cluster}' - check connectivity ({exc})")
return
raise

# set up async api calling subsystem
self.asyncobj = Async(cluster, self.max_procs, self.max_threads_per_proc)
Expand Down Expand Up @@ -380,7 +383,7 @@ def gather(self):
self.map_registry.register('node-role', host_role_map)
except Exception as exc:
log.error("error building maps. Aborting data gather from cluster {}".format(str(cluster)))
return
raise

log.info(f"Cluster {cluster} Using {cluster.sizeof()} hosts")

Expand Down Expand Up @@ -438,7 +441,7 @@ def gather(self):
log.debug(stat)

if self.backends_only:
circular_host_list = circular_list(inputlist=list(cluster.host_dict.keys()))
circular_host_list = circular_list(inputlist=up_list)

for hostname in up_list:
import copy
Expand Down Expand Up @@ -506,9 +509,9 @@ def gather(self):
metric_objs['wekainfo'].add_metric(labels=wekacluster.keys(), value=wekacluster)

# log.info( "cluster name: " + wekadata["clusterinfo"]["name"] )
except:
except Exception as exc:
log.error("error cluster info - aborting populate of cluster {}".format(str(cluster)))
return
raise

log.debug(f"uptime cluster={cluster.name}")
try:
Expand Down
2 changes: 1 addition & 1 deletion export.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from wekalib.wekacluster import WekaCluster
import wekalib.exceptions

VERSION = "1.5.9"
VERSION = "1.6.0"
#VERSION = "experimental"

# set the root log
Expand Down

0 comments on commit 4228570

Please sign in to comment.