Many thanks for your comments. You clearly know more about osprofiler than I do :-)
Some notes on why I'm interested in this:
Part of the reason I'm interested in this is the 'zero downtime configuration' stuff I've been working on.
I'd like some of the api/registry specific parts of the api.py or registry.py startup scripts to be removed if possible and make the scripts simpler. I'd like to be able to pick up any osprofiler changes make before a 'restart' of the service. Currently osprofiler makes this tricky as, once we are in wsgi.py there is no way to know (currently) if the process is an api or registry process (that asymmetry is handled in api.py/registry.py, but they won't be invoked on a restart)
Glance could probably work around osprofiler's current config/bootstrap, but it got me thinking about whether things could be improved.
> we need to write a customized notifier in project, and create and set notifier to osprofiler. So overall, I mean osprofiler can't bootstraps itself without extra initialization step.
Could that be done similarly to this?
data_api = glance.db.registry.api
(in glance-api.conf)
From a service restart point of view, it would be great if you just changed a 'native' osprofiler option and didn't need to make an 'init' call. However, if you need a one line "init_osprofiler()" that was called on service startup (or restart) somewhere inside glance's wsgi.py that wouldn't be too bad (as long as it could handle the api/registry case, ie the port number and service name were native osprofiler options).
Hi Zhi Yan,
Many thanks for your comments. You clearly know more about osprofiler than I do :-)
Some notes on why I'm interested in this:
Part of the reason I'm interested in this is the 'zero downtime configuration' stuff I've been working on.
I'd like some of the api/registry specific parts of the api.py or registry.py startup scripts to be removed if possible and make the scripts simpler. I'd like to be able to pick up any osprofiler changes make before a 'restart' of the service. Currently osprofiler makes this tricky as, once we are in wsgi.py there is no way to know (currently) if the process is an api or registry process (that asymmetry is handled in api.py/registry.py, but they won't be invoked on a restart)
Glance could probably work around osprofiler's current config/bootstrap, but it got me thinking about whether things could be improved.
> we need to write a customized notifier in project, and create and set notifier to osprofiler. So overall, I mean osprofiler can't bootstraps itself without extra initialization step.
Could that be done similarly to this?
data_api = glance. db.registry. api
(in glance-api.conf)
From a service restart point of view, it would be great if you just changed a 'native' osprofiler option and didn't need to make an 'init' call. However, if you need a one line "init_osprofiler()" that was called on service startup (or restart) somewhere inside glance's wsgi.py that wouldn't be too bad (as long as it could handle the api/registry case, ie the port number and service name were native osprofiler options).