Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
oar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Jeremy Auguste
oar
Commits
25b6ebdb
Commit
25b6ebdb
authored
6 years ago
by
Jeremy Auguste
Browse files
Options
Downloads
Patches
Plain Diff
Fixed naming issues
parent
9e4b61fd
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
oarstats.py
+6
-6
6 additions, 6 deletions
oarstats.py
with
6 additions
and
6 deletions
oarstats.py
+
6
−
6
View file @
25b6ebdb
...
...
@@ -24,9 +24,9 @@ class Owner:
self
.
queues
[
job
.
queue
].
append
(
job
)
if
job
.
karma
>
self
.
karma
:
self
.
karma
=
job
.
karma
self
.
timeleft
+=
job
.
duration
-
job
.
e
xec
_time
self
.
timeleft
+=
job
.
wall_time
-
job
.
e
lapsed
_time
self
.
resources
[
job
.
queue
]
+=
job
.
resources
if
job
.
start
_time
!=
0
:
if
job
.
elapsed
_time
!=
0
:
self
.
running
[
job
.
queue
]
+=
1
if
job
.
gpu
:
self
.
gpu
[
job
.
queue
]
+=
job
.
resources
...
...
@@ -38,9 +38,9 @@ class Owner:
class
Job
:
def
__init__
(
self
,
job_id
,
start
_time
,
wall_time
,
resources
,
devices
,
gpu
,
queue
,
karma
):
def
__init__
(
self
,
job_id
,
elapsed
_time
,
wall_time
,
resources
,
devices
,
gpu
,
queue
,
karma
):
self
.
job_id
=
job_id
self
.
start
_time
=
start
_time
self
.
elapsed
_time
=
elapsed
_time
self
.
wall_time
=
wall_time
self
.
resources
=
resources
self
.
devices
=
devices
...
...
@@ -79,7 +79,7 @@ def main():
for
job_id
,
job_info
in
stats_yaml
.
items
():
if
job_info
[
"
owner
"
]
not
in
owners
:
owners
[
job_info
[
"
owner
"
]]
=
Owner
(
job_info
[
"
owner
"
])
start
_time
=
0
if
job_info
[
"
startTime
"
]
==
0
else
time
.
time
()
-
job_info
[
"
startTime
"
]
elapsed
_time
=
0
if
job_info
[
"
startTime
"
]
==
0
else
time
.
time
()
-
job_info
[
"
startTime
"
]
tokens
=
re
.
search
(
walltime_pattern
,
job_info
[
"
message
"
]).
group
(
1
).
split
(
'
:
'
)
wall_time
=
int
(
tokens
[
0
])
*
3600
+
int
(
tokens
[
1
])
*
60
+
int
(
tokens
[
2
])
resources
=
int
(
re
.
search
(
resources_pattern
,
job_info
[
"
message
"
]).
group
(
1
))
...
...
@@ -87,7 +87,7 @@ def main():
karma
=
float
(
re
.
search
(
karma_pattern
,
job_info
[
"
message
"
]).
group
(
1
))
devices
=
job_info
[
"
assigned_network_address
"
]
gpu
=
re
.
search
(
gpu_pattern
,
job_info
[
"
properties
"
])
is
not
None
job
=
Job
(
job_id
,
start
_time
,
wall_time
,
resources
,
devices
,
gpu
,
queue
,
karma
)
job
=
Job
(
job_id
,
elapsed
_time
,
wall_time
,
resources
,
devices
,
gpu
,
queue
,
karma
)
owners
[
job_info
[
"
owner
"
]].
add_job
(
job
)
for
owner
in
owners
.
values
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment