Skip to content

Commit

Permalink
Added last scheduled/finished to troubleshooter.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfeit-internet2 committed Jan 23, 2024
1 parent 419c992 commit 21e4547
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions pscheduler-core/pscheduler-core/troubleshoot
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ running several tests to verify that the basic features of the system
are working.
"""

import babel.dates
import datetime
import optparse
import os
import re
Expand Down Expand Up @@ -263,6 +265,21 @@ def check_service_status(api):
else:
failed(limit_status.get("error", "Unspecified error"))

# Look at the schedule
if "runs" in status:
for check in [
('last-scheduled', ' Last run scheduled'),
('last-finished', ' Last run completed')
]:
item, label = check
start(label)
last = status['runs'].get(item)
if last is None:
ok('Never')
else:
last_delta = pscheduler.iso8601_as_datetime(last) \
- pscheduler.time_now()
ok(babel.dates.format_timedelta(last_delta, add_direction=True))


def dump_stats(host):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Vcs-Browser: https://github.com/perfsonar/pscheduler
Package: pscheduler-core
Architecture: all
Depends: ${misc:Depends}, python3-pscheduler (>= 4.4.0~),
curl, dmidecode, lsof
python3-babel, curl, dmidecode, lsof
Recommends: gnuplot-nox | gnuplot5-nox | gnuplot | gnuplot5
Description: pScheduler core programs
Core programs for pScheduler
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Requires: gnuplot >= 4.6.2

# This is for netstat.
Requires: net-tools
Requires: python-babel
Requires: python-pscheduler >= 4.4.0

Requires: curl
Expand Down

0 comments on commit 21e4547

Please sign in to comment.