Skip to content

Commit

Permalink
Merge pull request #1981 from ceph/import-tests
Browse files Browse the repository at this point in the history
Disable prometheus when exporter isn't running
  • Loading branch information
zmc authored Aug 6, 2024
2 parents 0c6b50f + 2812cb2 commit cf24c2c
Show file tree
Hide file tree
Showing 12 changed files with 205 additions and 79 deletions.
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ toml==0.10.2
# via teuthology (pyproject.toml)
tox==4.11.4
# via teuthology (pyproject.toml)
types-psutil==6.0.0.20240621
# via teuthology (pyproject.toml)
urllib3==1.26.18
# via
# botocore
Expand Down
5 changes: 5 additions & 0 deletions scripts/test/test_exporter_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from script import Script


class TestExporter(Script):
script_name = 'teuthology-exporter'
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ install_requires =
python-dateutil
requests>2.13.0
sentry-sdk
types-psutil
urllib3>=1.25.4,<1.27 # For botocore
scripts =
teuthology/task/install/bin/adjust-ulimits
Expand Down
5 changes: 4 additions & 1 deletion teuthology/dispatcher/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ def lock_machines(job_config):
fake_ctx = supervisor.create_fake_context(job_config, block=True)
machine_type = job_config["machine_type"]
count = len(job_config['roles'])
with exporter.NodeLockingTime.labels(machine_type, count).time():
with exporter.NodeLockingTime().time(
machine_type=machine_type,
count=count,
):
lock_ops.block_and_lock_machines(
fake_ctx,
count,
Expand Down
10 changes: 5 additions & 5 deletions teuthology/dispatcher/supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ def main(args):
# If a job (e.g. from the nop suite) doesn't need nodes, avoid
# submitting a zero here.
if node_count:
with exporter.NodeReimagingTime.labels(
job_config["machine_type"],
node_count
).time():
with exporter.NodeReimagingTime().time(
machine_type=job_config["machine_type"],
node_count=node_count,
):
reimage(job_config)
else:
reimage(job_config)
Expand All @@ -57,7 +57,7 @@ def main(args):
try:
suite = job_config.get("suite")
if suite:
with exporter.JobTime.labels(suite).time():
with exporter.JobTime().time(suite=suite):
return run_job(
job_config,
args.bin_path,
Expand Down
Loading

0 comments on commit cf24c2c

Please sign in to comment.