| Index: appengine/tsmon/middleware.go
|
| diff --git a/appengine/tsmon/middleware.go b/appengine/tsmon/middleware.go
|
| index 5014b81405ede68ee3d3871daf5ac36050a29b28..5957d6ba1fea77557d7c87303eb2aee53d1b4ec3 100644
|
| --- a/appengine/tsmon/middleware.go
|
| +++ b/appengine/tsmon/middleware.go
|
| @@ -10,13 +10,11 @@ package tsmon
|
|
|
| import (
|
| "fmt"
|
| - "net/http"
|
| "strings"
|
| "sync"
|
| "time"
|
|
|
| "github.com/golang/protobuf/proto"
|
| - "github.com/julienschmidt/httprouter"
|
| "golang.org/x/net/context"
|
|
|
| "github.com/luci/gae/service/info"
|
| @@ -28,7 +26,7 @@ import (
|
| "github.com/luci/luci-go/common/tsmon/monitor"
|
| "github.com/luci/luci-go/common/tsmon/store"
|
| "github.com/luci/luci-go/common/tsmon/target"
|
| - "github.com/luci/luci-go/server/middleware"
|
| + "github.com/luci/luci-go/server/router"
|
| )
|
|
|
| // State holds the configuration of the tsmon library for GAE.
|
| @@ -61,12 +59,12 @@ type State struct {
|
|
|
| // Middleware returns a middleware that must be inserted into the chain to
|
| // enable tsmon metrics to be sent on App Engine.
|
| -func (s *State) Middleware(h middleware.Handler) middleware.Handler {
|
| - return func(c context.Context, rw http.ResponseWriter, r *http.Request, p httprouter.Params) {
|
| - state, settings := s.checkSettings(c)
|
| - h(c, rw, r, p)
|
| +func (s *State) Middleware() router.Handler {
|
| + return func(c *router.Context) {
|
| + state, settings := s.checkSettings(c.Context)
|
| + c.Next()
|
| if settings.Enabled {
|
| - s.flushIfNeeded(c, state, settings)
|
| + s.flushIfNeeded(c.Context, state, settings)
|
| }
|
| }
|
| }
|
|
|