escape meta-characters to fix dashboard #152
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I want to solve #100 and #125 in a proper way rather than directly replacing 'invalid characters'.
By looking at the code, diagram flooding is caused by:
https://github.com/Netflix/Hystrix/blob/master/hystrix-dashboard/src/main/webapp/components/hystrixCommand/hystrixCommand.js#L211
https://github.com/Netflix/Hystrix/blob/master/hystrix-dashboard/src/main/webapp/components/hystrixThreadPool/hystrixThreadPool.js#L170
The selectors do not work as expected due to meta-characters. Although replacing those meta-characters would work to prevent flooding, it will cause further bug since different meta-characters on the same position of two different commands lead to the same command name (e.g. both my:command and my-command will reduce to my_command).
A clean approach is to escape those meta-characters in command name when used in selectors. Another advantage of this way is that original command/thread pool name can be displayed on the web page.
This patch creates escapedName in data object and replaces occurrences of original name in selectors.