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
e9c0b543
Commit
e9c0b543
authored
Jun 25, 2015
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/geth: finalize mem stats
parent
fdbf8be7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
main.go
cmd/geth/main.go
+6
-6
monitorcmd.go
cmd/geth/monitorcmd.go
+1
-1
No files found.
cmd/geth/main.go
View file @
e9c0b543
...
@@ -289,10 +289,10 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
...
@@ -289,10 +289,10 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
}
}
// Start system runtime metrics collection
// Start system runtime metrics collection
go
func
()
{
go
func
()
{
used
:=
metrics
.
GetOrRegisterMeter
(
"system/memory/used"
,
metrics
.
DefaultRegistry
)
allocs
:=
metrics
.
GetOrRegisterMeter
(
"system/memory/allocs"
,
metrics
.
DefaultRegistry
)
total
:=
metrics
.
GetOrRegisterMeter
(
"system/memory/total"
,
metrics
.
DefaultRegistry
)
mallocs
:=
metrics
.
GetOrRegisterMeter
(
"system/memory/mallocs"
,
metrics
.
DefaultRegistry
)
frees
:=
metrics
.
GetOrRegisterMeter
(
"system/memory/frees"
,
metrics
.
DefaultRegistry
)
frees
:=
metrics
.
GetOrRegisterMeter
(
"system/memory/frees"
,
metrics
.
DefaultRegistry
)
inuse
:=
metrics
.
GetOrRegisterMeter
(
"system/memory/inuse"
,
metrics
.
DefaultRegistry
)
pauses
:=
metrics
.
GetOrRegisterMeter
(
"system/memory/pauses"
,
metrics
.
DefaultRegistry
)
stats
:=
make
([]
*
runtime
.
MemStats
,
2
)
stats
:=
make
([]
*
runtime
.
MemStats
,
2
)
for
i
:=
0
;
i
<
len
(
stats
);
i
++
{
for
i
:=
0
;
i
<
len
(
stats
);
i
++
{
...
@@ -301,10 +301,10 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
...
@@ -301,10 +301,10 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
for
i
:=
1
;
;
i
++
{
for
i
:=
1
;
;
i
++
{
runtime
.
ReadMemStats
(
stats
[
i
%
2
])
runtime
.
ReadMemStats
(
stats
[
i
%
2
])
used
.
Mark
(
int64
(
stats
[
i
%
2
]
.
Alloc
-
stats
[(
i
-
1
)
%
2
]
.
Alloc
))
allocs
.
Mark
(
int64
(
stats
[
i
%
2
]
.
Mallocs
-
stats
[(
i
-
1
)
%
2
]
.
Mallocs
))
total
.
Mark
(
int64
(
stats
[
i
%
2
]
.
TotalAlloc
-
stats
[(
i
-
1
)
%
2
]
.
TotalAlloc
))
mallocs
.
Mark
(
int64
(
stats
[
i
%
2
]
.
Mallocs
-
stats
[(
i
-
1
)
%
2
]
.
Mallocs
))
frees
.
Mark
(
int64
(
stats
[
i
%
2
]
.
Frees
-
stats
[(
i
-
1
)
%
2
]
.
Frees
))
frees
.
Mark
(
int64
(
stats
[
i
%
2
]
.
Frees
-
stats
[(
i
-
1
)
%
2
]
.
Frees
))
inuse
.
Mark
(
int64
(
stats
[
i
%
2
]
.
Alloc
-
stats
[(
i
-
1
)
%
2
]
.
Alloc
))
pauses
.
Mark
(
int64
(
stats
[
i
%
2
]
.
PauseTotalNs
-
stats
[(
i
-
1
)
%
2
]
.
PauseTotalNs
))
time
.
Sleep
(
3
*
time
.
Second
)
time
.
Sleep
(
3
*
time
.
Second
)
}
}
...
...
cmd/geth/monitorcmd.go
View file @
e9c0b543
...
@@ -282,7 +282,7 @@ func updateChart(metric string, data []float64, chart *termui.LineChart, err err
...
@@ -282,7 +282,7 @@ func updateChart(metric string, data []float64, chart *termui.LineChart, err err
chart
.
Border
.
Label
=
metric
chart
.
Border
.
Label
=
metric
units
:=
dataUnits
units
:=
dataUnits
if
strings
.
Contains
(
metric
,
"
Percentiles
"
)
{
if
strings
.
Contains
(
metric
,
"
/Percentiles/"
)
||
strings
.
Contains
(
metric
,
"/pauses/
"
)
{
units
=
timeUnits
units
=
timeUnits
}
}
if
len
(
units
[
unit
])
>
0
{
if
len
(
units
[
unit
])
>
0
{
...
...
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