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

Custom chart with option nonzero and data-dimensions set #1514

Closed
t-h-e opened this issue Jan 5, 2017 · 7 comments · Fixed by #1528 or #1660
Closed

Custom chart with option nonzero and data-dimensions set #1514

t-h-e opened this issue Jan 5, 2017 · 7 comments · Fixed by #1528 or #1660
Labels

Comments

@t-h-e
Copy link
Contributor

t-h-e commented Jan 5, 2017

The option nonzero or "NETDATA.options.current.eliminate_zero_dimensions = true;" should remove dimensions that contain only zeros, which works fine if no dimensions are specified.

If data-dimensions is set, then this flag is ignored. https://github.com/firehol/netdata/blob/master/src/rrd2json.c#L630-L636

Doesn't that seem counter-intuitive? If the user wants to show only certain dimensions, but automatically remove nonzero dimensions, that is not possible. But this could actually be done by adding or removing the nonzero flag.

@ktsaou
Copy link
Member

ktsaou commented Jan 5, 2017

You are right.
I'll remove that code to allow it work in that case too.

@ktsaou
Copy link
Member

ktsaou commented Jan 8, 2017

done!
thanks!

@t-h-e
Copy link
Contributor Author

t-h-e commented Jan 26, 2017

Sorry for not checking this earlier, but this change on its own, hasn't done the trick for me. The method rrdr_disable_not_selected_dimensions sets all dimensions that are specified by the user to RRDR_NONZERO, regardless of the option nonzero.

The following change fixes that: t-h-e@cf14df5

PS: It seems kind of confusing that in the REST api the option nonzero removes dimensions that are all zeros and internally RRDR_NONZERO marks dimensions with values other than zero. Maybe renaming the nonzero option to eliminate_zero_dimensions like in the javascript case would be more expressive.

@ktsaou
Copy link
Member

ktsaou commented Jan 26, 2017

ok. I don't see any issues.
Can you make a PR?

@t-h-e
Copy link
Contributor Author

t-h-e commented Jan 26, 2017

PR #1658

@ktsaou
Copy link
Member

ktsaou commented Jan 27, 2017

well, I found an issue.

if all dimensions are zero and the nonzero option is set, then the charts are shown as empty.

If am adding code, to detect this, and enable all the zero dimensions if none is nonzero (the way it should work).

@t-h-e
Copy link
Contributor Author

t-h-e commented Jan 27, 2017

You are right. I never had that case. Thanks.

ktsaou added a commit to ktsaou/netdata that referenced this issue Jan 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants