|
1 | | -from _typeshed import Incomplete |
2 | | -from typing import NamedTuple |
3 | | - |
4 | | -from psutil._common import ( |
5 | | - AF_INET6 as AF_INET6, |
6 | | - AccessDenied as AccessDenied, |
7 | | - NoSuchProcess as NoSuchProcess, |
8 | | - ZombieProcess as ZombieProcess, |
9 | | - debug as debug, |
10 | | - get_procfs_path as get_procfs_path, |
11 | | - isfile_strict as isfile_strict, |
12 | | - memoize_when_activated as memoize_when_activated, |
13 | | - sockfam_to_enum as sockfam_to_enum, |
14 | | - socktype_to_enum as socktype_to_enum, |
15 | | - usage_percent as usage_percent, |
16 | | -) |
17 | | - |
18 | | -__extra__all__: Incomplete |
19 | | -PAGE_SIZE: Incomplete |
20 | | -AF_LINK: Incomplete |
21 | | -IS_64_BIT: Incomplete |
22 | | -CONN_IDLE: str |
23 | | -CONN_BOUND: str |
24 | | -PROC_STATUSES: Incomplete |
25 | | -TCP_STATUSES: Incomplete |
26 | | -proc_info_map: Incomplete |
27 | | - |
28 | | -class scputimes(NamedTuple): |
29 | | - user: Incomplete |
30 | | - system: Incomplete |
31 | | - idle: Incomplete |
32 | | - iowait: Incomplete |
33 | | - |
34 | | -class pcputimes(NamedTuple): |
35 | | - user: Incomplete |
36 | | - system: Incomplete |
37 | | - children_user: Incomplete |
38 | | - children_system: Incomplete |
39 | | - |
40 | | -class svmem(NamedTuple): |
41 | | - total: Incomplete |
42 | | - available: Incomplete |
43 | | - percent: Incomplete |
44 | | - used: Incomplete |
45 | | - free: Incomplete |
46 | | - |
47 | | -class pmem(NamedTuple): |
48 | | - rss: Incomplete |
49 | | - vms: Incomplete |
50 | | - |
51 | | -pfullmem = pmem |
52 | | - |
53 | | -class pmmap_grouped(NamedTuple): |
54 | | - path: Incomplete |
55 | | - rss: Incomplete |
56 | | - anonymous: Incomplete |
57 | | - locked: Incomplete |
58 | | - |
59 | | -pmmap_ext: Incomplete |
60 | | - |
61 | | -def virtual_memory(): ... |
62 | | -def swap_memory(): ... |
63 | | -def cpu_times(): ... |
64 | | -def per_cpu_times(): ... |
65 | | -def cpu_count_logical(): ... |
66 | | -def cpu_count_cores(): ... |
67 | | -def cpu_stats(): ... |
68 | | - |
69 | | -disk_io_counters: Incomplete |
70 | | -disk_usage: Incomplete |
71 | | - |
72 | | -def disk_partitions(all: bool = ...): ... |
73 | | - |
74 | | -net_io_counters: Incomplete |
75 | | -net_if_addrs: Incomplete |
76 | | - |
77 | | -def net_connections(kind, _pid: int = ...): ... |
78 | | -def net_if_stats(): ... |
79 | | -def boot_time(): ... |
80 | | -def users(): ... |
81 | | -def pids(): ... |
82 | | -def pid_exists(pid): ... |
83 | | -def wrap_exceptions(fun): ... |
84 | | - |
85 | | -class Process: |
86 | | - pid: Incomplete |
87 | | - def __init__(self, pid) -> None: ... |
88 | | - def oneshot_enter(self) -> None: ... |
89 | | - def oneshot_exit(self) -> None: ... |
90 | | - def name(self): ... |
91 | | - def exe(self): ... |
92 | | - def cmdline(self): ... |
93 | | - def environ(self): ... |
94 | | - def create_time(self): ... |
95 | | - def num_threads(self): ... |
96 | | - def nice_get(self): ... |
97 | | - def nice_set(self, value): ... |
98 | | - def ppid(self): ... |
99 | | - def uids(self): ... |
100 | | - def gids(self): ... |
101 | | - def cpu_times(self): ... |
102 | | - def cpu_num(self): ... |
103 | | - def terminal(self): ... |
104 | | - def cwd(self): ... |
105 | | - def memory_info(self): ... |
106 | | - memory_full_info: Incomplete |
107 | | - def status(self): ... |
108 | | - def threads(self): ... |
109 | | - def open_files(self): ... |
110 | | - def net_connections(self, kind: str = ...): ... |
111 | | - |
112 | | - class nt_mmap_grouped(NamedTuple): |
| 1 | +import sys |
| 2 | + |
| 3 | +# sys.platform.startswith(("sunos", "solaris")): |
| 4 | +if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin": |
| 5 | + from _typeshed import Incomplete |
| 6 | + from collections.abc import Callable |
| 7 | + from typing import Final, Literal, NamedTuple, TypeVar, overload |
| 8 | + from typing_extensions import ParamSpec |
| 9 | + |
| 10 | + from psutil._common import ( |
| 11 | + AF_INET6 as AF_INET6, |
| 12 | + ENCODING as ENCODING, |
| 13 | + AccessDenied as AccessDenied, |
| 14 | + NoSuchProcess as NoSuchProcess, |
| 15 | + ZombieProcess as ZombieProcess, |
| 16 | + debug as debug, |
| 17 | + get_procfs_path as get_procfs_path, |
| 18 | + isfile_strict as isfile_strict, |
| 19 | + memoize_when_activated as memoize_when_activated, |
| 20 | + sockfam_to_enum as sockfam_to_enum, |
| 21 | + socktype_to_enum as socktype_to_enum, |
| 22 | + usage_percent as usage_percent, |
| 23 | + ) |
| 24 | + |
| 25 | + from . import _common, _psposix, _psutil_sunos |
| 26 | + |
| 27 | + _P = ParamSpec("_P") |
| 28 | + _R = TypeVar("_R") |
| 29 | + |
| 30 | + __extra__all__: Final[list[str]] |
| 31 | + PAGE_SIZE: Final[int] |
| 32 | + AF_LINK: Final[int] |
| 33 | + IS_64_BIT: Final[bool] |
| 34 | + CONN_IDLE: Final = "IDLE" |
| 35 | + CONN_BOUND: Final = "BOUND" |
| 36 | + PROC_STATUSES: Final[dict[int, str]] |
| 37 | + TCP_STATUSES: Final[dict[int, str]] |
| 38 | + proc_info_map: Final[dict[str, int]] |
| 39 | + |
| 40 | + class scputimes(NamedTuple): |
| 41 | + user: float |
| 42 | + system: float |
| 43 | + idle: float |
| 44 | + iowait: float |
| 45 | + |
| 46 | + class pcputimes(NamedTuple): |
| 47 | + user: float |
| 48 | + system: float |
| 49 | + children_user: float |
| 50 | + children_system: float |
| 51 | + |
| 52 | + class svmem(NamedTuple): |
| 53 | + total: int |
| 54 | + available: int |
| 55 | + percent: float |
| 56 | + used: int |
| 57 | + free: int |
| 58 | + |
| 59 | + class pmem(NamedTuple): |
| 60 | + rss: int |
| 61 | + vms: int |
| 62 | + |
| 63 | + pfullmem = pmem |
| 64 | + |
| 65 | + class pmmap_grouped(NamedTuple): |
113 | 66 | path: Incomplete |
114 | 67 | rss: Incomplete |
115 | | - anon: Incomplete |
| 68 | + anonymous: Incomplete |
116 | 69 | locked: Incomplete |
117 | 70 |
|
118 | | - class nt_mmap_ext(NamedTuple): |
| 71 | + class pmmap_ext(NamedTuple): |
119 | 72 | addr: Incomplete |
120 | 73 | perms: Incomplete |
121 | 74 | path: Incomplete |
122 | 75 | rss: Incomplete |
123 | | - anon: Incomplete |
| 76 | + anonymous: Incomplete |
124 | 77 | locked: Incomplete |
125 | 78 |
|
126 | | - def memory_maps(self): ... |
127 | | - def num_fds(self): ... |
128 | | - def num_ctx_switches(self): ... |
129 | | - def wait(self, timeout: Incomplete | None = ...): ... |
| 79 | + def virtual_memory() -> svmem: ... |
| 80 | + def swap_memory() -> _common.sswap: ... |
| 81 | + def cpu_times() -> scputimes: ... |
| 82 | + def per_cpu_times() -> list[scputimes]: ... |
| 83 | + def cpu_count_logical() -> int | None: ... |
| 84 | + def cpu_count_cores() -> int | None: ... |
| 85 | + def cpu_stats() -> _common.scpustats: ... |
| 86 | + |
| 87 | + disk_io_counters = _psutil_sunos.disk_io_counters |
| 88 | + disk_usage = _psposix.disk_usage |
| 89 | + |
| 90 | + def disk_partitions(all: bool = False) -> list[_common.sdiskpart]: ... |
| 91 | + |
| 92 | + net_io_counters = _psutil_sunos.net_io_counters |
| 93 | + net_if_addrs = _psutil_sunos.net_if_addrs |
| 94 | + |
| 95 | + @overload |
| 96 | + def net_connections(kind: str, _pid: Literal[-1] = -1) -> list[_common.sconn]: ... |
| 97 | + @overload |
| 98 | + def net_connections(kind: str, _pid: int = -1) -> list[_common.pconn]: ... |
| 99 | + def net_if_stats() -> dict[str, _common.snicstats]: ... |
| 100 | + def boot_time() -> float: ... |
| 101 | + def users() -> list[_common.suser]: ... |
| 102 | + def pids() -> list[int]: ... |
| 103 | + def pid_exists(pid: int) -> bool: ... |
| 104 | + def wrap_exceptions(fun: Callable[_P, _R]) -> Callable[_P, _R]: ... |
| 105 | + |
| 106 | + class Process: |
| 107 | + __slots__ = ["_cache", "_name", "_ppid", "_procfs_path", "pid"] |
| 108 | + pid: int |
| 109 | + def __init__(self, pid: int) -> None: ... |
| 110 | + def oneshot_enter(self) -> None: ... |
| 111 | + def oneshot_exit(self) -> None: ... |
| 112 | + def name(self) -> str: ... |
| 113 | + def exe(self) -> str: ... |
| 114 | + def cmdline(self) -> list[str] | None: ... |
| 115 | + def environ(self) -> dict[str, str]: ... |
| 116 | + def create_time(self) -> float: ... |
| 117 | + def num_threads(self) -> int: ... |
| 118 | + def nice_get(self) -> int: ... |
| 119 | + def nice_set(self, value: int) -> None: ... |
| 120 | + def ppid(self) -> int: ... |
| 121 | + def uids(self) -> _common.puids: ... |
| 122 | + def gids(self) -> _common.puids: ... |
| 123 | + def cpu_times(self) -> _common.pcputimes: ... |
| 124 | + def cpu_num(self) -> int: ... |
| 125 | + def terminal(self) -> str | None: ... |
| 126 | + def cwd(self) -> str: ... |
| 127 | + def memory_info(self) -> pmem: ... |
| 128 | + memory_full_info = memory_info |
| 129 | + def status(self) -> str: ... |
| 130 | + def threads(self) -> list[_common.pthread]: ... |
| 131 | + def open_files(self) -> list[_common.popenfile]: ... |
| 132 | + def net_connections(self, kind: str = "inet") -> list[_common.pconn]: ... |
| 133 | + |
| 134 | + class nt_mmap_grouped(NamedTuple): |
| 135 | + path: Incomplete |
| 136 | + rss: Incomplete |
| 137 | + anon: Incomplete |
| 138 | + locked: Incomplete |
| 139 | + |
| 140 | + class nt_mmap_ext(NamedTuple): |
| 141 | + addr: Incomplete |
| 142 | + perms: Incomplete |
| 143 | + path: Incomplete |
| 144 | + rss: Incomplete |
| 145 | + anon: Incomplete |
| 146 | + locked: Incomplete |
| 147 | + |
| 148 | + def memory_maps(self) -> list[tuple[str, str, str, int, int, int]]: ... |
| 149 | + def num_fds(self) -> int: ... |
| 150 | + def num_ctx_switches(self) -> _common.pctxsw: ... |
| 151 | + def wait(self, timeout: float | None = None): ... |
0 commit comments