mirror of
https://github.com/tgdrive/teldrive.git
synced 2025-01-08 08:10:05 +08:00
chore: Remove statsviz monitoring
This commit is contained in:
parent
bddd2d93d8
commit
678de5bc63
4 changed files with 0 additions and 19 deletions
15
cmd/run.go
15
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{
|
||||
|
|
1
go.mod
1
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
|
||||
|
|
2
go.sum
2
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=
|
||||
|
|
|
@ -17,7 +17,6 @@ type ServerConfig struct {
|
|||
Port int
|
||||
GracefulShutdown time.Duration
|
||||
EnablePprof bool
|
||||
EnableStatsviz bool
|
||||
}
|
||||
|
||||
type CronJobConfig struct {
|
||||
|
|
Loading…
Reference in a new issue