Skip to content

Commit

Permalink
Enable gin pprof.
Browse files Browse the repository at this point in the history
  • Loading branch information
Colstuwjx committed Sep 13, 2017
1 parent 20a78f3 commit 4fc6d9c
Show file tree
Hide file tree
Showing 12 changed files with 537 additions and 7 deletions.
16 changes: 9 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package main

import (
"github.com/yunlzheng/prometheus-pusher/scrape"
"flag"
"fmt"
"github.com/gin-contrib/pprof"
"github.com/gin-gonic/gin"
"github.com/prometheus/prometheus/config"
"github.com/prometheus/prometheus/retrieval"
"github.com/prometheus/prometheus/storage"
"github.com/prometheus/prometheus/config"
"fmt"
"flag"
"github.com/yunlzheng/prometheus-pusher/scrape"
"strings"
)

Expand Down Expand Up @@ -40,8 +41,8 @@ func main() {

var (
sampleAppender = storage.Fanout{}
targetManager = retrieval.NewTargetManager(sampleAppender)
jobTargets = scrape.NewJobTargets(targetManager)
targetManager = retrieval.NewTargetManager(sampleAppender)
jobTargets = scrape.NewJobTargets(targetManager)
)

fmt.Println("Loading prometheus config file: " + cfg.configFile)
Expand Down Expand Up @@ -76,6 +77,8 @@ func main() {
defer scrapeManager.Stop()

r := gin.Default()
pprof.Register(r, nil) // NOQA

r.GET("/ping", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "pong",
Expand All @@ -87,4 +90,3 @@ func main() {
r.Run()

}

21 changes: 21 additions & 0 deletions vendor/github.com/gin-contrib/pprof/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 83 additions & 0 deletions vendor/github.com/gin-contrib/pprof/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions vendor/github.com/gin-contrib/pprof/pprof.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/github.com/gin-contrib/sse/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions vendor/github.com/gin-contrib/sse/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

116 changes: 116 additions & 0 deletions vendor/github.com/gin-contrib/sse/sse-decoder.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4fc6d9c

Please sign in to comment.