Package benchmarker

The becckmarker for the server.

Sub-modules

benchmarker.bm

Benchmarker for the e2eeftp server.

Classes

class BenchMark (warmup: bool = True)
Expand source code
class BenchMark:
    """this is the benckmarker class used to benchmark.
    """
    def __init__(self, warmup: bool=True):
        self.warmup = warmup

    def _warmup(self):
        for i in range(100_000_000): ...

    def __enter__(self):
        print("Running warmup...")
        if self.warmup:
            self.start_warmup = perf_counter()
            self._warmup()
            self.end_warmup = perf_counter()
            self.duriation_warmup = self.end_warmup - self.start_warmup
            print(f"Warmup took: {self.duriation_warmup:.6f}s")
        print("Benckmarking function...")
        self.start = perf_counter()
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        self.end = perf_counter()
        self.duration = self.end - self.start
        print(f"benchmark: {self.duration:.6f}s")

this is the benckmarker class used to benchmark.