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
7f92e708
Commit
7f92e708
authored
Jun 21, 2015
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/geth, core: impl. percentile reporting, instrument insertions
parent
b4263014
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
admin.go
cmd/geth/admin.go
+11
-7
chain_manager.go
core/chain_manager.go
+4
-1
No files found.
cmd/geth/admin.go
View file @
7f92e708
...
...
@@ -735,7 +735,6 @@ func (js *jsre) metrics(call otto.FunctionCall) otto.Value {
format
:=
func
(
total
float64
,
rate
float64
)
string
{
return
fmt
.
Sprintf
(
"%s (%s/s)"
,
round
(
total
,
0
),
round
(
rate
,
2
))
}
// Iterate over all the metrics, and just dump for now
counters
:=
make
(
map
[
string
]
interface
{})
metrics
.
DefaultRegistry
.
Each
(
func
(
name
string
,
metric
interface
{})
{
...
...
@@ -756,7 +755,7 @@ func (js *jsre) metrics(call otto.FunctionCall) otto.Value {
"Avg01Min"
:
format
(
metric
.
Rate1
()
*
60
,
metric
.
Rate1
()),
"Avg05Min"
:
format
(
metric
.
Rate5
()
*
300
,
metric
.
Rate5
()),
"Avg15Min"
:
format
(
metric
.
Rate15
()
*
900
,
metric
.
Rate15
()),
"
Overall"
:
format
(
float64
(
metric
.
Count
()),
metric
.
RateMean
()),
"
Total"
:
format
(
float64
(
metric
.
Count
()),
metric
.
RateMean
()),
}
case
metrics
.
Timer
:
...
...
@@ -764,11 +763,16 @@ func (js *jsre) metrics(call otto.FunctionCall) otto.Value {
"Avg01Min"
:
format
(
metric
.
Rate1
()
*
60
,
metric
.
Rate1
()),
"Avg05Min"
:
format
(
metric
.
Rate5
()
*
300
,
metric
.
Rate5
()),
"Avg15Min"
:
format
(
metric
.
Rate15
()
*
900
,
metric
.
Rate15
()),
"Overall"
:
format
(
float64
(
metric
.
Count
()),
metric
.
RateMean
()),
"Perc01"
:
round
(
metric
.
Percentile
(
1
),
2
),
"Perc05"
:
round
(
metric
.
Percentile
(
5
),
2
),
"Perc25"
:
round
(
metric
.
Percentile
(
25
),
2
),
"Perc90"
:
round
(
metric
.
Percentile
(
90
),
2
),
"Count"
:
format
(
float64
(
metric
.
Count
()),
metric
.
RateMean
()),
"Maximum"
:
time
.
Duration
(
metric
.
Max
())
.
String
(),
"Minimum"
:
time
.
Duration
(
metric
.
Min
())
.
String
(),
"Percentile"
:
map
[
string
]
interface
{}{
"20"
:
time
.
Duration
(
metric
.
Percentile
(
0.2
))
.
String
(),
"50"
:
time
.
Duration
(
metric
.
Percentile
(
0.5
))
.
String
(),
"80"
:
time
.
Duration
(
metric
.
Percentile
(
0.8
))
.
String
(),
"95"
:
time
.
Duration
(
metric
.
Percentile
(
0.95
))
.
String
(),
"99"
:
time
.
Duration
(
metric
.
Percentile
(
0.99
))
.
String
(),
},
}
default
:
...
...
core/chain_manager.go
View file @
7f92e708
...
...
@@ -19,6 +19,7 @@ import (
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/pow"
"github.com/ethereum/go-ethereum/rlp"
"github.com/rcrowley/go-metrics"
)
var
(
...
...
@@ -27,6 +28,8 @@ var (
blockHashPre
=
[]
byte
(
"block-hash-"
)
blockNumPre
=
[]
byte
(
"block-num-"
)
blockInsertTimer
=
metrics
.
GetOrRegisterTimer
(
"core/BlockInsertions"
,
metrics
.
DefaultRegistry
)
)
const
(
...
...
@@ -691,7 +694,7 @@ func (self *ChainManager) InsertChain(chain types.Blocks) (int, error) {
self
.
futureBlocks
.
Delete
(
block
.
Hash
())
stats
.
processed
++
blockInsertTimer
.
UpdateSince
(
bstart
)
}
if
(
stats
.
queued
>
0
||
stats
.
processed
>
0
||
stats
.
ignored
>
0
)
&&
bool
(
glog
.
V
(
logger
.
Info
))
{
...
...
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