aboutsummaryrefslogtreecommitdiff
path: root/wqflask/maintenance/print_benchmark.py
diff options
context:
space:
mode:
authorzsloan2021-10-18 17:50:26 +0000
committerzsloan2021-10-18 17:50:26 +0000
commite36eaf0003a598bc5aa688803dd1b36c24a4c051 (patch)
treea59b7dadf02241575eb0774f97c6048e2425c053 /wqflask/maintenance/print_benchmark.py
parentbd421438f1f0b4de913fa40cd49cfcda27e6b16f (diff)
parent04f3d13aceeaec2e52b94037d59f08ed6dc6a8bb (diff)
downloadgenenetwork2-e36eaf0003a598bc5aa688803dd1b36c24a4c051.tar.gz
Merge branch 'testing' of github.com:genenetwork/genenetwork2 into feature/remove_trait_creation_from_search
Diffstat (limited to 'wqflask/maintenance/print_benchmark.py')
-rw-r--r--wqflask/maintenance/print_benchmark.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/wqflask/maintenance/print_benchmark.py b/wqflask/maintenance/print_benchmark.py
index b24ce4f1..9d12da8a 100644
--- a/wqflask/maintenance/print_benchmark.py
+++ b/wqflask/maintenance/print_benchmark.py
@@ -5,7 +5,7 @@ import time
from pprint import pformat as pf
-class TheCounter(object):
+class TheCounter:
Counters = {}
def __init__(self):
@@ -15,15 +15,18 @@ class TheCounter(object):
self.time_took = time.time() - start_time
TheCounter.Counters[self.__class__.__name__] = self.time_took
+
class PrintAll(TheCounter):
def print_it(self, counter):
print(counter)
+
class PrintSome(TheCounter):
def print_it(self, counter):
if counter % 1000 == 0:
print(counter)
+
class PrintNone(TheCounter):
def print_it(self, counter):
pass
@@ -37,5 +40,6 @@ def new_main():
print(pf(TheCounter.Counters))
+
if __name__ == '__main__':
new_main()