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
359705e3
Commit
359705e3
authored
2 years ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
Common - Method Wrappers:
- corrected metrics names
parent
ed1e9819
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!54
Release 2.0.0
,
!34
Context Scalability extensions using CockroachDB + Removal of Stateful database inside Device + other
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/common/method_wrappers/Decorator.py
+4
-4
4 additions, 4 deletions
src/common/method_wrappers/Decorator.py
with
4 additions
and
4 deletions
src/common/method_wrappers/Decorator.py
+
4
−
4
View file @
359705e3
...
@@ -100,7 +100,7 @@ class MetricsPool:
...
@@ -100,7 +100,7 @@ class MetricsPool:
if
field_name
==
'
_bucket
'
:
bucket_bounds
.
add
(
labels
[
'
le
'
])
if
field_name
==
'
_bucket
'
:
bucket_bounds
.
add
(
labels
[
'
le
'
])
if
len
(
labels
)
>
0
:
field_name
=
'
{:s}:{:s}
'
.
format
(
field_name
,
json
.
dumps
(
labels
,
sort_keys
=
True
))
if
len
(
labels
)
>
0
:
field_name
=
'
{:s}:{:s}
'
.
format
(
field_name
,
json
.
dumps
(
labels
,
sort_keys
=
True
))
metric_data
[
field_name
]
=
value
metric_data
[
field_name
]
=
value
print
(
'
method_to_metric_fields
'
,
method_to_metric_fields
)
#
print('method_to_metric_fields', method_to_metric_fields)
def
sort_stats_key
(
item
:
List
)
->
float
:
def
sort_stats_key
(
item
:
List
)
->
float
:
str_duration
=
str
(
item
[
0
])
str_duration
=
str
(
item
[
0
])
...
@@ -118,12 +118,12 @@ class MetricsPool:
...
@@ -118,12 +118,12 @@ class MetricsPool:
for
f
in
[
'
Method
'
]:
pt_stats
.
align
[
f
]
=
'
l
'
for
f
in
[
'
Method
'
]:
pt_stats
.
align
[
f
]
=
'
l
'
for
method_name
,
metrics
in
method_to_metric_fields
.
items
():
for
method_name
,
metrics
in
method_to_metric_fields
.
items
():
counter_started_value
=
int
(
metrics
[
'
STARTED
'
][
'
_total
'
])
counter_started_value
=
int
(
metrics
[
'
REQUESTS_
STARTED
'
][
'
_total
'
])
if
counter_started_value
==
0
:
if
counter_started_value
==
0
:
#pt_stats.add_row([method_name, '---', '---', '---', '---'])
#pt_stats.add_row([method_name, '---', '---', '---', '---'])
continue
continue
counter_completed_value
=
int
(
metrics
[
'
COMPLETED
'
][
'
_total
'
])
counter_completed_value
=
int
(
metrics
[
'
REQUESTS_
COMPLETED
'
][
'
_total
'
])
counter_failed_value
=
int
(
metrics
[
'
FAILED
'
][
'
_total
'
])
counter_failed_value
=
int
(
metrics
[
'
REQUESTS_
FAILED
'
][
'
_total
'
])
duration_count_value
=
float
(
metrics
[
'
DURATION
'
][
'
_count
'
])
duration_count_value
=
float
(
metrics
[
'
DURATION
'
][
'
_count
'
])
duration_sum_value
=
float
(
metrics
[
'
DURATION
'
][
'
_sum
'
])
duration_sum_value
=
float
(
metrics
[
'
DURATION
'
][
'
_sum
'
])
duration_avg_value
=
duration_sum_value
/
duration_count_value
duration_avg_value
=
duration_sum_value
/
duration_count_value
...
...
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