samstarling / finagle-prometheus

Provides a bridge between Finagle and Prometheus metrics
https://samstarling.co.uk/projects/finagle-prometheus/
MIT License
30 stars 18 forks source link

use JavaTimer instead of DefaultTimer #41

Closed hderms closed 5 years ago

hderms commented 5 years ago

fix #42 https://gitter.im/twitter/finagle?at=5cdc3c8a252dbb7515609cd4

This prevents the NPE from some kind of circular dependency triggered by LoadService between DefaultTimer and PrometeusStatsReciever and FinagleStatsReceiver

I set the JavaTimer to be daemonized for the following reason:

/*
   * Marks this thread as either a {@linkplain #isDaemon daemon} thread
     * or a user thread. The Java Virtual Machine exits when the only
     * threads running are all daemon threads.

which seems to be what we want?

samstarling commented 5 years ago

Yeah, that sounds right to me. Are you going to submit a PR? If not, I'll make this change and see how it goes!

samstarling commented 5 years ago

Sorry, just noticed this is a PR 😅

samstarling commented 5 years ago

I've released this as 0.0.13: it's on bintray now and is syncing to Maven Central.