[GitHub] storm issue #2743: [STORM-3130]: Add Wrappers for Timer registration and tim...
Github user zd-project commented on the issue: https://github.com/apache/storm/pull/2743 I didn't make Timed object enforced the idempotent effect of `stopTiming` for now because it's kind of overkill for now. For current implementation the timed object should be discarded soon as timing finished. ---
[GitHub] storm pull request #2772: STORM-3158 improve logging on login failure when k...
GitHub user agresch opened a pull request: https://github.com/apache/storm/pull/2772 STORM-3158 improve logging on login failure when kerberos is misconfi⦠â¦gured You can merge this pull request into a Git repository by running: $ git pull https://github.com/agresch/storm agresch_kerblog Alternatively you can review and apply these changes as the patch at: https://github.com/apache/storm/pull/2772.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 #2772 commit de59923e37911885975fc097d4313fae14ef5f37 Author: Aaron Gresch Date: 2018-07-20T21:02:43Z STORM-3158 improve logging on login failure when kerberos is misconfigured ---
[GitHub] storm issue #2764: [WIP] STORM-3147: Port ClusterSummary as metrics to Storm...
Github user zd-project commented on the issue: https://github.com/apache/storm/pull/2764 Should be changed after #2771 is approved. ---
[GitHub] storm pull request #2763: STORM-3150: Improve Gauge registration methods and...
Github user zd-project commented on a diff in the pull request: https://github.com/apache/storm/pull/2763#discussion_r204137988 --- Diff: storm-server/src/main/java/org/apache/storm/metric/StormMetricsRegistry.java --- @@ -27,52 +28,63 @@ @SuppressWarnings("unchecked") public class StormMetricsRegistry { -public static final MetricRegistry DEFAULT_REGISTRY = new MetricRegistry(); +private static final MetricRegistry DEFAULT_REGISTRY = new MetricRegistry(); private static final Logger LOG = LoggerFactory.getLogger(StormMetricsRegistry.class); -public static Meter registerMeter(String name) { -Meter meter = new Meter(); -return register(name, meter); +public static Meter registerMeter(final String name) { +return register(name, new Meter()); } -// TODO: should replace Callable to Gauge when nimbus.clj is translated to java -public static Gauge registerGauge(final String name, final Callable fn) { -Gauge gauge = new Gauge() { -@Override -public Integer getValue() { -try { -return (Integer) fn.call(); -} catch (Exception e) { -LOG.error("Error getting gauge value for {}", name, e); -} -return 0; +/** + * Register a gauge with provided callback. + * @param name name of the gauge + * @param fn callback that measures + * @param type of measurement the callback returns, also the type of gauge + * @return registered gauge + */ +public static Gauge registerGauge(final String name, final Callable fn) { +return register(name, () -> { +try { +return fn.call(); +} catch (Exception e) { +LOG.error("Error getting gauge value for {}", name, e); } -}; -return register(name, gauge); +return null; +}); } -public static void registerProvidedGauge(final String name, Gauge gauge) { +/** + * Register a provided gauge. Use this method if custom gauges is needed or + * no checked exceptions should be handled. + * @param name name of the gauge + * @param gauge gauge + * @param type of value the gauge measures + */ +public static void registerProvidedGauge(final String name, final Gauge gauge) { register(name, gauge); } public static Histogram registerHistogram(String name, Reservoir reservoir) { -Histogram histogram = new Histogram(reservoir); -return register(name, histogram); +return register(name, new Histogram(reservoir)); +} + +public static void registerAll(final String prefix, MetricSet metrics) { --- End diff -- Improved in #2771 ---
[GitHub] storm pull request #2771: STORM-3157: General improvement to StormMetricsReg...
GitHub user zd-project opened a pull request: https://github.com/apache/storm/pull/2771 STORM-3157: General improvement to StormMetricsRegistry This contains and address the issues in #2763. This should help standardize the process to register metrics and MetricSet in the future. You can merge this pull request into a Git repository by running: $ git pull https://github.com/zd-project/storm STORM-3157 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/storm/pull/2771.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 #2771 commit 802014c88a67ae5ef044c1f87889d976063eee71 Author: Zhengdai Hu Date: 2018-07-12T16:31:00Z STORM-3150: Improve Gauge registration methods and refactored code commit 2cd815011cb0bb37c124d2360c3bcc757d926038 Author: Zhengdai Hu Date: 2018-07-19T15:46:29Z STORM-3150: Refactoring commit ff45063c7ce1516c2d887d64affea636e2f031a1 Author: Zhengdai Hu Date: 2018-07-20T18:41:51Z STORM-3157: Improve StormMetricsRegistry in general ---
[GitHub] storm issue #2743: [STORM-3130]: Add Wrappers for Timer registration and tim...
Github user srdo commented on the issue: https://github.com/apache/storm/pull/2743 As I see it there are still some issues that were commented on but are not resolved. * The TODOs should be removed/fixed * Comment here about adding a comment https://github.com/apache/storm/pull/2743/files#r199600941 * Comment here about making stopTiming idempotent https://github.com/apache/storm/pull/2743/files#r199531108 Other than that, this looks pretty good to me. ---