-
-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into debug-bundle-with-networkmap
- Loading branch information
Showing
26 changed files
with
1,089 additions
and
142 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
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,33 @@ | ||
//go:build pprof | ||
// +build pprof | ||
|
||
package cmd | ||
|
||
import ( | ||
"net/http" | ||
_ "net/http/pprof" | ||
"os" | ||
|
||
log "github.com/sirupsen/logrus" | ||
) | ||
|
||
func init() { | ||
addr := pprofAddr() | ||
go pprof(addr) | ||
} | ||
|
||
func pprofAddr() string { | ||
listenAddr := os.Getenv("NB_PPROF_ADDR") | ||
if listenAddr == "" { | ||
return "localhost:6969" | ||
} | ||
|
||
return listenAddr | ||
} | ||
|
||
func pprof(listenAddr string) { | ||
log.Infof("listening pprof on: %s\n", listenAddr) | ||
if err := http.ListenAndServe(listenAddr, nil); err != nil { | ||
log.Fatalf("Failed to start pprof: %v", err) | ||
} | ||
} |
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
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
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
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
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,19 @@ | ||
package routemanager | ||
|
||
import ( | ||
"github.com/netbirdio/netbird/client/internal/routeselector" | ||
) | ||
|
||
type SelectorState routeselector.RouteSelector | ||
|
||
func (s *SelectorState) Name() string { | ||
return "routeselector_state" | ||
} | ||
|
||
func (s *SelectorState) MarshalJSON() ([]byte, error) { | ||
return (*routeselector.RouteSelector)(s).MarshalJSON() | ||
} | ||
|
||
func (s *SelectorState) UnmarshalJSON(data []byte) error { | ||
return (*routeselector.RouteSelector)(s).UnmarshalJSON(data) | ||
} |
Oops, something went wrong.