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
7d8a7078
Commit
7d8a7078
authored
2 years ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
Monitoring component:
- corrected error in GetInstantKpi method
parent
55ee19c0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!54
Release 2.0.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/monitoring/service/MonitoringServiceServicerImpl.py
+7
-7
7 additions, 7 deletions
src/monitoring/service/MonitoringServiceServicerImpl.py
with
7 additions
and
7 deletions
src/monitoring/service/MonitoringServiceServicerImpl.py
+
7
−
7
View file @
7d8a7078
...
@@ -602,23 +602,23 @@ class MonitoringServiceServicerImpl(MonitoringServiceServicer):
...
@@ -602,23 +602,23 @@ class MonitoringServiceServicerImpl(MonitoringServiceServicer):
else
:
else
:
query
=
f
"
SELECT kpi_id, timestamp, kpi_value FROM monitoring WHERE kpi_id =
'
{
kpi_id
}
'
"
\
query
=
f
"
SELECT kpi_id, timestamp, kpi_value FROM monitoring WHERE kpi_id =
'
{
kpi_id
}
'
"
\
f
"
LATEST ON timestamp PARTITION BY kpi_id
"
f
"
LATEST ON timestamp PARTITION BY kpi_id
"
data
=
self
.
metrics_db
.
run_query
(
query
)
[
0
]
data
=
self
.
metrics_db
.
run_query
(
query
)
LOGGER
.
debug
(
data
)
LOGGER
.
debug
(
data
)
if
len
(
data
)
==
0
:
if
len
(
data
)
==
0
:
response
.
kpi_id
.
kpi_id
.
uuid
=
request
.
kpi_id
.
uuid
response
.
kpi_id
.
kpi_id
.
uuid
=
request
.
kpi_id
.
uuid
else
:
else
:
data
=
data
[
0
]
_
data
=
data
[
0
]
response
.
kpi_id
.
kpi_id
.
uuid
=
str
(
data
[
0
])
response
.
kpi_id
.
kpi_id
.
uuid
=
str
(
_
data
[
0
])
response
.
timestamp
.
timestamp
=
timestamp_string_to_float
(
data
[
1
])
response
.
timestamp
.
timestamp
=
timestamp_string_to_float
(
_
data
[
1
])
response
.
kpi_value
.
floatVal
=
data
[
2
]
response
.
kpi_value
.
floatVal
=
_
data
[
2
]
return
response
return
response
except
ServiceException
as
e
:
except
ServiceException
as
e
:
LOGGER
.
exception
(
'
Se
tKpi exception
'
)
LOGGER
.
exception
(
'
GetInstan
tKpi exception
'
)
# CREATEKPI_COUNTER_FAILED.inc()
# CREATEKPI_COUNTER_FAILED.inc()
grpc_context
.
abort
(
e
.
code
,
e
.
details
)
grpc_context
.
abort
(
e
.
code
,
e
.
details
)
except
Exception
as
e
:
# pragma: no cover
except
Exception
as
e
:
# pragma: no cover
LOGGER
.
exception
(
'
Se
tKpi exception
'
)
LOGGER
.
exception
(
'
GetInstan
tKpi exception
'
)
# CREATEKPI_COUNTER_FAILED.inc()
# CREATEKPI_COUNTER_FAILED.inc()
grpc_context
.
abort
(
grpc
.
StatusCode
.
INTERNAL
,
str
(
e
))
grpc_context
.
abort
(
grpc
.
StatusCode
.
INTERNAL
,
str
(
e
))
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