diff --git a/nsqadmin/graphs.go b/nsqadmin/graphs.go index 024be0f44..18da0bfce 100644 --- a/nsqadmin/graphs.go +++ b/nsqadmin/graphs.go @@ -210,37 +210,6 @@ func (g *GraphOptions) Sparkline(gr GraphTarget, key string) template.URL { return template.URL(fmt.Sprintf("%s/render?%s", g.GraphiteUrl, params.Encode())) } -func (g *GraphOptions) PercentileSparkline(gr GraphTarget, percentiles util.E2eProcessingLatencyAggregate) template.URL { - key := fmt.Sprintf("e2e_processing_latency_%.0f", percentiles.Percentiles[0]["quantile"]*100) - return g.Sparkline(gr, key) -} - -func (g *GraphOptions) PercentileGraph(gr GraphTarget, percentiles util.E2eProcessingLatencyAggregate, height, width int) template.URL { - params := url.Values{} - params.Set("title", "end to end message processing latencies (milliseconds)") - params.Set("height", fmt.Sprintf("%d", height)) - params.Set("width", fmt.Sprintf("%d", width)) - params.Set("bgcolor", "ff000000") // transparent - params.Set("fgcolor", "999999") - params.Set("yMin", "0") - params.Set("lineMode", "connected") - params.Set("drawNullAsZero", "false") - interval := fmt.Sprintf("%dsec", *statsdInterval/time.Second) - - var target string - for _, item := range percentiles.Percentiles { - quantile := item["quantile"] * 100.0 - target, _ = gr.Target(fmt.Sprintf("e2e_processing_latency_%.0f", quantile)) - target = fmt.Sprintf(target, g.Prefix(gr.Host(), metricType("e2e_processing_latency"))) - target = fmt.Sprintf(`alias(summarize(scale(%s,0.000001),"%s","avg"), "%0.1f%%")`, target, interval, quantile) - params.Add("target", target) - } - - params.Set("from", g.GraphInterval.GraphFrom) - params.Set("until", g.GraphInterval.GraphUntil) - return template.URL(fmt.Sprintf("%s/render?%s", g.GraphiteUrl, params.Encode())) -} - func (g *GraphOptions) LargeGraph(gr GraphTarget, key string) template.URL { target, color := gr.Target(key) target = fmt.Sprintf(target, g.Prefix(gr.Host(), metricType(key))) @@ -251,6 +220,8 @@ func (g *GraphOptions) LargeGraph(gr GraphTarget, key string) template.URL { params.Set("fgcolor", "999999") params.Set("colorList", color) params.Set("yMin", "0") + params.Set("lineMode", "connected") + params.Set("drawNullAsZero", "false") interval := fmt.Sprintf("%dsec", *statsdInterval/time.Second) target = fmt.Sprintf(`summarize(%s,"%s","avg")`, target, interval) if metricType(key) == "counter" { diff --git a/nsqadmin/http.go b/nsqadmin/http.go index f0b36bb58..4e537ab63 100644 --- a/nsqadmin/http.go +++ b/nsqadmin/http.go @@ -26,6 +26,7 @@ func loadTemplates() { "commafy": util.Commafy, "nanotohuman": util.NanoSecondToHuman, "floatToPercent": util.FloatToPercent, + "percSuffix": util.PercSuffix, "getNodeConsistencyClass": getNodeConsistencyClass, }) templates, err = t.ParseGlob(fmt.Sprintf("%s/*.html", *templateDir)) diff --git a/nsqadmin/templates/channel.html b/nsqadmin/templates/channel.html index 5efd1438a..8b9e0ffe1 100644 --- a/nsqadmin/templates/channel.html +++ b/nsqadmin/templates/channel.html @@ -1,5 +1,6 @@ {{template "header.html" .}} {{$g := .GraphOptions}} +{{$firstHost := index .ChannelStats.HostStats 0}}