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
bea56d84
Commit
bea56d84
authored
Feb 20, 2016
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal/debug: add memStats and gcStats to API
parent
bcd8aeef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
api.go
internal/debug/api.go
+15
-0
javascript.go
rpc/javascript.go
+10
-0
No files found.
internal/debug/api.go
View file @
bea56d84
...
...
@@ -27,6 +27,7 @@ import (
"os/user"
"path/filepath"
"runtime"
"runtime/debug"
"runtime/pprof"
"strings"
"sync"
...
...
@@ -69,6 +70,20 @@ func (*HandlerT) BacktraceAt(location string) error {
return
glog
.
GetTraceLocation
()
.
Set
(
location
)
}
// MemStats returns detailed runtime memory statistics.
func
(
*
HandlerT
)
MemStats
()
*
runtime
.
MemStats
{
s
:=
new
(
runtime
.
MemStats
)
runtime
.
ReadMemStats
(
s
)
return
s
}
// GcStats returns GC statistics.
func
(
*
HandlerT
)
GcStats
()
*
debug
.
GCStats
{
s
:=
new
(
debug
.
GCStats
)
debug
.
ReadGCStats
(
s
)
return
s
}
// CpuProfile turns on CPU profiling for nsec seconds and writes
// profile data to file.
func
(
h
*
HandlerT
)
CpuProfile
(
file
string
,
nsec
uint
)
error
{
...
...
rpc/javascript.go
View file @
bea56d84
...
...
@@ -327,6 +327,16 @@ web3._extend({
params: 0,
outputFormatter: console.log
}),
new web3._extend.Method({
name: 'memStats',
call: 'debug_memStats',
params: 0,
}),
new web3._extend.Method({
name: 'gcStats',
call: 'debug_gcStats',
params: 0,
}),
new web3._extend.Method({
name: 'cpuProfile',
call: 'debug_cpuProfile',
...
...
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