Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CMD = &cobra.Command{ Use: "benchmark", Short: "Run benchmarks of ssv node", Run: func(cobraCMD *cobra.Command, args []string) { var ( ctx context.Context cancel context.CancelFunc ) if configs.Values.Benchmark.Duration == 0 { ctx, cancel = context.WithCancel(context.Background()) } else { ctx, cancel = context.WithTimeout(context.Background(), configs.Values.Benchmark.Duration) } isValid, err := configs.Values.Benchmark.Validate() if !isValid { panic(err.Error()) } metrics, err := LoadEnabledMetrics(configs.Values) if err != nil { panic(err.Error()) } benchmarkService := New(metrics, report.New()) go benchmarkService.Start(ctx) slog.With("port", configs.Values.Benchmark.Server.Port).Info("running web host") host := host.New(configs.Values.Benchmark.Server.Port, route. NewRouter(). WithMetrics(). Router()) host.Run() lifecycle.ListenForApplicationShutDown(ctx, func() { cancel() slog.Warn("terminating the application") }, make(chan os.Signal)) }, }
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.