From 678de5bc63affaeaca5ed7f635f683aef1d2a6d3 Mon Sep 17 00:00:00 2001 From: divyam234 <47589864+divyam234@users.noreply.github.com> Date: Sun, 7 Jul 2024 12:53:28 +0530 Subject: [PATCH] chore: Remove statsviz monitoring --- cmd/run.go | 15 --------------- go.mod | 1 - go.sum | 2 -- internal/config/config.go | 1 - 4 files changed, 19 deletions(-) diff --git a/cmd/run.go b/cmd/run.go index 3fbfcc5..6239505 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -11,7 +11,6 @@ import ( "time" "unicode" - "github.com/arl/statsviz" "github.com/divyam234/teldrive/api" "github.com/divyam234/teldrive/internal/config" "github.com/divyam234/teldrive/internal/database" @@ -55,7 +54,6 @@ func NewRun() *cobra.Command { runCmd.Flags().IntVarP(&config.Server.Port, "server-port", "p", 8080, "Server port") duration.DurationVar(runCmd.Flags(), &config.Server.GracefulShutdown, "server-graceful-shutdown", 15*time.Second, "Server graceful shutdown timeout") runCmd.Flags().BoolVar(&config.Server.EnablePprof, "server-enable-pprof", false, "Enable Pprof Profiling") - runCmd.Flags().BoolVar(&config.Server.EnableStatsviz, "server-enable-statsviz", false, "Enable Statsviz Monitoring") runCmd.Flags().BoolVar(&config.CronJobs.Enable, "cronjobs-enable", true, "Run cron jobs") @@ -232,19 +230,6 @@ func initApp(lc fx.Lifecycle, cfg *config.Config, c *controller.Controller) *gin pprof.Register(r) } - if cfg.Server.EnableStatsviz { - srv, _ := statsviz.NewServer() - ws := srv.Ws() - index := srv.Index() - r.GET("/debug/statsviz/*filepath", func(context *gin.Context) { - if context.Param("filepath") == "/ws" { - ws(context.Writer, context.Request) - return - } - index(context.Writer, context.Request) - }) - } - r.Use(gin.Recovery()) r.Use(ginzap.GinzapWithConfig(logging.DefaultLogger().Desugar(), &ginzap.Config{ diff --git a/go.mod b/go.mod index 30b32ff..a221aef 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,6 @@ require ( require ( filippo.io/edwards25519 v1.1.0 // indirect - github.com/arl/statsviz v0.6.0 // indirect github.com/bytedance/sonic/loader v0.1.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudwego/base64x v0.1.4 // indirect diff --git a/go.sum b/go.sum index 5d6208a..f9f8d41 100644 --- a/go.sum +++ b/go.sum @@ -4,8 +4,6 @@ github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7Oputl github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= github.com/WinterYukky/gorm-extra-clause-plugin v0.2.1 h1:G0e4eFRrh3WdM1I3EKKidV2yF5J09uRIJlKYxt6zNR4= github.com/WinterYukky/gorm-extra-clause-plugin v0.2.1/go.mod h1:qAN5KRJJTCM49X2wUHZAVB3rfvO8A8L0ISd/uB1WM5s= -github.com/arl/statsviz v0.6.0 h1:jbW1QJkEYQkufd//4NDYRSNBpwJNrdzPahF7ZmoGdyE= -github.com/arl/statsviz v0.6.0/go.mod h1:0toboo+YGSUXDaS4g1D5TVS4dXs7S7YYT5J/qnW2h8s= github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0= github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= diff --git a/internal/config/config.go b/internal/config/config.go index 012ee9c..d008fe4 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -17,7 +17,6 @@ type ServerConfig struct { Port int GracefulShutdown time.Duration EnablePprof bool - EnableStatsviz bool } type CronJobConfig struct {