Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
dff606a3
Commit
dff606a3
authored
9 years ago
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
write memory profiles every 30 seconds when enabled
parent
fcb559eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
cmd/ipfs/main.go
cmd/ipfs/main.go
+8
-5
No files found.
cmd/ipfs/main.go
View file @
dff606a3
...
...
@@ -447,14 +447,18 @@ func startProfiling() (func(), error) {
return
nil
,
err
}
pprof
.
StartCPUProfile
(
ofi
)
go
func
()
{
for
_
=
range
time
.
NewTicker
(
time
.
Second
*
30
)
.
C
{
err
:=
writeHeapProfileToFile
()
if
err
!=
nil
{
log
.
Critical
(
err
)
}
}
}()
stopProfiling
:=
func
()
{
pprof
.
StopCPUProfile
()
defer
ofi
.
Close
()
// captured by the closure
err
:=
writeHeapProfileToFile
()
if
err
!=
nil
{
log
.
Critical
(
err
)
}
}
return
stopProfiling
,
nil
}
...
...
@@ -487,7 +491,6 @@ func (ih *IntrHandler) Close() error {
return
nil
}
// Handle starts handling the given signals, and will call the handler
// callback function each time a signal is catched. The function is passed
// the number of times the handler has been triggered in total, as
...
...
This diff is collapsed.
Click to expand it.
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