Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
7e6f2824
Commit
7e6f2824
authored
Nov 25, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rendering of histograms
parent
ec3b75a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
libcaf_core/src/telemetry/collector/prometheus.cpp
libcaf_core/src/telemetry/collector/prometheus.cpp
+7
-8
libcaf_core/test/telemetry/collector/prometheus.cpp
libcaf_core/test/telemetry/collector/prometheus.cpp
+2
-2
No files found.
libcaf_core/src/telemetry/collector/prometheus.cpp
View file @
7e6f2824
...
...
@@ -299,15 +299,14 @@ void prometheus::append_histogram(const metric_family* family,
set_current_family
(
family
,
"histogram"
);
auto
&
vm
=
i
->
second
;
auto
buckets
=
val
->
buckets
();
size_t
index
=
0
;
for
(;
index
<
buckets
.
size
()
-
1
;
++
index
)
{
append
(
buf_
,
vm
[
index
],
buckets
[
index
].
count
.
value
(),
' '
,
ms_timestamp
{
now_
},
'\n'
);
auto
acc
=
ValueType
{
0
};
auto
index
=
size_t
{
0
};
for
(;
index
<
buckets
.
size
();
++
index
)
{
acc
+=
buckets
[
index
].
count
.
value
();
append
(
buf_
,
vm
[
index
],
acc
,
' '
,
ms_timestamp
{
now_
},
'\n'
);
}
auto
count
=
buckets
[
index
].
count
.
value
();
append
(
buf_
,
vm
[
index
],
count
,
' '
,
ms_timestamp
{
now_
},
'\n'
);
append
(
buf_
,
vm
[
++
index
],
val
->
sum
(),
' '
,
ms_timestamp
{
now_
},
'\n'
);
append
(
buf_
,
vm
[
++
index
],
count
,
' '
,
ms_timestamp
{
now_
},
'\n'
);
append
(
buf_
,
vm
[
index
++
],
val
->
sum
(),
' '
,
ms_timestamp
{
now_
},
'\n'
);
append
(
buf_
,
vm
[
index
++
],
acc
,
' '
,
ms_timestamp
{
now_
},
'\n'
);
}
}
// namespace caf::telemetry::collector
libcaf_core/test/telemetry/collector/prometheus.cpp
View file @
7e6f2824
...
...
@@ -73,9 +73,9 @@ other_value_seconds_total{x="true"} 31337 42000
some_request_duration_seconds_bucket{x="get",le="1"} 0 42000
some_request_duration_seconds_bucket{x="get",le="2"} 0 42000
some_request_duration_seconds_bucket{x="get",le="4"} 2 42000
some_request_duration_seconds_bucket{x="get",le="+Inf"}
1
42000
some_request_duration_seconds_bucket{x="get",le="+Inf"}
3
42000
some_request_duration_seconds_sum{x="get"} 14 42000
some_request_duration_seconds_count{x="get"}
1
42000
some_request_duration_seconds_count{x="get"}
3
42000
)"
_sv
);
CAF_MESSAGE
(
"multiple runs generate the same output"
);
std
::
string
res1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment