-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use different signal for windows
- Loading branch information
1 parent
67f37c1
commit 62621e1
Showing
5 changed files
with
66 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build !windows | ||
|
||
package profiler | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//go:build !windows | ||
|
||
// Package profiler implements functions to start a handler | ||
package profiler | ||
|
||
import ( | ||
"syscall" | ||
) | ||
|
||
// New returns a new profiler | ||
// Defaults: | ||
// - Signal : syscall.SIGUSR1 | ||
// - Address: ":6666" | ||
// - Timeout: 30m | ||
func New(options ...Option) *Profiler { | ||
p := Profiler{ | ||
signal: syscall.SIGUSR1, | ||
address: defaultListen, | ||
timeout: defaultTimeout, | ||
|
||
evt: DefaultEventHandler(), | ||
} | ||
|
||
for _, option := range options { | ||
option(&p) | ||
} | ||
|
||
return &p | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Package profiler implements functions to start a handler | ||
package profiler | ||
|
||
import ( | ||
"syscall" | ||
) | ||
|
||
// New returns a new profiler | ||
// Defaults: | ||
// - Signal : syscall.SIGHUB | ||
// - Address: ":6666" | ||
// - Timeout: 30m | ||
func New(options ...Option) *Profiler { | ||
p := Profiler{ | ||
signal: syscall.SIGHUP, | ||
address: defaultListen, | ||
timeout: defaultTimeout, | ||
|
||
evt: DefaultEventHandler(), | ||
} | ||
|
||
for _, option := range options { | ||
option(&p) | ||
} | ||
|
||
return &p | ||
} |