Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
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
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue 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
TFS
controller
Commits
3c6a9d5d
Commit
3c6a9d5d
authored
2 years ago
by
famelis
Browse files
Options
Downloads
Patches
Plain Diff
fix: parse "NaN" for Min/Max values and appropriate checks
parent
14a226be
No related branches found
No related tags found
2 merge requests
!142
Release TeraFlowSDN 2.1
,
!82
Monitoring: fixes regarding the kpi value ranges
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/monitoring/service/MetricsDBTools.py
+20
-26
20 additions, 26 deletions
src/monitoring/service/MetricsDBTools.py
src/monitoring/service/MonitoringServiceServicerImpl.py
+2
-2
2 additions, 2 deletions
src/monitoring/service/MonitoringServiceServicerImpl.py
with
22 additions
and
28 deletions
src/monitoring/service/MetricsDBTools.py
+
20
−
26
View file @
3c6a9d5d
...
@@ -264,63 +264,57 @@ class MetricsDB():
...
@@ -264,63 +264,57 @@ class MetricsDB():
for
kpi
in
kpi_list
:
for
kpi
in
kpi_list
:
alarm
=
False
alarm
=
False
kpi_value
=
kpi
[
2
]
kpi_value
=
kpi
[
2
]
kpiMinIsNone
=
((
kpiMinValue
is
None
)
or
math
.
isnan
(
kpiMinValue
))
kpiMaxIsNone
=
((
kpiMaxValue
is
None
)
or
math
.
isnan
(
kpiMaxValue
))
if
(
kpiMinValue
==
kpi_value
and
kpiMaxValue
==
kpi_value
and
inRange
):
if
(
kpiMinValue
==
kpi_value
and
kpiMaxValue
==
kpi_value
and
inRange
):
alarm
=
True
alarm
=
True
elif
(
elif
(
inRange
and
not
kpiMinIsNone
and
not
kpiMaxIsNone
and
includeMinValue
and
includeMaxValue
):
inRange
and
kpiMinValue
is
not
None
and
kpiMaxValue
is
not
None
and
includeMinValue
and
includeMaxValue
):
if
(
kpi_value
>=
kpiMinValue
and
kpi_value
<=
kpiMaxValue
):
if
(
kpi_value
>=
kpiMinValue
and
kpi_value
<=
kpiMaxValue
):
alarm
=
True
alarm
=
True
elif
(
elif
(
inRange
and
not
kpiMinIsNone
and
not
kpiMaxIsNone
and
includeMinValue
and
not
includeMaxValue
):
inRange
and
kpiMinValue
is
not
None
and
kpiMaxValue
is
not
None
and
includeMinValue
and
not
includeMaxValue
):
if
(
kpi_value
>=
kpiMinValue
and
kpi_value
<
kpiMaxValue
):
if
(
kpi_value
>=
kpiMinValue
and
kpi_value
<
kpiMaxValue
):
alarm
=
True
alarm
=
True
elif
(
elif
(
inRange
and
not
kpiMinIsNone
and
not
kpiMaxIsNone
and
not
includeMinValue
and
includeMaxValue
):
inRange
and
kpiMinValue
is
not
None
and
kpiMaxValue
is
not
None
and
not
includeMinValue
and
includeMaxValue
):
if
(
kpi_value
>
kpiMinValue
and
kpi_value
<=
kpiMaxValue
):
if
(
kpi_value
>
kpiMinValue
and
kpi_value
<=
kpiMaxValue
):
alarm
=
True
alarm
=
True
elif
(
elif
(
inRange
and
not
kpiMinIsNone
and
not
kpiMaxIsNone
and
not
includeMinValue
and
not
includeMaxValue
):
inRange
and
kpiMinValue
is
not
None
and
kpiMaxValue
is
not
None
and
not
includeMinValue
and
not
includeMaxValue
):
if
(
kpi_value
>
kpiMinValue
and
kpi_value
<
kpiMaxValue
):
if
(
kpi_value
>
kpiMinValue
and
kpi_value
<
kpiMaxValue
):
alarm
=
True
alarm
=
True
elif
(
elif
(
not
inRange
and
not
kpiMinIsNone
and
not
kpiMaxIsNone
and
includeMinValue
and
includeMaxValue
):
not
inRange
and
kpiMinValue
is
not
None
and
kpiMaxValue
is
not
None
and
includeMinValue
and
includeMaxValue
):
if
(
kpi_value
<=
kpiMinValue
or
kpi_value
>=
kpiMaxValue
):
if
(
kpi_value
<=
kpiMinValue
or
kpi_value
>=
kpiMaxValue
):
alarm
=
True
alarm
=
True
elif
(
elif
(
not
inRange
and
not
kpiMinIsNone
and
not
kpiMaxIsNone
and
includeMinValue
and
not
includeMaxValue
):
not
inRange
and
kpiMinValue
is
not
None
and
kpiMaxValue
is
not
None
and
includeMinValue
and
not
includeMaxValue
):
if
(
kpi_value
<=
kpiMinValue
or
kpi_value
>
kpiMaxValue
):
if
(
kpi_value
<=
kpiMinValue
or
kpi_value
>
kpiMaxValue
):
alarm
=
True
alarm
=
True
elif
(
elif
(
not
inRange
and
not
kpiMinIsNone
and
not
kpiMaxIsNone
and
not
includeMinValue
and
includeMaxValue
):
not
inRange
and
kpiMinValue
is
not
None
and
kpiMaxValue
is
not
None
and
not
includeMinValue
and
includeMaxValue
):
if
(
kpi_value
<
kpiMinValue
or
kpi_value
>=
kpiMaxValue
):
if
(
kpi_value
<
kpiMinValue
or
kpi_value
>=
kpiMaxValue
):
alarm
=
True
alarm
=
True
elif
(
elif
(
not
inRange
and
not
kpiMinIsNone
and
not
kpiMaxIsNone
and
not
includeMinValue
and
not
includeMaxValue
):
not
inRange
and
kpiMinValue
is
not
None
and
kpiMaxValue
is
not
None
and
not
includeMinValue
and
not
includeMaxValue
):
if
(
kpi_value
<
kpiMinValue
or
kpi_value
>
kpiMaxValue
):
if
(
kpi_value
<
kpiMinValue
or
kpi_value
>
kpiMaxValue
):
alarm
=
True
alarm
=
True
elif
(
inRange
and
kpiMin
Value
is
not
None
and
kpiMax
Value
is
None
and
includeMinValue
):
elif
(
inRange
and
not
kpiMin
Is
None
and
kpiMax
Is
None
and
includeMinValue
):
if
(
kpi_value
>=
kpiMinValue
):
if
(
kpi_value
>=
kpiMinValue
):
alarm
=
True
alarm
=
True
elif
(
inRange
and
kpiMin
Value
is
not
None
and
kpiMax
Value
is
None
and
not
includeMinValue
):
elif
(
inRange
and
not
kpiMin
Is
None
and
kpiMax
Is
None
and
not
includeMinValue
):
if
(
kpi_value
>
kpiMinValue
):
if
(
kpi_value
>
kpiMinValue
):
alarm
=
True
alarm
=
True
elif
(
not
inRange
and
kpiMin
Value
is
not
None
and
kpiMax
Value
is
None
and
not
includeMinValue
):
elif
(
not
inRange
and
not
kpiMin
Is
None
and
kpiMax
Is
None
and
includeMinValue
):
if
(
kpi_value
<=
kpiMinValue
):
if
(
kpi_value
<=
kpiMinValue
):
alarm
=
True
alarm
=
True
elif
(
not
inRange
and
kpiMin
Value
is
not
None
and
kpiMax
Value
is
None
and
not
includeMinValue
):
elif
(
not
inRange
and
not
kpiMin
Is
None
and
kpiMax
Is
None
and
not
includeMinValue
):
if
(
kpi_value
<
=
kpiMinValue
):
if
(
kpi_value
<
kpiMinValue
):
alarm
=
True
alarm
=
True
elif
(
inRange
and
kpiMin
Value
is
None
and
kpiMax
Value
is
not
None
and
includeMaxValue
):
elif
(
inRange
and
kpiMin
Is
None
and
not
kpiMax
Is
None
and
includeMaxValue
):
if
(
kpi_value
<=
kpiMaxValue
):
if
(
kpi_value
<=
kpiMaxValue
):
alarm
=
True
alarm
=
True
elif
(
inRange
and
kpiMin
Value
is
None
and
kpiMax
Value
is
not
None
and
not
includeMaxValue
):
elif
(
inRange
and
kpiMin
Is
None
and
not
kpiMax
Is
None
and
not
includeMaxValue
):
if
(
kpi_value
<
kpiMaxValue
):
if
(
kpi_value
<
kpiMaxValue
):
alarm
=
True
alarm
=
True
elif
(
not
inRange
and
kpiMin
Value
is
None
and
kpiMax
Value
is
not
None
and
not
includeMaxValue
):
elif
(
not
inRange
and
kpiMin
Is
None
and
not
kpiMax
Is
None
and
includeMaxValue
):
if
(
kpi_value
>=
kpiMaxValue
):
if
(
kpi_value
>=
kpiMaxValue
):
alarm
=
True
alarm
=
True
elif
(
not
inRange
and
kpiMin
Value
is
None
and
kpiMax
Value
is
not
None
and
not
includeMaxValue
):
elif
(
not
inRange
and
kpiMin
Is
None
and
not
kpiMax
Is
None
and
not
includeMaxValue
):
if
(
kpi_value
>
=
kpiMaxValue
):
if
(
kpi_value
>
kpiMaxValue
):
alarm
=
True
alarm
=
True
if
alarm
:
if
alarm
:
valid_kpi_list
.
append
(
kpi
)
valid_kpi_list
.
append
(
kpi
)
...
...
This diff is collapsed.
Click to expand it.
src/monitoring/service/MonitoringServiceServicerImpl.py
+
2
−
2
View file @
3c6a9d5d
...
@@ -407,8 +407,8 @@ class MonitoringServiceServicerImpl(MonitoringServiceServicer):
...
@@ -407,8 +407,8 @@ class MonitoringServiceServicerImpl(MonitoringServiceServicer):
alarm_description
=
request
.
alarm_description
alarm_description
=
request
.
alarm_description
alarm_name
=
request
.
name
alarm_name
=
request
.
name
kpi_id
=
request
.
kpi_id
.
kpi_id
.
uuid
kpi_id
=
request
.
kpi_id
.
kpi_id
.
uuid
kpi_min_value
=
request
.
kpi_value_range
.
kpiMinValue
.
floatVal
kpi_min_value
=
float
(
request
.
kpi_value_range
.
kpiMinValue
.
floatVal
)
kpi_max_value
=
request
.
kpi_value_range
.
kpiMaxValue
.
floatVal
kpi_max_value
=
float
(
request
.
kpi_value_range
.
kpiMaxValue
.
floatVal
)
in_range
=
request
.
kpi_value_range
.
inRange
in_range
=
request
.
kpi_value_range
.
inRange
include_min_value
=
request
.
kpi_value_range
.
includeMinValue
include_min_value
=
request
.
kpi_value_range
.
includeMinValue
include_max_value
=
request
.
kpi_value_range
.
includeMaxValue
include_max_value
=
request
.
kpi_value_range
.
includeMaxValue
...
...
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