Pārlūkot izejas kodu

Add more info about statistics

Ask Solem 15 gadi atpakaļ
vecāks
revīzija
a5cb0ea4c2
2 mainītis faili ar 7 papildinājumiem un 26 dzēšanām
  1. 6 4
      README.rst
  2. 1 22
      celery/worker.py

+ 6 - 4
README.rst

@@ -52,8 +52,8 @@ Features
     * Supports *periodic tasks*, which makes it a (better) replacement
       for cronjobs.
 
-    * When a task has been executed, the return value is stored using either
-      a MySQL/Oracle/PostgreSQL/SQLite database, memcached,
+    * When a task has been executed, the return value can be stored using
+      either a MySQL/Oracle/PostgreSQL/SQLite database, Memcached,
       or Tokyo Tyrant back-end.
 
     * If the task raises an exception, the exception instance is stored,
@@ -74,8 +74,10 @@ Features
       returns a JSON-serialized data structure containing the task status,
       and the return value if completed, or exception on failure.
 
-    * Supports statistics for profiling and monitoring.
-      
+    * The worker can collect statistics, like, how many tasks has been
+      executed by type, and the time it took to process them. Very useful
+      for monitoring and profiling.
+
 API Reference Documentation
 ===========================
 

+ 1 - 22
celery/worker.py

@@ -66,28 +66,7 @@ def jail(task_id, task_name, func, args, kwargs):
     ignore_result = getattr(func, "ignore_result", False)
     timer_stat = TaskTimerStats.start(task_id, task_name, args, kwargs)
 
-    # See: http://groups.google.com/group/django-users/browse_thread/
-    #       thread/78200863d0c07c6d/38402e76cf3233e8?hl=en&lnk=gst&
-    #       q=multiprocessing#38402e76cf3233e8
-    from django.db import connection
-    connection.close()
-
-    # Reset cache connection only if using memcached/libmemcached
-    from django.core import cache
-    # XXX At Opera we use a custom memcached backend that uses libmemcached
-    # instead of libmemcache (cmemcache). Should find a better solution for
-    # this, but for now "memcached" should probably be unique enough of a
-    # string to not make problems.
-    cache_backend = cache.settings.CACHE_BACKEND
-    if hasattr(cache, "parse_backend_uri"):
-        cache_scheme = cache.parse_backend_uri(cache_backend)[0]
-    else:
-        # Django <= 1.0.2
-        cache_scheme = cache_backend.split(":", 1)[0]
-    if "memcached" in cache_scheme:
-        cache.cache.close()
-
-    # Backend process cleanup
+     Backend process cleanup
     default_backend.process_cleanup()
 
     try: