diff options
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) |
