Skip to content

Commit

Permalink
test: pprof
Browse files Browse the repository at this point in the history
  • Loading branch information
withchao committed Jul 28, 2023
1 parent f74c8b9 commit db69115
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/api/admin_api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
mw2 "github.com/OpenIMSDK/chat/pkg/common/mw"
"math/rand"
"net"
"net/http"
"strconv"
"time"

Expand All @@ -31,9 +32,13 @@ import (
"google.golang.org/grpc/credentials/insecure"

"github.com/gin-gonic/gin"
_ "net/http/pprof"
)

func main() {
go func() {
_ = http.ListenAndServe(":6061", nil)
}()
rand.Seed(time.Now().UnixNano())
if err := config.InitConfig(); err != nil {
panic(err)
Expand Down
5 changes: 5 additions & 0 deletions cmd/api/chat_api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
mw2 "github.com/OpenIMSDK/chat/pkg/common/mw"
"math/rand"
"net"
"net/http"
"strconv"
"time"

Expand All @@ -31,9 +32,13 @@ import (
"google.golang.org/grpc/credentials/insecure"

"github.com/gin-gonic/gin"
_ "net/http/pprof"
)

func main() {
go func() {
_ = http.ListenAndServe(":6062", nil)
}()
rand.Seed(time.Now().UnixNano())
err := config.InitConfig()
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions cmd/rpc/admin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@ package main
import (
"github.com/OpenIMSDK/chat/pkg/common/chatrpcstart"
"github.com/OpenIMSDK/tools/log"
"net/http"

"github.com/OpenIMSDK/chat/internal/rpc/admin"
"github.com/OpenIMSDK/chat/pkg/common/config"
_ "net/http/pprof"
)

func main() {
go func() {
_ = http.ListenAndServe(":6063", nil)
}()
if err := config.InitConfig(); err != nil {
panic(err)
}
Expand Down
5 changes: 5 additions & 0 deletions cmd/rpc/chat/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@ package main
import (
"github.com/OpenIMSDK/chat/pkg/common/chatrpcstart"
"github.com/OpenIMSDK/tools/log"
"net/http"

"github.com/OpenIMSDK/chat/internal/rpc/chat"
"github.com/OpenIMSDK/chat/pkg/common/config"
_ "net/http/pprof"
)

func main() {
go func() {
_ = http.ListenAndServe(":6064", nil)
}()
if err := config.InitConfig(); err != nil {
panic(err)
}
Expand Down

0 comments on commit db69115

Please sign in to comment.