Skip to content

Commit 15245d0

Browse files
committed
old without prm
1 parent b4ff138 commit 15245d0

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

batchtools/br.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ def run(args: argparse.Namespace):
220220
oc.create(job_body)
221221
print(f"Job: {job_name} created successfully. Now checking pod...")
222222
if args.wait:
223-
# log_job_output(job_name=job_name, wait=True, timeout=args.timeout)
224223
result_phase, run_elapsed = log_job_output(
225224
job_name=job_name, wait=True, timeout=args.timeout
226225
)

batchtools/helpers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import openshift_client as oc
22

3-
43
def is_logged_in() -> bool:
54
try:
65
oc.invoke("whoami")

batchtools/prom_metrics.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
from typing import Optional
33
from datetime import timezone
44
from datetime import datetime
5-
5+
import openshift_client as oc
6+
from prometheus_client import CollectorRegistry, Histogram, Counter, Gauge
7+
from prometheus_client import push_to_gateway, pushadd_to_gateway
68

79
PROMETHEUS_PUSH_URL = 'http://localhost:8080/metrics'
8-
PROMETHEUS_INSTANCE = os.environ.get("PROMETHEUS_INSTANCE", socket.gethostname())
10+
PROMETHEUS_INSTANCE = oc.get_project_name()
911

1012
DEFAULT_BUCKETS = [1, 5, 10, 30, 60, 120, 300, 600, 1200, 1800, 3600] # +Inf is implicit
1113

@@ -48,7 +50,6 @@ def lbl(extra: Optional[dict[str, str]] = None) -> str:
4850
# +Inf bucket is always 1 for a single observation
4951
lines.append(f'{metric_base}_bucket{lbl({"le": "+Inf"})} 1')
5052

51-
# Sum and count
5253
# Use full precision float; Prometheus parser handles standard float format
5354
lines.append(f"{metric_base}_sum{lbl()} {elapsed}")
5455
lines.append(f"{metric_base}_count{lbl()} 1")

0 commit comments

Comments
 (0)