Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] legendValue panics on invalid "value types" #64

Closed
npazosmendez opened this issue Aug 9, 2022 · 3 comments
Closed

[BUG] legendValue panics on invalid "value types" #64

npazosmendez opened this issue Aug 9, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@npazosmendez
Copy link

This is legendValue's definition:

 legendValue(seriesList, *valueTypes)

This test for legendValue panics:

		{
			"legendValue(metric1,\"foo\")",
			map[parser.MetricRequest][]*types.MetricData{
				{"metric1", 0, 1}: {types.MakeMetricData("metric1", []float64{1, 2, 3, 4, 5}, 1, now32)},
			},
			[]*types.MetricData{types.MakeMetricData("metric1 (avg: 3)",
				[]float64{1, 2, 3, 4, 5}, 1, now32).SetNameTag("metric1")},
		},

because foo is not any of last, avg, total, min, max. It should return a nice error instead of panicking.

@npazosmendez npazosmendez added the bug Something isn't working label Aug 9, 2022
@npazosmendez
Copy link
Author

@carrieedwards was this fixed? I can't find any PR that addressed this

@carrieedwards
Copy link
Collaborator

Ah, my apologies, I thought this was referring to a different issue that had been fixed. I'll re-open

@carrieedwards carrieedwards reopened this Aug 30, 2022
@npazosmendez
Copy link
Author

This was fixed here #102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants