Merge pull request #277 from mrd0ll4r/http-prometheus-fix
http: fix prometheus timings
This commit is contained in:
commit
a50be904e4
1 changed files with 2 additions and 2 deletions
|
@ -133,7 +133,7 @@ func (t *Frontend) ListenAndServe() error {
|
||||||
func (t *Frontend) announceRoute(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
|
func (t *Frontend) announceRoute(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
|
||||||
var err error
|
var err error
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
defer recordResponseDuration("announce", err, time.Since(start))
|
defer func() { recordResponseDuration("announce", err, time.Since(start)) }()
|
||||||
|
|
||||||
req, err := ParseAnnounce(r, t.RealIPHeader, t.AllowIPSpoofing)
|
req, err := ParseAnnounce(r, t.RealIPHeader, t.AllowIPSpoofing)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -160,7 +160,7 @@ func (t *Frontend) announceRoute(w http.ResponseWriter, r *http.Request, _ httpr
|
||||||
func (t *Frontend) scrapeRoute(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
|
func (t *Frontend) scrapeRoute(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
|
||||||
var err error
|
var err error
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
defer recordResponseDuration("scrape", err, time.Since(start))
|
defer func() { recordResponseDuration("scrape", err, time.Since(start)) }()
|
||||||
|
|
||||||
req, err := ParseScrape(r)
|
req, err := ParseScrape(r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue