Benchmark

View Licence Agreement

sosw.components.benchmark.benchmark(fn)[source]

Decorator that should be used on class methods that you want to benchmark. It will aggregate to self.stats of the Processor class timing of decorated functions.

fn - pointer to class function. Class is not yet initialized.
self - pointer to class instance. Passed during the call of decorated method.

Usage example:

class Processor(SoswProcessor):

    @benchmark
    def make_query_to_db(self):
        ...