|
@@ -0,0 +1,291 @@
|
|
|
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
|
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
+
|
|
|
+<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
+ <head>
|
|
|
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
+
|
|
|
+ <title>Statistics and Monitoring - celery.monitoring — Celery v0.3.10 (unstable) documentation</title>
|
|
|
+ <link rel="stylesheet" href="../static/agogo.css" type="text/css" />
|
|
|
+ <link rel="stylesheet" href="../static/pygments.css" type="text/css" />
|
|
|
+ <script type="text/javascript">
|
|
|
+ var DOCUMENTATION_OPTIONS = {
|
|
|
+ URL_ROOT: '../',
|
|
|
+ VERSION: '0.3.10 (unstable)',
|
|
|
+ COLLAPSE_MODINDEX: false,
|
|
|
+ FILE_SUFFIX: '.html',
|
|
|
+ HAS_SOURCE: true
|
|
|
+ };
|
|
|
+ </script>
|
|
|
+ <script type="text/javascript" src="../static/jquery.js"></script>
|
|
|
+ <script type="text/javascript" src="../static/doctools.js"></script>
|
|
|
+ <link rel="top" title="Celery v0.3.10 (unstable) documentation" href="../index.html" />
|
|
|
+ </head>
|
|
|
+ <body>
|
|
|
+
|
|
|
+ <div class="header-wrapper">
|
|
|
+ <div class="header">
|
|
|
+ <h1><a href="../index.html">Celery v0.3.10 (unstable) documentation</a></h1>
|
|
|
+ <div class="rel">
|
|
|
+ <a href="../genindex.html" title="General Index"
|
|
|
+ accesskey="I">index</a> |
|
|
|
+ <a href="../modindex.html" title="Global Module Index"
|
|
|
+ accesskey="M">modules</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="content-wrapper">
|
|
|
+ <div class="content">
|
|
|
+ <div class="document">
|
|
|
+ <div class="documentwrapper">
|
|
|
+ <div class="bodywrapper">
|
|
|
+ <div class="body">
|
|
|
+
|
|
|
+ <div class="section" id="module-celery.monitoring">
|
|
|
+<h1>Statistics and Monitoring - celery.monitoring<a class="headerlink" href="#module-celery.monitoring" title="Permalink to this headline">¶</a></h1>
|
|
|
+<p>Publishing Statistics and Monitoring Celery.</p>
|
|
|
+<dl class="class">
|
|
|
+<dt id="celery.monitoring.Statistics">
|
|
|
+<em class="property">
|
|
|
+class </em><tt class="descclassname">celery.monitoring.</tt><tt class="descname">Statistics</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#celery.monitoring.Statistics" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Base class for classes publishing celery statistics.</p>
|
|
|
+<dl class="attribute">
|
|
|
+<dt id="celery.monitoring.Statistics.type">
|
|
|
+<tt class="descname">type</tt><a class="headerlink" href="#celery.monitoring.Statistics.type" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><strong>REQUIRED</strong> The type of statistics this class handles.</dd></dl>
|
|
|
+
|
|
|
+<p><strong>Required handlers</strong></p>
|
|
|
+<dl class="method">
|
|
|
+<dt id="celery.monitoring.Statistics.on_start">
|
|
|
+<tt class="descname">on_start</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#celery.monitoring.Statistics.on_start" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd>What to do when the <a title="celery.monitoring.Statistics.run" class="reference internal" href="#celery.monitoring.Statistics.run"><tt class="xref docutils literal"><span class="pre">run()</span></tt></a> method is called.</dd></dl>
|
|
|
+
|
|
|
+<dl class="method">
|
|
|
+<dt id="celery.monitoring.Statistics.on_stop">
|
|
|
+<tt class="descname">on_stop</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#celery.monitoring.Statistics.on_stop" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd>What to do when the <a title="celery.monitoring.Statistics.stop" class="reference internal" href="#celery.monitoring.Statistics.stop"><tt class="xref docutils literal"><span class="pre">stop()</span></tt></a> method is called.</dd></dl>
|
|
|
+
|
|
|
+<dl class="method">
|
|
|
+<dt id="celery.monitoring.Statistics.publish">
|
|
|
+<tt class="descname">publish</tt><big>(</big><em>**data</em><big>)</big><a class="headerlink" href="#celery.monitoring.Statistics.publish" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Publish statistics to be collected later by
|
|
|
+<a title="celery.monitoring.StatsCollector" class="reference internal" href="#celery.monitoring.StatsCollector"><tt class="xref docutils literal"><span class="pre">StatsCollector</span></tt></a>.</p>
|
|
|
+<table class="docutils field-list" frame="void" rules="none">
|
|
|
+<col class="field-name" />
|
|
|
+<col class="field-body" />
|
|
|
+<tbody valign="top">
|
|
|
+<tr class="field"><th class="field-name">Parameter:</th><td class="field-body"><em>data</em> – An arbitrary Python object containing the statistics
|
|
|
+to be published.</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="method">
|
|
|
+<dt id="celery.monitoring.Statistics.run">
|
|
|
+<tt class="descname">run</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#celery.monitoring.Statistics.run" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd>Start producing statistics.</dd></dl>
|
|
|
+
|
|
|
+<dl class="classmethod">
|
|
|
+<dt id="celery.monitoring.Statistics.start">
|
|
|
+<em class="property">
|
|
|
+classmethod </em><tt class="descname">start</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#celery.monitoring.Statistics.start" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd>Convenience method instantiating and running <a title="celery.monitoring.Statistics.run" class="reference internal" href="#celery.monitoring.Statistics.run"><tt class="xref docutils literal"><span class="pre">run()</span></tt></a> in
|
|
|
+one swoop.</dd></dl>
|
|
|
+
|
|
|
+<dl class="method">
|
|
|
+<dt id="celery.monitoring.Statistics.stop">
|
|
|
+<tt class="descname">stop</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#celery.monitoring.Statistics.stop" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd>Stop producing and publish statistics.</dd></dl>
|
|
|
+
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="class">
|
|
|
+<dt id="celery.monitoring.StatsCollector">
|
|
|
+<em class="property">
|
|
|
+class </em><tt class="descclassname">celery.monitoring.</tt><tt class="descname">StatsCollector</tt><a class="headerlink" href="#celery.monitoring.StatsCollector" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Collect and report Celery statistics.</p>
|
|
|
+<dl class="docutils">
|
|
|
+<dt><strong>NOTE</strong>: Please run only one collector at any time, or your stats</dt>
|
|
|
+<dd>will be skewed.</dd>
|
|
|
+</dl>
|
|
|
+<dl class="attribute">
|
|
|
+<dt id="celery.monitoring.StatsCollector.total_tasks_processed">
|
|
|
+<tt class="descname">total_tasks_processed</tt><a class="headerlink" href="#celery.monitoring.StatsCollector.total_tasks_processed" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd>The number of tasks executed in total since the first time
|
|
|
+<a title="celery.monitoring.StatsCollector.collect" class="reference internal" href="#celery.monitoring.StatsCollector.collect"><tt class="xref docutils literal"><span class="pre">collect()</span></tt></a> was executed on this class instance.</dd></dl>
|
|
|
+
|
|
|
+<dl class="attribute">
|
|
|
+<dt id="celery.monitoring.StatsCollector.total_tasks_processed_by_type">
|
|
|
+<tt class="descname">total_tasks_processed_by_type</tt><a class="headerlink" href="#celery.monitoring.StatsCollector.total_tasks_processed_by_type" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd>A dictionary of task names and how many times they have been
|
|
|
+executed in total since the first time <a title="celery.monitoring.StatsCollector.collect" class="reference internal" href="#celery.monitoring.StatsCollector.collect"><tt class="xref docutils literal"><span class="pre">collect()</span></tt></a> was executed
|
|
|
+on this class instance.</dd></dl>
|
|
|
+
|
|
|
+<dl class="attribute">
|
|
|
+<dt id="celery.monitoring.StatsCollector.total_task_time_running">
|
|
|
+<tt class="descname">total_task_time_running</tt><a class="headerlink" href="#celery.monitoring.StatsCollector.total_task_time_running" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd>The total time, in seconds, it took to process all the tasks executed
|
|
|
+since the first time <a title="celery.monitoring.StatsCollector.collect" class="reference internal" href="#celery.monitoring.StatsCollector.collect"><tt class="xref docutils literal"><span class="pre">collect()</span></tt></a> was executed on this class
|
|
|
+instance.</dd></dl>
|
|
|
+
|
|
|
+<dl class="attribute">
|
|
|
+<dt id="celery.monitoring.StatsCollector.total_task_time_running_by_type">
|
|
|
+<tt class="descname">total_task_time_running_by_type</tt><a class="headerlink" href="#celery.monitoring.StatsCollector.total_task_time_running_by_type" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd>A dictionary of task names and their total running time in seconds,
|
|
|
+counting all the tasks that has been run since the first time
|
|
|
+<a title="celery.monitoring.StatsCollector.collect" class="reference internal" href="#celery.monitoring.StatsCollector.collect"><tt class="xref docutils literal"><span class="pre">collect()</span></tt></a> was executed on this class instance.</dd></dl>
|
|
|
+
|
|
|
+<dl class="docutils">
|
|
|
+<dt><strong>NOTE</strong>: You have to run <a title="celery.monitoring.StatsCollector.collect" class="reference internal" href="#celery.monitoring.StatsCollector.collect"><tt class="xref docutils literal"><span class="pre">collect()</span></tt></a> for these attributes</dt>
|
|
|
+<dd>to be filled.</dd>
|
|
|
+</dl>
|
|
|
+<dl class="method">
|
|
|
+<dt id="celery.monitoring.StatsCollector.collect">
|
|
|
+<tt class="descname">collect</tt><big>(</big><big>)</big><a class="headerlink" href="#celery.monitoring.StatsCollector.collect" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd>Collect any new statistics available since the last time
|
|
|
+<a href="#id1"><span class="problematic" id="id2">:methd:`collect`</span></a> was executed.</dd></dl>
|
|
|
+
|
|
|
+<dl class="method">
|
|
|
+<dt id="celery.monitoring.StatsCollector.dump_to_cache">
|
|
|
+<tt class="descname">dump_to_cache</tt><big>(</big><em>cache_key_prefix='celery-statistics'</em><big>)</big><a class="headerlink" href="#celery.monitoring.StatsCollector.dump_to_cache" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd>Store collected statistics in the cache.</dd></dl>
|
|
|
+
|
|
|
+<dl class="method">
|
|
|
+<dt id="celery.monitoring.StatsCollector.report">
|
|
|
+<tt class="descname">report</tt><big>(</big><big>)</big><a class="headerlink" href="#celery.monitoring.StatsCollector.report" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Dump a nice statistics report from the data collected since
|
|
|
+the first time <a title="celery.monitoring.StatsCollector.collect" class="reference internal" href="#celery.monitoring.StatsCollector.collect"><tt class="xref docutils literal"><span class="pre">collect()</span></tt></a> was executed on this instance.</p>
|
|
|
+<p>It outputs the following information:</p>
|
|
|
+<ul>
|
|
|
+<li><dl class="first docutils">
|
|
|
+<dt>Total processing time by task type and how many times each</dt>
|
|
|
+<dd><p class="first last">task has been excuted.</p>
|
|
|
+</dd>
|
|
|
+</dl>
|
|
|
+</li>
|
|
|
+<li><p class="first">Total task processing time.</p>
|
|
|
+</li>
|
|
|
+<li><p class="first">Total number of tasks executed</p>
|
|
|
+</li>
|
|
|
+</ul>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="method">
|
|
|
+<dt id="celery.monitoring.StatsCollector.task_time_running">
|
|
|
+<tt class="descname">task_time_running</tt><big>(</big><em>task_id</em>, <em>task_name</em>, <em>args</em>, <em>kwargs</em>, <em>nsecs</em><big>)</big><a class="headerlink" href="#celery.monitoring.StatsCollector.task_time_running" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>Process statistics regarding how long a task has been running
|
|
|
+(the :class:TaskTimerStats` class is responsible for sending these).</p>
|
|
|
+<table class="docutils field-list" frame="void" rules="none">
|
|
|
+<col class="field-name" />
|
|
|
+<col class="field-body" />
|
|
|
+<tbody valign="top">
|
|
|
+<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
|
|
+<li><em>task_id</em> – The UUID of the task.</li>
|
|
|
+<li><em>task_name</em> – The name of task.</li>
|
|
|
+<li><em>args</em> – The tasks positional arguments.</li>
|
|
|
+<li><em>kwargs</em> – The tasks keyword arguments.</li>
|
|
|
+<li><em>nsecs</em> – The number of seconds (in <tt class="xref docutils literal"><span class="pre">time.time()</span></tt> format)
|
|
|
+it took to execute the task.</li>
|
|
|
+</ul>
|
|
|
+</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="class">
|
|
|
+<dt id="celery.monitoring.TaskTimerStats">
|
|
|
+<em class="property">
|
|
|
+class </em><tt class="descclassname">celery.monitoring.</tt><tt class="descname">TaskTimerStats</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#celery.monitoring.TaskTimerStats" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd>Time a running <a title="celery.task.Task" class="reference external" href="celery.task.html#celery.task.Task"><tt class="xref docutils literal"><span class="pre">celery.task.Task</span></tt></a>.</dd></dl>
|
|
|
+
|
|
|
+<dl class="class">
|
|
|
+<dt id="celery.monitoring.TimerStats">
|
|
|
+<em class="property">
|
|
|
+class </em><tt class="descclassname">celery.monitoring.</tt><tt class="descname">TimerStats</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#celery.monitoring.TimerStats" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>A generic timer producing <tt class="docutils literal"><span class="pre">celery</span></tt> statistics.</p>
|
|
|
+<dl class="attribute">
|
|
|
+<dt id="celery.monitoring.TimerStats.time_start">
|
|
|
+<tt class="descname">time_start</tt><a class="headerlink" href="#celery.monitoring.TimerStats.time_start" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd>The time when this class was instantiated (in <tt class="xref docutils literal"><span class="pre">time.time()</span></tt>
|
|
|
+format.)</dd></dl>
|
|
|
+
|
|
|
+<dl class="method">
|
|
|
+<dt id="celery.monitoring.TimerStats.on_finish">
|
|
|
+<tt class="descname">on_finish</tt><big>(</big><big>)</big><a class="headerlink" href="#celery.monitoring.TimerStats.on_finish" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd><p>What to do when the timers <tt class="xref docutils literal"><span class="pre">stop()</span></tt> method is called.</p>
|
|
|
+<table class="docutils field-list" frame="void" rules="none">
|
|
|
+<col class="field-name" />
|
|
|
+<col class="field-body" />
|
|
|
+<tbody valign="top">
|
|
|
+<tr class="field"><th class="field-name">Returns:</th><td class="field-body">the time in seconds it took between calling <tt class="xref docutils literal"><span class="pre">start()</span></tt> on
|
|
|
+this class and <tt class="xref docutils literal"><span class="pre">stop()</span></tt>.</td>
|
|
|
+</tr>
|
|
|
+</tbody>
|
|
|
+</table>
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+<dl class="method">
|
|
|
+<dt id="celery.monitoring.TimerStats.on_start">
|
|
|
+<tt class="descname">on_start</tt><big>(</big><em>task_id</em>, <em>task_name</em>, <em>args</em>, <em>kwargs</em><big>)</big><a class="headerlink" href="#celery.monitoring.TimerStats.on_start" title="Permalink to this definition">¶</a></dt>
|
|
|
+<dd>What to do when the timers <tt class="xref docutils literal"><span class="pre">run()</span></tt> method is called.</dd></dl>
|
|
|
+
|
|
|
+</dd></dl>
|
|
|
+
|
|
|
+</div>
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="sidebar">
|
|
|
+ <h3>Contents</h3>
|
|
|
+ <ul>
|
|
|
+<li class="toctree-l1"><a class="reference external" href="../introduction.html">celery - Distributed Task Queue for Django.</a></li>
|
|
|
+<li class="toctree-l1"><a class="reference external" href="../faq.html">Frequently Asked Questions</a></li>
|
|
|
+<li class="toctree-l1"><a class="reference external" href="index.html">Module API Reference</a></li>
|
|
|
+<li class="toctree-l1"><a class="reference external" href="../changelog.html">Change history</a></li>
|
|
|
+</ul>
|
|
|
+
|
|
|
+ <h3 style="margin-top: 1.5em;">Search</h3>
|
|
|
+ <form class="search" action="../search.html" method="get">
|
|
|
+ <input type="text" name="q" size="18" />
|
|
|
+ <input type="submit" value="Go" />
|
|
|
+ <input type="hidden" name="check_keywords" value="yes" />
|
|
|
+ <input type="hidden" name="area" value="default" />
|
|
|
+ </form>
|
|
|
+ <p class="searchtip" style="font-size: 90%">
|
|
|
+ Enter search terms or a module, class or function name.
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <div class="clearer"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="footer-wrapper">
|
|
|
+ <div class="footer">
|
|
|
+ <div class="left">
|
|
|
+ <a href="../genindex.html" title="General Index"
|
|
|
+ >index</a> |
|
|
|
+ <a href="../modindex.html" title="Global Module Index"
|
|
|
+ >modules</a>
|
|
|
+ <br/>
|
|
|
+ <a href="../sources/reference/celery.monitoring.txt"
|
|
|
+ rel="nofollow">Show Source</a>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="right">
|
|
|
+ © Copyright 2009, Ask Solem.<br/>
|
|
|
+ Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.1.
|
|
|
+ </div>
|
|
|
+ <div class="clearer"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </body>
|
|
|
+</html>
|