omergertel / pyformance

Performance metrics, based on Coda Hale's Yammer metrics
Other
195 stars 72 forks source link

Tested in Docker? #46

Closed ddavtian closed 6 years ago

ddavtian commented 6 years ago

Hello,

General question here, but has the code been tested with docker containers?

omergertel commented 6 years ago

I'm not sure what you mean. What are you concerned about?

ddavtian commented 6 years ago

@omergertel wanted to see if there would be any issues say the OpenTSDBReporter reporter from within docker, meaning would the threading work properly and fire every reporting_interval ?

ddavtian commented 6 years ago

@omergertel did additional testing this morning, this part of the testing is not Docker specific but rather I ran the code within Gunicorn with the following set of flags

--bind 0.0.0.0:8000 --timeout 120 --workers 1 --preload --access-logfile - --log-level info octo.wsgi

Seems like the following loop doesn't trigger on the second interval.

reporter.py

    def _loop(self):
        while not self._stopped.is_set():
            try:
                self.report_now(self.registry)
            except:
                pass
            time.sleep(self.reporting_interval)
        # self._stopped.clear()
ddavtian commented 6 years ago

@omergertel found my issue, closing this ticket and possibly this might help someone else in the future. Seems like when passing --preload to Gunicorn it caused the issue for the scheduler not to run.

omergertel commented 6 years ago

Thanks, sorry I couldn't help more. Happy you found out your issue 😺