blob: 9b488b70044e6fab58abdac08b3a5d54d1a207dc [file] [log] [blame]
koder aka kdanilov70227062016-11-26 23:23:21 +02001from typing import Union, Dict, List, Any, Tuple
2
3# Stores test result for integral value, which
4# can be expressed as a single value for given time period,
5# like IO, BW, etc.
6TimeSeriesIntegral = List[float]
7
8
9# Stores test result for value, which
10# requires distribution to be stored for any time period,
11# like latency.
12TimeSeriesHistogram = List[List[float]]
13
14
15TimeSeries = Union[TimeSeriesIntegral, TimeSeriesHistogram]
16RawTestResults = Dict[str, TimeSeries]
17
18
19class SensorInfo:
20 """Holds information from a single sensor from a single node"""
21 node_id = None # type: str
22 source_id = None # type: str
23 sensor_name = None # type: str
24 begin_time = None # type: int
25 end_time = None # type: int
26 data = None # type: TimeSeries
27
28 def __init__(self, node_id: str, source_id: str, sensor_name: str) -> None:
29 self.node_id = node_id
30 self.source_id = source_id
31 self.sensor_name = sensor_name
32
33
34class TestInfo:
35 """Contains done test information"""
36 name = None # type: str
37 iteration_name = None # type: str
38 nodes = None # type: List[str]
39 start_time = None # type: int
40 stop_time = None # type: int
41 params = None # type: Dict[str, Any]
42 config = None # type: str
43 node_ids = None # type: List[str]
44
45
46class FullTestResult:
47 test_info = None # type: TestInfo
48
49 # TODO(koder): array.array or numpy.array?
50 # {(node_id, perf_metrics_name): values}
51 performance_data = None # type: Dict[Tuple[str, str], TimeSeries]
52
53 # {(node_id, perf_metrics_name): values}
54 sensors_data = None # type: Dict[Tuple[str, str, str], SensorInfo]