Commit Graph

16 Commits

Author SHA1 Message Date
Pawel Chojnacki 1ac96603e1 Let mutex be initialized only once 2018-01-29 15:13:05 +01:00
Pawel Chojnacki 7d716cc849 Convert InfluxDB to concern. Fix uninitialized metrics when metrics code is inherited. 2018-01-29 15:13:04 +01:00
Pawel Chojnacki ea6196d490 Move prometheus metrics to module. Use class instance variables for metrics and metrics cache in metrics concern 2018-01-29 15:13:04 +01:00
Pawel Chojnacki 27359dbf22 use class variable for Mutex instead of Const 2018-01-29 15:13:04 +01:00
Pawel Chojnacki 83ae172145 Cleanup rspec 2018-01-29 15:13:04 +01:00
Pawel Chojnacki f5383578d9 NullMetric as a singleton 2018-01-29 15:13:04 +01:00
Pawel Chojnacki 3e898be8aa Avoid cascading locking 2018-01-29 15:13:04 +01:00
Pawel Chojnacki e3fe65543b Add Tests for Metrics::Concern 2018-01-29 15:13:04 +01:00
Pawel Chojnacki d7edc4b46b Use Global Mutex, and class instance variables using
```
          metric = @_metrics_provider_cache&.[](name)
          return metric if metric
``
acccessor that only slightly slower (<20ns) than direct class variable access
2018-01-29 15:13:03 +01:00
Pawel Chojnacki 087c9a5e8f Fix rubocop warnings 2018-01-29 15:13:03 +01:00
Pawel Chojnacki 66c2a3a83e Fix helper methods and document metric builder options 2018-01-29 15:13:03 +01:00
Pawel Chojnacki 66c1acba0b Fix code after refactoring 2018-01-29 15:13:03 +01:00
Pawel Chojnacki 53f818fdac Refactor method concern to use hashes 2018-01-29 15:13:03 +01:00
Pawel Chojnacki d97548daa8 cleanup method call 2018-01-29 15:13:03 +01:00
Pawel Chojnacki e5d6141541 Actually make the new methods work 2018-01-29 15:13:03 +01:00
Pawel Chojnacki ef44fef15f Initiaal implementation of metrics concern 2018-01-29 15:13:03 +01:00