|
a/Allura/allura/lib/stats.py |
|
b/Allura/allura/lib/stats.py |
|
... |
|
... |
17 |
def __repr__(self):
|
17 |
def __repr__(self):
|
18 |
stats = ' '.join(
|
18 |
stats = ' '.join(
|
19 |
('%s=%.0fms' % (k,v*1000))
|
19 |
('%s=%.0fms' % (k,v*1000))
|
20 |
for k,v in sorted(self.timers.iteritems()))
|
20 |
for k,v in sorted(self.timers.iteritems()))
|
21 |
return '%s: %s' % (self.url, stats)
|
21 |
return '%s: %s' % (self.url, stats)
|
|
|
22 |
|
|
|
23 |
def asdict(self):
|
|
|
24 |
return dict(
|
|
|
25 |
url=self.url,
|
|
|
26 |
timers=self.timers)
|
22 |
|
27 |
|
23 |
@contextmanager
|
28 |
@contextmanager
|
24 |
def timing(self, name):
|
29 |
def timing(self, name):
|
25 |
if self.active and name not in self._now_timing:
|
30 |
if self.active and name not in self._now_timing:
|
26 |
self._now_timing.add(name)
|
31 |
self._now_timing.add(name)
|