From 9c74cf1e86272bc02ed4c1d9b1e1ef4f82e039e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Fri, 25 Sep 2009 10:33:39 +0000
Subject: [PATCH]  - add timing information for activities

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29182 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/CMFActivity/bin/watch_activities | 1 +
 1 file changed, 1 insertion(+)

diff --git a/product/CMFActivity/bin/watch_activities b/product/CMFActivity/bin/watch_activities
index b31b27c539..c606766402 100755
--- a/product/CMFActivity/bin/watch_activities
+++ b/product/CMFActivity/bin/watch_activities
@@ -39,6 +39,7 @@ for t in message message_queue ; do
   SELECT=$SELECT"""
   SELECT count(*) AS $t, method_id, processing, processing_node AS node, min(priority) AS min_pri, max(priority) AS max_pri FROM $t GROUP BY method_id, processing, processing_node ORDER BY node;
   SELECT count(*) AS $t, processing, processing_node, min(priority) AS min_pri, max(priority) AS max_pri FROM $t GROUP BY processing, processing_node;
+  SELECT priority as pri, MIN(timediff(NOW(), date)) AS min, AVG(timediff(NOW() , date)) AS avg, MAX(timediff(NOW() , date)) AS max FROM $t GROUP BY priority;
   SELECT count(*) AS ${t}_count FROM $t;
   """
 done
-- 
2.30.9