job_tracker
Job lifecycle tracking from start to completion.
Classes¶
JobLifecycleTracker ¶
Tracks jobs from start to completion.
Maintains state for started jobs, finished job IDs, and completed jobs with full timing information.
Source code in snakesee/parser/job_tracker.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | |
Functions¶
__init__ ¶
Initialize the job tracker.
finish_job ¶
finish_job(jobid: str, end_time: float | None = None) -> JobInfo | None
Record a job finishing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jobid
|
str
|
Job identifier. |
required |
end_time
|
float | None
|
Unix timestamp when job finished. |
None
|
Returns:
| Type | Description |
|---|---|
JobInfo | None
|
JobInfo for the completed job, or None if job was not tracked. |
Source code in snakesee/parser/job_tracker.py
get_completed_jobs ¶
get_completed_jobs() -> list[JobInfo]
Get list of completed jobs sorted by end time (newest first).
Returns:
| Type | Description |
|---|---|
list[JobInfo]
|
List of JobInfo for completed jobs. |
Source code in snakesee/parser/job_tracker.py
get_job_log ¶
Get the log file path for a job.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jobid
|
str
|
Job identifier. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Log file path or None if not set. |
get_running_jobs ¶
get_running_jobs() -> list[JobInfo]
Get list of jobs that started but haven't finished.
Returns:
| Type | Description |
|---|---|
list[JobInfo]
|
List of JobInfo for running jobs. |
Source code in snakesee/parser/job_tracker.py
is_job_started ¶
Check if a job has been started.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jobid
|
str
|
Job identifier. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the job has been started. |
reset ¶
set_job_log ¶
Set the log file path for a job.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jobid
|
str
|
Job identifier. |
required |
log_path
|
str
|
Path to the log file. |
required |
start_job ¶
start_job(jobid: str, rule: str, start_time: float | None = None, wildcards: dict[str, str] | None = None, threads: int | None = None) -> None
Record a job starting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jobid
|
str
|
Unique job identifier. |
required |
rule
|
str
|
Name of the rule. |
required |
start_time
|
float | None
|
Unix timestamp when job started. |
None
|
wildcards
|
dict[str, str] | None
|
Wildcard values for this job. |
None
|
threads
|
int | None
|
Number of threads allocated. |
None
|
Source code in snakesee/parser/job_tracker.py
update_job ¶
Update an existing job's metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jobid
|
str
|
Job identifier. |
required |
wildcards
|
dict[str, str] | None
|
Wildcard values to update. |
None
|
threads
|
int | None
|
Thread count to update. |
None
|
Source code in snakesee/parser/job_tracker.py
StartedJobData ¶
Bases: TypedDict
Data for a job that has started but not finished.