cmd/tailscale: add event bus queue depth debugging
Under extremely high load it appears we may have some retention issues as a result of queue depth build up, but there is currently no direct way to observe this. The scenario does not trigger the slow subscriber log message, and the event stream debugging endpoint produces a saturating volume of information. Updates tailscale/corp#36904 Signed-off-by: James Tucker <james@tailscale.com>
This commit is contained in:
@@ -124,6 +124,12 @@ func debugCmd() *ffcli.Command {
|
||||
return fs
|
||||
})(),
|
||||
},
|
||||
{
|
||||
Name: "daemon-bus-queues",
|
||||
ShortUsage: "tailscale debug daemon-bus-queues",
|
||||
Exec: runDaemonBusQueues,
|
||||
ShortHelp: "Print event bus queue depths per client",
|
||||
},
|
||||
{
|
||||
Name: "metrics",
|
||||
ShortUsage: "tailscale debug metrics",
|
||||
@@ -840,6 +846,15 @@ func runDaemonBusGraph(ctx context.Context, args []string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func runDaemonBusQueues(ctx context.Context, args []string) error {
|
||||
data, err := localClient.EventBusQueues(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Print(string(data))
|
||||
return nil
|
||||
}
|
||||
|
||||
// generateDOTGraph generates the DOT graph format based on the events
|
||||
func generateDOTGraph(topics []eventbus.DebugTopic) string {
|
||||
var sb strings.Builder
|
||||
|
||||
Reference in New Issue
Block a user