flink icon indicating copy to clipboard operation
flink copied to clipboard

[FLINK-35657][runtime-web] use parseFloat for metric value

Open showuon opened this issue 1 year ago • 2 comments

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:

image

Before this change, the UI is displayed like this: image

After this change, the UI can display float value like this: image

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

showuon avatar Jun 20 '24 09:06 showuon

CI report:

  • ac77e2ec55b534642b5ddc1cc3b13477af67f540 Azure: SUCCESS
Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

flinkbot avatar Jun 20 '24 09:06 flinkbot

@Airblader @hlteoh37, please help take a look when available. Thanks.

showuon avatar Jun 20 '24 09:06 showuon

@Airblader @hlteoh37, please help take a look when available. Thanks.

showuon avatar Jul 05 '24 07:07 showuon

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

hlteoh37 avatar Jul 05 '24 13:07 hlteoh37

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.

showuon avatar Jul 06 '24 07:07 showuon