tsweb: cache prometheus metric names & types

Signed-off-by: Anton Tolchanov <anton@tailscale.com>
This commit is contained in:
Anton Tolchanov
2022-11-17 11:33:19 -08:00
committed by Anton Tolchanov
parent 3c27632ffe
commit f40bb199f5
2 changed files with 34 additions and 11 deletions

View File

@ -450,15 +450,15 @@ func TestVarzHandler(t *testing.T) {
},
{
"func_float64_gauge",
"gauge_x",
"gauge_y",
expvar.Func(func() any { return float64(1.2) }),
"# TYPE x gauge\nx 1.2\n",
"# TYPE y gauge\ny 1.2\n",
},
{
"func_float64_untyped",
"x",
"z",
expvar.Func(func() any { return float64(1.2) }),
"x 1.2\n",
"z 1.2\n",
},
{
"metrics_label_map",