blob: c4b387b452be04ff65e3f0e094b88e3c636b48f6 [file] [log] [blame]
koder aka kdanilov22d134e2016-11-08 11:33:19 +02001import os
2from typing import NamedTuple, TypeVar, Callable, Any, Optional, List, Iterable, Dict, Tuple
3
4SensorInfo = NamedTuple("SensorInfo", [('value', int), ('is_accumulated', bool)])
5Pid = TypeVar('Pid', str)
6AnyFunc = TypeVar('AnyFunc', Callable[..., Any])
7PrefixList = Optional[List[str]]
8SensorDict = Dict[str, SensorInfo]
9
10def provides(name: str) -> Callable[[AnyFunc], AnyFunc]: ...
11def is_dev_accepted(name, disallowed_prefixes: PrefixList, allowed_prefixes: PrefixList) -> bool: ...
12def get_pid_name(pid: Pid) -> str: ...
13def delta(func, only_upd: bool = True) -> Iterable[Optional[str], Optional[Dict[str, str]]]: ...
14def get_latency(stat1: SensorDict, stat2: SensorDict) -> SensorDict: ...
15def pid_stat(pid: Pid) -> float: ...
16def get_mem_stats(pid : Pid) -> Tuple[int, int]: ...
17def get_ram_size() -> str: ...
18
19def io_stat(disallowed_prefixes: PrefixList, allowed_prefixes: PrefixList) -> SensorDict: ...
20def net_stat(disallowed_prefixes: PrefixList, allowed_prefixes: PrefixList) -> SensorDict: ...
21def pscpu_stat(disallowed_prefixes: PrefixList, allowed_prefixes: PrefixList) -> SensorDict: ...
22def psram_stat(disallowed_prefixes: PrefixList, allowed_prefixes: PrefixList) -> SensorDict: ...
23def syscpu_stat(disallowed_prefixes: PrefixList, allowed_prefixes: PrefixList) -> SensorDict: ...
24def sysram_stat(disallowed_prefixes: PrefixList, allowed_prefixes: PrefixList) -> SensorDict: ...