diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-04-19 03:03:40 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-04-19 03:03:40 -0700 |
| commit | 71ffb98475d05c7e76e8c46a9525f29ef97f6228 (patch) | |
| tree | 133b4b4d5bbe685ac33334ec2e6ef759a619b71a /weed/command/msg_broker.go | |
| parent | d278b4c228905694a24cca2c9d08d8b8faa905bb (diff) | |
| download | seaweedfs-71ffb98475d05c7e76e8c46a9525f29ef97f6228.tar.xz seaweedfs-71ffb98475d05c7e76e8c46a9525f29ef97f6228.zip | |
broker: add profiling
Diffstat (limited to 'weed/command/msg_broker.go')
| -rw-r--r-- | weed/command/msg_broker.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/weed/command/msg_broker.go b/weed/command/msg_broker.go index 67ebdfb6d..d4d3865fa 100644 --- a/weed/command/msg_broker.go +++ b/weed/command/msg_broker.go @@ -22,14 +22,18 @@ var ( ) type QueueOptions struct { - filer *string - port *int + filer *string + port *int + cpuprofile *string + memprofile *string } func init() { cmdMsgBroker.Run = runMsgBroker // break init cycle messageBrokerStandaloneOptions.filer = cmdMsgBroker.Flag.String("filer", "localhost:8888", "filer server address") messageBrokerStandaloneOptions.port = cmdMsgBroker.Flag.Int("port", 17777, "queue server gRPC listen port") + messageBrokerStandaloneOptions.cpuprofile = cmdMsgBroker.Flag.String("cpuprofile", "", "cpu profile output file") + messageBrokerStandaloneOptions.memprofile = cmdMsgBroker.Flag.String("memprofile", "", "memory profile output file") } var cmdMsgBroker = &Command{ @@ -53,6 +57,8 @@ func runMsgBroker(cmd *Command, args []string) bool { func (msgBrokerOpt *QueueOptions) startQueueServer() bool { + util.SetupProfiling(*messageBrokerStandaloneOptions.cpuprofile, *messageBrokerStandaloneOptions.memprofile) + filerGrpcAddress, err := pb.ParseFilerGrpcAddress(*msgBrokerOpt.filer) if err != nil { glog.Fatal(err) |
