GitHub user zentol opened a pull request:
https://github.com/apache/flink/pull/2445
[FLINK-4544] Refactor old CPU metric initialization
This PR refactors the old CPU metric initialization code to no longer rely
on reflection.
Instead it eagerly casts the `OperatingSystemMXBean` returned by
`ManagementFactory#getOperationSystemMXBean()` to
`com.sun.management.OperatingSystemMXBean`. Should this succeed it is now
guaranteed that the gauge will not throw a `ClassCastException` since it
doesn't have to cast anything; if it fails a dummy Gauge is registered that
returns -1 in order to retain existing behavior.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zentol/flink 4544_tm_cpu
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/2445.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2445
----
commit 51ff47711cde8d32d8d0b6d2abf3bd264d207342
Author: zentol <[email protected]>
Date: 2016-08-31T15:46:10Z
[FLINK-4544] Refactor old CPU metric initialization
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---