Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
18bb3da5
Commit
18bb3da5
authored
Feb 27, 2018
by
Anton Evangelatov
Committed by
Péter Szilágyi
Feb 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
node: fill StandardCounters as part of debugapi/metrics (#16054)
parent
dd389e59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
api.go
node/api.go
+10
-0
No files found.
node/api.go
View file @
18bb3da5
...
@@ -308,6 +308,11 @@ func (api *PublicDebugAPI) Metrics(raw bool) (map[string]interface{}, error) {
...
@@ -308,6 +308,11 @@ func (api *PublicDebugAPI) Metrics(raw bool) (map[string]interface{}, error) {
// Fill the counter with the metric details, formatting if requested
// Fill the counter with the metric details, formatting if requested
if
raw
{
if
raw
{
switch
metric
:=
metric
.
(
type
)
{
switch
metric
:=
metric
.
(
type
)
{
case
metrics
.
Counter
:
root
[
name
]
=
map
[
string
]
interface
{}{
"Overall"
:
float64
(
metric
.
Count
()),
}
case
metrics
.
Meter
:
case
metrics
.
Meter
:
root
[
name
]
=
map
[
string
]
interface
{}{
root
[
name
]
=
map
[
string
]
interface
{}{
"AvgRate01Min"
:
metric
.
Rate1
(),
"AvgRate01Min"
:
metric
.
Rate1
(),
...
@@ -338,6 +343,11 @@ func (api *PublicDebugAPI) Metrics(raw bool) (map[string]interface{}, error) {
...
@@ -338,6 +343,11 @@ func (api *PublicDebugAPI) Metrics(raw bool) (map[string]interface{}, error) {
}
}
}
else
{
}
else
{
switch
metric
:=
metric
.
(
type
)
{
switch
metric
:=
metric
.
(
type
)
{
case
metrics
.
Counter
:
root
[
name
]
=
map
[
string
]
interface
{}{
"Overall"
:
float64
(
metric
.
Count
()),
}
case
metrics
.
Meter
:
case
metrics
.
Meter
:
root
[
name
]
=
map
[
string
]
interface
{}{
root
[
name
]
=
map
[
string
]
interface
{}{
"Avg01Min"
:
format
(
metric
.
Rate1
()
*
60
,
metric
.
Rate1
()),
"Avg01Min"
:
format
(
metric
.
Rate1
()
*
60
,
metric
.
Rate1
()),
...
...
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