Переименованы некоторые параметры для statsd

This commit is contained in:
ErickSkrauch 2017-03-25 16:36:37 +03:00
parent 445bd18fbc
commit c74151c558
3 changed files with 5 additions and 5 deletions

View File

@ -62,16 +62,16 @@ func (s *SkinItem) Delete() {
func FindSkinByUsername(username string) (SkinItem, error) {
var record SkinItem;
services.Logger.IncCounter("skins.storage.query", 1)
services.Logger.IncCounter("storage.query", 1)
response := services.RedisPool.Cmd("GET", tools.BuildKey(username));
if (response.IsType(redis.Nil)) {
services.Logger.IncCounter("skins.storage.not_found", 1)
services.Logger.IncCounter("storage.not_found", 1)
return record, SkinNotFound{username}
}
result, err := response.Str()
if (err == nil) {
services.Logger.IncCounter("skins.storage.found", 1)
services.Logger.IncCounter("storage.found", 1)
decodeErr := json.Unmarshal([]byte(result), &record)
if (decodeErr != nil) {
log.Println("Cannot decode record data")

View File

@ -27,7 +27,7 @@ func Cape(response http.ResponseWriter, request *http.Request) {
}
func CapeGET(w http.ResponseWriter, r *http.Request) {
services.Logger.IncCounter("capes.get-request", 1)
services.Logger.IncCounter("capes.get_request", 1)
username := r.URL.Query().Get("name")
if username == "" {
w.WriteHeader(http.StatusBadRequest)

View File

@ -26,7 +26,7 @@ func Skin(w http.ResponseWriter, r *http.Request) {
}
func SkinGET(w http.ResponseWriter, r *http.Request) {
services.Logger.IncCounter("skins.get-request", 1)
services.Logger.IncCounter("skins.get_request", 1)
username := r.URL.Query().Get("name")
if username == "" {
w.WriteHeader(http.StatusBadRequest)