summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugin
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2014-12-13 15:33:46 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2014-12-13 16:16:28 +0100
commit1ad55cc4e22aa3c2c1daf0d7f6a99558d3da60bf (patch)
tree231658fef0d17817194edca3c75f08caa10b7d35 /src/lib/Bcfg2/Server/Plugin
parent99eecfc8cc9238833a49f78af24c7aac882212de (diff)
downloadbcfg2-1ad55cc4e22aa3c2c1daf0d7f6a99558d3da60bf.tar.gz
bcfg2-1ad55cc4e22aa3c2c1daf0d7f6a99558d3da60bf.tar.bz2
bcfg2-1ad55cc4e22aa3c2c1daf0d7f6a99558d3da60bf.zip
Server/Plugin/helpers: remove track_statistics
Bcfg2.Server.Statistics.track_statistics was identical.
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugin')
-rw-r--r--src/lib/Bcfg2/Server/Plugin/helpers.py36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/lib/Bcfg2/Server/Plugin/helpers.py b/src/lib/Bcfg2/Server/Plugin/helpers.py
index 559612d1e..2aab231c6 100644
--- a/src/lib/Bcfg2/Server/Plugin/helpers.py
+++ b/src/lib/Bcfg2/Server/Plugin/helpers.py
@@ -3,7 +3,6 @@
import os
import re
import sys
-import time
import copy
import glob
import logging
@@ -35,41 +34,6 @@ except ImportError:
LOGGER = logging.getLogger(__name__)
-class track_statistics(object): # pylint: disable=C0103
- """ Decorator that tracks execution time for the given
- :class:`Plugin` method with :mod:`Bcfg2.Statistics` for reporting
- via ``bcfg2-admin perf`` """
-
- def __init__(self, name=None):
- """
- :param name: The name under which statistics for this function
- will be tracked. By default, the name will be
- the name of the function concatenated with the
- name of the class the function is a member of.
- :type name: string
- """
- # if this is None, it will be set later during __call_
- self.name = name
-
- def __call__(self, func):
- if self.name is None:
- self.name = func.__name__
-
- @wraps(func)
- def inner(obj, *args, **kwargs):
- """ The decorated function """
- name = "%s:%s" % (obj.__class__.__name__, self.name)
-
- start = time.time()
- try:
- return func(obj, *args, **kwargs)
- finally:
- Bcfg2.Server.Statistics.stats.add_value(name,
- time.time() - start)
-
- return inner
-
-
def removecomment(stream):
""" A Genshi filter that removes comments from the stream. This
function is a generator.