mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
River: Add some timer.
This commit is contained in:
1 parent
32e7413aad
commit
8255fc3c1b
1 file changed
+4
-1
@@ -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]:
|
||||
|
||||
Reference in new issue
Block a user