Browse Source

Adds worker pid to inspect stats

Mher Movsisyan 12 years ago
parent
commit
b48e3fe4a7
2 changed files with 5 additions and 1 deletions
  1. 1 0
      Changelog
  2. 4 1
      celery/worker/control.py

+ 1 - 0
Changelog

@@ -16,6 +16,7 @@ If you're looking for versions prior to 3.x you should see :ref:`history`.
 :state: DEVEL
 :branch: master
 
+- `celery inspect stats` now contains worker pid
 - `Task.apply_async` now supports timeout and soft_timeout arguments (Issue #802)
 - `App.control.Inspect.conf` can be used for inspecting worker configuration
 

+ 4 - 1
celery/worker/control.py

@@ -8,6 +8,8 @@
 """
 from __future__ import absolute_import
 
+import os
+
 from future_builtins import map
 
 from kombu.utils.encoding import safe_repr
@@ -184,7 +186,8 @@ def stats(panel, **kwargs):
     return {'total': state.total_count,
             'consumer': panel.consumer.info,
             'pool': panel.consumer.pool.info,
-            'autoscaler': asinfo}
+            'autoscaler': asinfo,
+            'pid': os.getpid()}
 
 
 @Panel.register