Robotstxt metrics added.

This commit is contained in:
Musab Gültekin
2019-07-08 14:51:54 +03:00
parent d3c4389c46
commit d19465c44a
5 changed files with 47 additions and 16 deletions

View File

@ -3,6 +3,7 @@ package middleware
import (
"github.com/geziyor/geziyor/client"
"github.com/geziyor/geziyor/metrics"
"strconv"
)
// Metrics sets stats for request and responses
@ -15,5 +16,5 @@ func (a *Metrics) ProcessRequest(r *client.Request) {
}
func (a *Metrics) ProcessResponse(r *client.Response) {
a.Metrics.ResponseCounter.With("method", r.Request.Method).Add(1)
a.Metrics.ResponseCounter.With("status", strconv.Itoa(r.StatusCode)).Add(1)
}