mirror of
https://github.com/openziti/zrok.git
synced 2025-03-14 23:48:22 +01:00
cpu profiling for access private tunnel
This commit is contained in:
parent
35dec16236
commit
a055e98ab6
@ -13,6 +13,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
"os"
|
||||
"os/signal"
|
||||
"runtime/pprof"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
@ -39,6 +40,13 @@ func newAccessPrivateTunnelCommand() *accessPrivateTunnelCommand {
|
||||
}
|
||||
|
||||
func (cmd *accessPrivateTunnelCommand) run(_ *cobra.Command, args []string) {
|
||||
// Start CPU profiling
|
||||
f, err := os.Create("cpu.pprof")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
pprof.StartCPUProfile(f)
|
||||
|
||||
zrd, err := zrokdir.Load()
|
||||
if err != nil {
|
||||
tui.Error("unable to load zrokdir", err)
|
||||
@ -94,6 +102,7 @@ func (cmd *accessPrivateTunnelCommand) run(_ *cobra.Command, args []string) {
|
||||
|
||||
func (cmd *accessPrivateTunnelCommand) destroy(frontendName, envZId, shrToken string, zrok *rest_client_zrok.Zrok, auth runtime.ClientAuthInfoWriter) {
|
||||
logrus.Debugf("shutting down '%v'", shrToken)
|
||||
pprof.StopCPUProfile()
|
||||
req := share.NewUnaccessParams()
|
||||
req.Body = &rest_model_zrok.UnaccessRequest{
|
||||
FrontendToken: frontendName,
|
||||
|
Loading…
Reference in New Issue
Block a user