From a1ba58398d60e4c266af402c9fb3ffa33cef9b67 Mon Sep 17 00:00:00 2001 From: Alan Bernstein Date: Fri, 21 Apr 2017 15:10:16 -0500 Subject: [PATCH] Improve comments --- handler.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/handler.go b/handler.go index 55ca9199d..542de01c1 100644 --- a/handler.go +++ b/handler.go @@ -43,7 +43,8 @@ type Handler struct { LogOutput io.Writer } -// Endpoints that are intended to be exposed to clients +// externalPrefixFlag denotes endpoints that are intended to be exposed to clients. +// This is used for stats tagging. var externalPrefixFlag = map[string]bool{ "schema": true, "query": true, @@ -113,7 +114,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { h.Router.ServeHTTP(w, r) dif := time.Since(t).Seconds() - // handle some stats tagging + // Handle some stats tagging statsTags := make([]string, 0, 3) if dif > 90 { @@ -128,7 +129,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { statsTags = append(statsTags, "external") } - // internal = useragent:pilosa + // useragent tag identifies internal/external endpoints statsTags = append(statsTags, "useragent:"+r.UserAgent()) stats := h.Index.Stats.WithTags(statsTags...)