[FLINK-35657][runtime-web] use parseFloat for metric value
What is the purpose of the change
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 use parseFloat for it. The parseFloat 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:
After this change, the UI can display float value like this:
Brief change log
Replacing parseInt with parseFloat 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:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with
@Public(Evolving): no - The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
- The S3 file system connector: no
Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
CI report:
- ac77e2ec55b534642b5ddc1cc3b13477af67f540 Azure: SUCCESS
Bot commands
The @flinkbot bot supports the following commands:@flinkbot run azurere-run the last Azure build
@Airblader @hlteoh37, please help take a look when available. Thanks.
@Airblader @hlteoh37, please help take a look when available. Thanks.
Thanks for looking into the @showuon. Do we want to make the same changes here as well?
https://github.com/apache/flink/blob/3606302fd3e73f0da5701983fd8b21e3dd610bef/flink-runtime-web/web-dashboard/src/app/services/job-manager.service.ts#L107 https://github.com/apache/flink/blob/3606302fd3e73f0da5701983fd8b21e3dd610bef/flink-runtime-web/web-dashboard/src/app/services/task-manager.service.ts#L111
Thanks for looking into the @showuon. Do we want to make the same changes here as well?
https://github.com/apache/flink/blob/3606302fd3e73f0da5701983fd8b21e3dd610bef/flink-runtime-web/web-dashboard/src/app/services/job-manager.service.ts#L107
https://github.com/apache/flink/blob/3606302fd3e73f0da5701983fd8b21e3dd610bef/flink-runtime-web/web-dashboard/src/app/services/task-manager.service.ts#L111
Good suggestion! Updated. Thanks.