From 702c0edd85b4a18674af62a32135b80040781a96 Mon Sep 17 00:00:00 2001 From: Jian Xiao Date: Mon, 25 Nov 2024 17:39:03 +0000 Subject: [PATCH] Pull out the pprof server --- disperser/apiserver/pprof.go => common/pprof/server.go | 2 +- disperser/apiserver/server.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) rename disperser/apiserver/pprof.go => common/pprof/server.go (97%) diff --git a/disperser/apiserver/pprof.go b/common/pprof/server.go similarity index 97% rename from disperser/apiserver/pprof.go rename to common/pprof/server.go index db3847b3d3..70a6ea1bf8 100644 --- a/disperser/apiserver/pprof.go +++ b/common/pprof/server.go @@ -1,4 +1,4 @@ -package apiserver +package pprof import ( "fmt" diff --git a/disperser/apiserver/server.go b/disperser/apiserver/server.go index 6c9be3c54f..831b0e6350 100644 --- a/disperser/apiserver/server.go +++ b/disperser/apiserver/server.go @@ -17,6 +17,7 @@ import ( pb "github.com/Layr-Labs/eigenda/api/grpc/disperser" "github.com/Layr-Labs/eigenda/common" "github.com/Layr-Labs/eigenda/common/healthcheck" + "github.com/Layr-Labs/eigenda/common/pprof" "github.com/Layr-Labs/eigenda/core" "github.com/Layr-Labs/eigenda/core/auth" "github.com/Layr-Labs/eigenda/core/meterer" @@ -819,7 +820,7 @@ func (s *DispersalServer) GetRateConfig() *RateConfig { } func (s *DispersalServer) Start(ctx context.Context) error { - pprofProfiler := NewPprofProfiler(s.serverConfig.PprofHttpPort, s.logger) + pprofProfiler := pprof.NewPprofProfiler(s.serverConfig.PprofHttpPort, s.logger) if s.serverConfig.EnablePprof { go pprofProfiler.Start() s.logger.Info("Enabled pprof for disperser apiserver", "port", s.serverConfig.PprofHttpPort)