[Mpuls-commits] r5225 - in base/trunk: . mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Aug 4 14:24:29 CEST 2011


Author: ludwig
Date: 2011-08-04 14:24:27 +0200 (Thu, 04 Aug 2011)
New Revision: 5225

Removed:
   base/trunk/mpulsweb/lib/timelog.py
Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/lib/app_globals.py
   base/trunk/mpulsweb/lib/base.py
Log:
Removed the not needed timelog module.

Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2011-08-04 09:23:53 UTC (rev 5224)
+++ base/trunk/ChangeLog	2011-08-04 12:24:27 UTC (rev 5225)
@@ -1,5 +1,12 @@
 2011-08-04  Ludwig Reiter <ludwig.reiter at intevation.de>
 
+	* mpulsweb/lib/timelog.py,
+	mpulsweb/lib/base.py,
+	mpulsweb/lib/app_globals.py:
+	Removed the not needed timelog module.
+
+2011-08-04  Ludwig Reiter <ludwig.reiter at intevation.de>
+
 	* mpulsweb/controllers/administration.py,
 	mpulsweb/lib/search.py,
 	mpulsweb/lib/validators.py:

Modified: base/trunk/mpulsweb/lib/app_globals.py
===================================================================
--- base/trunk/mpulsweb/lib/app_globals.py	2011-08-04 09:23:53 UTC (rev 5224)
+++ base/trunk/mpulsweb/lib/app_globals.py	2011-08-04 12:24:27 UTC (rev 5225)
@@ -39,7 +39,6 @@
 from libmpuls.service.tags import TagSetterConfig
 
 from mpulsweb.config.importer import import_overridable_module
-from mpulsweb.lib.timelog import setupTimeLogging
 from mpulsweb.lib.config import MpulsAppConfig, MpulsDBMapping, MpulsDBList
 from mpulsweb.model.annotations import AnnotationsProvider
 
@@ -123,15 +122,6 @@
         # are not related to any global vars or functions. Move to
         # config/environment.py
 
-        # set time logging
-        time_host = config.get('time_host')
-        time_port = config.get('time_port')
-
-        if time_host and time_port:
-            setupTimeLogging(time_host, int(time_port))
-        elif time_host:
-            setupTimeLogging(int(time_host))
-
         self._init_case()
 
     def _init_case(self):

Modified: base/trunk/mpulsweb/lib/base.py
===================================================================
--- base/trunk/mpulsweb/lib/base.py	2011-08-04 09:23:53 UTC (rev 5224)
+++ base/trunk/mpulsweb/lib/base.py	2011-08-04 12:24:27 UTC (rev 5225)
@@ -49,7 +49,6 @@
 from mpulsweb.config.importer import import_overridable_module
 import mpulsweb.lib.db as db
 from mpulsweb.lib.translation import set_lang, _, ungettext
-from mpulsweb.lib.timelog import timeLog
 from mpulsweb.lib.navigation import get_navigation
 from mpulsweb.lib.app_globals import session
 from mpulsweb.lib.logfilter import DBNameContextFilter
@@ -204,7 +203,6 @@
         # WSGIController.__call__ dispatches to the Controller method
         # the request is routed to. This routing information is
         # available in environ['pylons.routes_dict']
-        startTime = time()
         try:
             return WSGIController.__call__(self, environ, start_response)
         finally:
@@ -217,8 +215,6 @@
                 db.leave(_db)
                 _db.closeConnections()
             DBNameContextFilter.set_thread_dbname(None)
-            stopTime = time()
-            timeLog(stopTime - startTime)
 
     def _checkInt(self, i):
         try:

Deleted: base/trunk/mpulsweb/lib/timelog.py
===================================================================
--- base/trunk/mpulsweb/lib/timelog.py	2011-08-04 09:23:53 UTC (rev 5224)
+++ base/trunk/mpulsweb/lib/timelog.py	2011-08-04 12:24:27 UTC (rev 5225)
@@ -1,75 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# Copyright 2007, 2008 Intevation GmbH, Germany, <info at intevation.de>
-#
-# This file is part of mpuls WASKA (CoMPUter-based case fiLeS -
-# Web-Anwendungs-Server fuer Kompetenzagenturen).
-#
-# mpuls WASKA is free software: you can redistribute it and/or modify it under
-# the terms of the GNU Affero General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-#
-# mpuls WASKA is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
-# License for more details.
-#
-# You should have received a copy of the GNU Affero General Public
-# License along with mpuls WASKA. If not, see <http://www.gnu.org/licenses/>.
-#
-# mpuls WASKA has been developed on behalf of the
-# Projekttraeger im Deutschen Zentrum fuer Luft- und Raumfahrt e.V. (PT-DLR)
-# within the programme Kompetenzagenturen (Durchfuehrungsphase) funded by
-# the Bundesministerium fuer Familie, Senioren, Frauen und Jugend and
-# European Social Fund resources.
-# Authors:
-# Sascha L. Teichmann <teichmann at intevation.de>
-#
-
-import logging
-import logging.handlers as handlers
-
-from threading import Lock
-
-import sys
-
-MAX_TIME_LIST_LEN = 5
-
-__TIME_LOCK = Lock()
-
-__TIME_LIST = []
-
-__LOGGER = None
-
-def setupTimeLogging(host='localhost', port=handlers.DEFAULT_TCP_LOGGING_PORT):
-    if host:
-        host = host.strip()
-    if host:
-        print >> sys.stderr, "time logging: %s port %d" % (host, port)
-        global __LOGGER
-        __LOGGER = logging.getLogger('waska.timelog')
-        socketHandler = handlers.SocketHandler(host, port)
-        __LOGGER.addHandler(socketHandler)
-        __LOGGER.setLevel(logging.INFO)
-    else:
-        print >> sys.stderr, "time logging deactivated"
-
-def timeLog(t):
-    try:
-        __TIME_LOCK.acquire()
-        if __LOGGER is None:
-            return
-
-        if len(__TIME_LIST) < MAX_TIME_LIST_LEN-1:
-            __TIME_LIST.append(t)
-        else:
-            __TIME_LIST.append(t)
-            avg = float(sum(__TIME_LIST))/MAX_TIME_LIST_LEN
-            del __TIME_LIST[:]
-            __LOGGER.info("%f" % avg)
-    finally:
-        __TIME_LOCK.release()
-
-
-# vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:



More information about the Mpuls-commits mailing list