diff --git a/README.md b/README.md index ec5a0c8..b19b25e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A little tool to make it easier to inspect LSF jobs. ```shell -usage: mjobs [-h] [-q QUEUE] [-u USER] [-r] [-a] [-d] [-G USER_GROUP] [-g GROUP] [-m HOSTS] [-p] [-e] [-f FILTER] [job_id ...] +usage: mjobs [-h] [-q QUEUE] [-u USER] [-r] [-a] [-d] [-G USER_GROUP] [-g GROUP] [-m HOSTS] [-p] [-e] [-f FILTER] [-t] [job_id ...] bjobs but a bit nicer @@ -23,8 +23,13 @@ optional arguments: -p Displays pending jobs, together with the pending reasons that caused each job not to be dispatched during the last dispatch turn. -e Add the output file and error file to the table. -f FILTER Filter the jobs using the specified regex on the job name or pending reason. + -t No fancy table, a good ol' tsv ``` +## Example + +![Alt text](images/mjobs-example.png?raw=true "mjobs example") + # Installation - bundle the app Create an executable with [pyinstaller](https://pyinstaller.readthedocs.io). diff --git a/mjobs/lsf.py b/mjobs/lsf.py index a78e604..9946151 100644 --- a/mjobs/lsf.py +++ b/mjobs/lsf.py @@ -50,6 +50,7 @@ def get_jobs(job_ids: Optional[list[int]] = None, lsf_args: Optional[List[str]] "job_group", "user", "queue", + "submit_time", "start_time", "finish_time", "exec_host", diff --git a/mjobs/main.py b/mjobs/main.py index 31c54e4..d839066 100644 --- a/mjobs/main.py +++ b/mjobs/main.py @@ -97,7 +97,7 @@ def _get_args(): "-e", dest="extended", action="store_true", - help=("Add the output file and error file to the table."), + help="Add the output file and error file to the table.", ) parser.add_argument( "-f", @@ -175,6 +175,7 @@ def _get_args(): {"header": "JobGroup"}, {"header": "User"}, {"header": "Queue"}, + {"header": "Submit Time"}, {"header": "Start Time"}, {"header": "Finish Time"}, {"header": "Exec. Host"}, @@ -191,8 +192,8 @@ def _get_args(): job_name = Text(job["JOB_NAME"]) pending_reason = Text(job["PEND_REASON"]) or Text("----", justify="center") if args.filter: - job_name.highlight_regex(fr"{args.filter}", "bold red") - pending_reason.highlight_regex(fr"{args.filter}", "bold red") + job_name.highlight_regex(rf"{args.filter}", "bold red") + pending_reason.highlight_regex(rf"{args.filter}", "bold red") row = [ job["JOBID"], @@ -201,6 +202,7 @@ def _get_args(): job["JOB_GROUP"] or Text("----", justify="center"), job["USER"], job["QUEUE"], + job["SUBMIT_TIME"], job["START_TIME"], job["FINISH_TIME"], Text(job["EXEC_HOST"], overflow="fold"),