Changeset 1249

Show
Ignore:
Timestamp:
09/24/07 07:45:42 (14 months ago)
Author:
JensDiemer
Message:

-a human time in pagestats
-change version string to v0.8.0RC1

Location:
trunk/pylucid/PyLucid
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid/PyLucid/middlewares/pagestats.py

    r1227 r1249  
    3131 
    3232FMT = ( 
    33     'render time: %(total_time).3f -' 
    34     ' overall: %(overall_time).1f -' 
     33    'render time: %(total_time)s -' 
     34    ' overall: %(overall_time)s -' 
    3535    ' Queries: %(queries)d' 
    3636) 
     37 
     38 
     39def human_time(t): 
     40    if t<1: 
     41        return "%.1f ms" % (t * 100) 
     42    elif t>60: 
     43        return "%.1f min" % (t/60.0) 
     44    else: 
     45        return "%.1f sec" % t 
     46 
    3747 
    3848class PageStatsMiddleware(object): 
     
    7080        queries = len(connection.queries) - old_queries 
    7181 
     82        total_time = human_time(time() - start_time) 
     83        overall_time = human_time(time() - start_overall) 
     84 
    7285        # replace the comment if found 
    7386        stat_info = FMT % { 
    74             'total_time' : time() - start_time, 
    75             'overall_time' : time() - start_overall, 
     87            'total_time' : total_time, 
     88            'overall_time' : overall_time, 
    7689            'queries' : queries, 
    7790        } 
  • trunk/pylucid/PyLucid/__init__.py

    r1238 r1249  
    2626 
    2727# PyLucid Version String 
    28 PYLUCID_VERSION = (0, 8, 0, "beta2 " + svn_revision) 
    29 PYLUCID_VERSION_STRING = "0.8.0 beta2 " + svn_revision 
     28PYLUCID_VERSION = (0, 8, 0, "RC1 " + svn_revision) 
     29PYLUCID_VERSION_STRING = "0.8.0 RC1 " + svn_revision 
    3030 
    3131