Skip to content

Commit

Permalink
Update to latest metrics package
Browse files Browse the repository at this point in the history
  • Loading branch information
joe94 committed Dec 6, 2017
1 parent 972d1bf commit ee66e96
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 24 deletions.
6 changes: 3 additions & 3 deletions src/glide.lock

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

2 changes: 1 addition & 1 deletion src/glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package: .
homepage: https://github.com/Comcast/tr1d1um
import:
- package: github.com/Comcast/webpa-common
version: 6e6cd5fad81e2ee9b8fae59371465d99c5ca56ca
version: 83d899053e41996424c18cb1559c97b87a5084f6
- package: github.com/go-ozzo/ozzo-validation
version: v3.3
- package: gopkg.in/h2non/gock.v1
Expand Down
8 changes: 0 additions & 8 deletions src/tr1d1um/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ type ConversionHandler struct {

//ConversionHandler handles the different incoming tr1 requests
func (ch *ConversionHandler) ServeHTTP(origin http.ResponseWriter, req *http.Request) {
if requestsReceivedCounter != nil {
requestsReceivedCounter.Add(1)
}

var (
debugLogger = logging.Debug(ch)
errorLogger = logging.Error(ch)
Expand Down Expand Up @@ -142,10 +138,6 @@ func (ch *ConversionHandler) ServeHTTP(origin http.ResponseWriter, req *http.Req

//HandleStat handles the differentiated STAT command
func (ch *ConversionHandler) HandleStat(origin http.ResponseWriter, req *http.Request) {
if requestsReceivedCounter != nil {
requestsReceivedCounter.Add(1)
}

logging.Debug(ch).Log(logging.MessageKey(), "HandleStat called")
var errorLogger = logging.Error(ch)

Expand Down
14 changes: 2 additions & 12 deletions src/tr1d1um/tr1d1um.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ import (
"github.com/Comcast/webpa-common/webhook"
"github.com/SermoDigital/jose/jwt"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/metrics"
"github.com/go-kit/kit/metrics/provider"
"github.com/gorilla/mux"
"github.com/justinas/alice"
"github.com/spf13/pflag"
Expand Down Expand Up @@ -68,9 +66,8 @@ const (
)

var (
release = "-"
hostname = "-"
requestsReceivedCounter metrics.Counter
release = "-"
hostname = "-"
)

func tr1d1um(arguments []string) (exitCode int) {
Expand Down Expand Up @@ -137,13 +134,6 @@ func tr1d1um(arguments []string) (exitCode int) {
signals = make(chan os.Signal, 1)
)

//todo: just example usage for now of new webpa server metrics
//initialize the metrics provider
webPA.GoKitMetricsProvider = provider.NewPrometheusProvider(applicationName, "todo") //todo: what's the approapiate subsystem?

//create a counter
requestsReceivedCounter = webPA.GoKitMetricsProvider.NewCounter("requests_received")

go snsFactory.PrepareAndStart()

if err := concurrent.Await(tr1d1umServer, signals); err != nil {
Expand Down

0 comments on commit ee66e96

Please sign in to comment.