mirror of https://gitlab.com/pamhyr/pamhyr2
River: Add some timer.
parent
32e7413aad
commit
8255fc3c1b
|
|
@ -20,7 +20,7 @@ import logging
|
|||
import itertools
|
||||
import numpy as np
|
||||
|
||||
from tools import flatten
|
||||
from tools import flatten, timer
|
||||
from functools import reduce
|
||||
from datetime import datetime
|
||||
|
||||
|
|
@ -62,9 +62,11 @@ class Profile(SQLSubModel):
|
|||
|
||||
self._data[timestamp][key] = data
|
||||
|
||||
@timer
|
||||
def get_ts(self, timestamp):
|
||||
return self._data[timestamp]
|
||||
|
||||
@timer
|
||||
def get_key(self, key):
|
||||
res = list(
|
||||
map(lambda ts: self._data[ts][key],
|
||||
|
|
@ -72,6 +74,7 @@ class Profile(SQLSubModel):
|
|||
)
|
||||
return res
|
||||
|
||||
@timer
|
||||
def get_ts_key(self, timestamp, key):
|
||||
if timestamp in self._data:
|
||||
if key in self._data[timestamp]:
|
||||
|
|
|
|||
Loading…
Reference in New Issue