[BP-1.20] [FLINK-35657][runtime-web] use parseFloat for metric value #25047
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.
What is the purpose of the change
master branch PR: #24964.
Flink UI always shows float metric value as int/long. For example,
outPoolUsage
/inPoolUsage
are always 0 or 1 at UI. That's not helpful when troubleshooting from UI.After investigation, I found it's because we always parse the metric value via
parseInt
method. We should useparseFloat
for it. TheparseFloat
can achieve what we expect because when the provided string is a integer, it'll also parsed as an integer, not float. Like this:Before this change, the UI is displayed like this:
![image](https://cdn.statically.io/img/private-user-images.githubusercontent.com/43372967/341364294-c8c8ab18-ee31-4b03-9d58-8c6ad2152860.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIwMDc1MDYsIm5iZiI6MTcyMjAwNzIwNiwicGF0aCI6Ii80MzM3Mjk2Ny8zNDEzNjQyOTQtYzhjOGFiMTgtZWUzMS00YjAzLTlkNTgtOGM2YWQyMTUyODYwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI2VDE1MjAwNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdiMDQ1ZGY3MmI4NTA3NWY2YmQ3NjZhNmNjNzQzZDNmYzMwN2FjMjBiZWE5OWVmNzUyOTIxMGY4NjMyMjIzNTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.xD2cTh5HZXjuxTv_UusE_V1RRJK6mGslD_DwYaEDgDQ)
After this change, the UI can display float value like this:
![image](https://cdn.statically.io/img/private-user-images.githubusercontent.com/43372967/341364411-cf6cc91a-28ed-4fba-ae3e-5ad509b7d5e9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIwMDc1MDYsIm5iZiI6MTcyMjAwNzIwNiwicGF0aCI6Ii80MzM3Mjk2Ny8zNDEzNjQ0MTEtY2Y2Y2M5MWEtMjhlZC00ZmJhLWFlM2UtNWFkNTA5YjdkNWU5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI2VDE1MjAwNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRiNjRlNzllMDIyYmM1NjFmY2QwMGFiZGYxNTUyMGQ2OGViYTdjODRkNTA3MGQ4OGIyYTBlYzUzMzUwYmM3ZjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.qIPsq9ag4yVb_d2IlJEVvRjjikAuOi6eKcjMHY13JDM)
Brief change log
Replacing
parseInt
withparseFloat
to parse metric value.Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: noDocumentation