tubearchivist-metrics/tubearchivist-metrics/getmetrics.py

12 lines
281 B
Python
Raw Normal View History

2022-04-14 21:27:28 +00:00
from esconnect import ElasticWrapper
class GetMetrics:
@staticmethod
def count(index_name):
"""Get count of documents from ES"""
result = ElasticWrapper.get_count(index_name)
2022-05-03 01:24:09 +00:00
print(f"Metric for {index_name}: {result}")
2022-04-14 21:27:28 +00:00
return int(result)