Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
14b84ce0
Commit
14b84ce0
authored
Apr 29, 2016
by
Miek Gieben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pprof does not need to inject middleware
parent
9e9d7265
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
18 deletions
+3
-18
core/setup/pprof.go
core/setup/pprof.go
+1
-5
middleware/pprof/pprof.go
middleware/pprof/pprof.go
+2
-13
No files found.
core/setup/pprof.go
View file @
14b84ce0
...
...
@@ -29,9 +29,5 @@ func PProf(c *Controller) (middleware.Middleware, error) {
c
.
Startup
=
append
(
c
.
Startup
,
handler
.
Start
)
c
.
Shutdown
=
append
(
c
.
Shutdown
,
handler
.
Shutdown
)
})
return
func
(
next
middleware
.
Handler
)
middleware
.
Handler
{
handler
.
Next
=
next
return
handler
},
nil
return
nil
,
nil
}
middleware/pprof/pprof.go
View file @
14b84ce0
...
...
@@ -5,22 +5,11 @@ import (
"net"
"net/http"
pp
"net/http/pprof"
"github.com/miekg/coredns/middleware"
"github.com/miekg/dns"
"golang.org/x/net/context"
)
type
Handler
struct
{
Next
middleware
.
Handler
ln
net
.
Listener
mux
*
http
.
ServeMux
}
// ServeDNS passes all other requests up the chain.
func
(
h
*
Handler
)
ServeDNS
(
ctx
context
.
Context
,
w
dns
.
ResponseWriter
,
r
*
dns
.
Msg
)
(
int
,
error
)
{
return
h
.
Next
.
ServeDNS
(
ctx
,
w
,
r
)
ln
net
.
Listener
mux
*
http
.
ServeMux
}
func
(
h
*
Handler
)
Start
()
error
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment