mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-22 19:51:02 +02:00
Change tg-processor-state to use gateway
This commit is contained in:
parent
b212dd3aae
commit
cd88efa332
1 changed files with 10 additions and 7 deletions
|
|
@ -8,16 +8,19 @@ import requests
|
|||
import argparse
|
||||
import tabulate
|
||||
|
||||
default_prometheus_url = "http://localhost:9090"
|
||||
default_metrics_url = "http://localhost:8088/api/metrics"
|
||||
|
||||
def dump_status(prom):
|
||||
def dump_status(url):
|
||||
|
||||
url = f"{prom}/api/v1/query?query=processor_state%7Bprocessor_state%3D%22running%22%7D"
|
||||
url = f"{url}/query?query=processor_state%7Bprocessor_state%3D%22running%22%7D"
|
||||
|
||||
resp = requests.get(url)
|
||||
|
||||
obj = resp.json()
|
||||
|
||||
print(obj)
|
||||
return
|
||||
|
||||
tbl = [
|
||||
[
|
||||
m["metric"]["job"],
|
||||
|
|
@ -40,16 +43,16 @@ def main():
|
|||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-p', '--prometheus-url',
|
||||
default=default_prometheus_url,
|
||||
help=f'Prometheus URL (default: {default_prometheus_url})',
|
||||
'-m', '--metrics-url',
|
||||
default=default_metrics_url,
|
||||
help=f'Metrics URL (default: {default_metrics_url})',
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
try:
|
||||
|
||||
dump_status(args.prometheus_url)
|
||||
dump_status(args.metrics_url)
|
||||
|
||||
except Exception as e:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue