Github user zd-project commented on the issue:

    https://github.com/apache/storm/pull/2714
  
    Another implementation would be to require all metrics to be registered 
when at least one instance of a class has been instantiated. This will 
disqualify the final property of all metrics variables but we can encapsulate 
all the assignment to a static method and invoked at appropriate time.
    
    For example,
    
    ```
    class Scratch {
        private static Integer x = null;
    
        public Scratch() {
            if (Scratch.x == null) {
                x = 7;
            }
        }
    }
    ```


---

Reply via email to