Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
71e2c40f
Commit
71e2c40f
authored
1 year ago
by
Jörn Künsemöller
Committed by
Reinder Kraaij
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-2903
: add additonal percentages to failure report
parent
5042a63f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1293
TMSS-2903: add additonal percentages to failure report
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/backend/src/tmss/tmssapp/adapters/reports.py
+10
-1
10 additions, 1 deletion
SAS/TMSS/backend/src/tmss/tmssapp/adapters/reports.py
with
10 additions
and
1 deletion
SAS/TMSS/backend/src/tmss/tmssapp/adapters/reports.py
+
10
−
1
View file @
71e2c40f
...
@@ -673,7 +673,6 @@ class FailureReport():
...
@@ -673,7 +673,6 @@ class FailureReport():
.
annotate
(
count
=
Count
(
f
'
{
field_name
}
__value
'
),
.
annotate
(
count
=
Count
(
f
'
{
field_name
}
__value
'
),
duration_lost_event
=
Sum
(
Coalesce
(
F
(
'
stop
'
),
datetime
.
utcnow
())
-
F
(
'
start
'
))))
duration_lost_event
=
Sum
(
Coalesce
(
F
(
'
stop
'
),
datetime
.
utcnow
())
-
F
(
'
start
'
))))
for
d
in
group_aggregates
:
for
d
in
group_aggregates
:
# determine total duration of affected scheduling units
# determine total duration of affected scheduling units
system_events
=
self
.
system_events
.
filter
(
**
{
f
'
{
field_name
}
__value
'
:
d
[
f
'
{
field_name
}
__value
'
]})
system_events
=
self
.
system_events
.
filter
(
**
{
f
'
{
field_name
}
__value
'
:
d
[
f
'
{
field_name
}
__value
'
]})
...
@@ -687,7 +686,17 @@ class FailureReport():
...
@@ -687,7 +686,17 @@ class FailureReport():
'
percent_of_wall_time_lost_event
'
:
100
*
d
[
'
duration_lost_event
'
].
total_seconds
()
/
wall_time
,
'
percent_of_wall_time_lost_event
'
:
100
*
d
[
'
duration_lost_event
'
].
total_seconds
()
/
wall_time
,
'
percent_of_wall_time_lost_on_sky
'
:
total_on_sky_duration_lost
.
total_seconds
()
/
wall_time
if
total_on_sky_duration_lost
else
0
})
'
percent_of_wall_time_lost_on_sky
'
:
total_on_sky_duration_lost
.
total_seconds
()
/
wall_time
if
total_on_sky_duration_lost
else
0
})
total_failure_event_time
=
sum
([
d
[
'
duration_lost_event
'
]
for
d
in
group_aggregates
])
total_failure_on_sky_time
=
sum
([
d
[
'
duration_lost_on_sky
'
]
for
d
in
group_aggregates
])
total_failure_count
=
sum
(
d
[
'
count
'
]
for
d
in
group_aggregates
)
for
d
in
group_aggregates
:
d
.
update
({
'
percent_of_total_failure_time_lost_event
'
:
100
*
d
[
'
duration_lost_event
'
]
/
total_failure_event_time
if
total_failure_event_time
else
0
,
'
percent_of_total_failure_time_lost_on_sky
'
:
100
*
d
[
'
duration_lost_on_sky
'
]
/
total_failure_on_sky_time
if
total_failure_on_sky_time
else
0
,
'
percent_of_total_failure_count
'
:
100
*
d
[
'
count
'
]
/
total_failure_count
if
total_failure_count
else
0
})
aggregates
[
f
'
by_
{
field_name
}
'
]
=
group_aggregates
aggregates
[
f
'
by_
{
field_name
}
'
]
=
group_aggregates
return
aggregates
return
aggregates
def
_get_lost_observing_time_histogram
(
self
,
ignore_time_range
=
True
)
->
{}:
def
_get_lost_observing_time_histogram
(
self
,
ignore_time_range
=
True
)
->
{}:
...
...
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