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