Skip to content

Commit

Permalink
Fix wrong metrics counter
Browse files Browse the repository at this point in the history
  • Loading branch information
donnpebe committed Jun 30, 2015
1 parent a38a06a commit df33cbc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/api/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ func ApiError(status int, message string, err error) *NormalResponse {

switch status {
case 404:
metrics.M_Api_Status_404.Inc(1)
resp["message"] = "Not Found"
metrics.M_Api_Status_500.Inc(1)
case 500:
metrics.M_Api_Status_404.Inc(1)
metrics.M_Api_Status_500.Inc(1)
resp["message"] = "Internal Server Error"
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/middleware/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ func (ctx *Context) JsonApiErr(status int, message string, err error) {

switch status {
case 404:
metrics.M_Api_Status_404.Inc(1)
resp["message"] = "Not Found"
metrics.M_Api_Status_500.Inc(1)
case 500:
metrics.M_Api_Status_404.Inc(1)
metrics.M_Api_Status_500.Inc(1)
resp["message"] = "Internal Server Error"
}

Expand Down

0 comments on commit df33cbc

Please sign in to comment.