32#include <system_error>
98 [[nodiscard]]
const T &
value() const & {
148 [[nodiscard]] std::error_code
error() &&
noexcept {
245 std::vector<Storage_read_write_counters>
devices;
330 std::vector<Cpu_extended_times>
cpus;
422 std::vector<Thread_extended_cpu_times>
threads;
Result of collecting one system information capability.
Definition: system_info.h:51
static System_result unavailable()
Definition: system_info.h:70
const T & value() const &
Access the available value.
Definition: system_info.h:98
std::optional< T > m_value
Definition: system_info.h:164
System_result()=default
Construct an unavailable result.
bool has_value() const noexcept
Definition: system_info.h:89
T value() &&
Move the value out of an available temporary result.
Definition: system_info.h:118
Result_state m_state
Definition: system_info.h:166
Result_state state() const noexcept
Definition: system_info.h:86
T & value() &
Access the available value.
Definition: system_info.h:108
std::error_code m_error
Definition: system_info.h:165
std::error_code error() &&noexcept
Move the error out of a failed temporary result.
Definition: system_info.h:148
const std::error_code & error() const &noexcept
Access the collection error.
Definition: system_info.h:138
std::error_code error() const &&noexcept
Copy the error out of a failed const temporary result.
Definition: system_info.h:158
static System_result success(T value)
Construct an available result.
Definition: system_info.h:62
T value() const &&
Copy the value out of an available const temporary result.
Definition: system_info.h:128
static System_result failure(std::error_code error)
Construct a failed result.
Definition: system_info.h:78
#define T
Definition: jit_executor_value.cc:373
static char * path
Definition: mysqldump.cc:153
std::chrono::milliseconds milliseconds
Definition: authorize_manager.cc:70
Definition: system_info_linux.cc:46
Host_cpu_snapshot query_host_cpu()
Definition: system_info.cc:306
Thread_state
Portable execution state of a process thread.
Definition: system_info.h:370
Filesystem_snapshot query_filesystem(std::string_view path)
Collect identity and usage for the filesystem containing a path.
Definition: system_info.cc:141
Process_threads_snapshot query_process_threads()
Definition: system_info.cc:388
Result_state
State of one system information capability.
Definition: system_info.h:39
Storage_device_kind
Kind of storage device represented by an inventory entry.
Definition: system_info.h:190
Storage_snapshot query_storage_devices()
Definition: system_info.cc:247
Host_memory_snapshot query_host_memory()
Definition: system_info.cc:272
Process_memory_snapshot query_process_memory()
Definition: system_info.cc:323
noexcept
The return type for any call_and_catch(f, args...) call where f(args...) returns Type.
Definition: call_and_catch.h:76
struct result result
Definition: result.h:34
Extended CPU times collected at one collection point.
Definition: system_info.h:329
std::vector< Cpu_extended_times > cpus
Definition: system_info.h:330
Optional cumulative CPU times without portable equivalents.
Definition: system_info.h:318
std::chrono::milliseconds guest_nice
Definition: system_info.h:325
std::chrono::milliseconds irq
Definition: system_info.h:321
std::chrono::milliseconds soft_irq
Definition: system_info.h:322
std::chrono::milliseconds io_wait
Definition: system_info.h:320
std::chrono::milliseconds guest
Definition: system_info.h:324
std::chrono::milliseconds steal
Definition: system_info.h:323
std::string cpu
Definition: system_info.h:319
Portable CPU times collected at one collection point.
Definition: system_info.h:313
std::vector< Cpu_times > cpus
Definition: system_info.h:314
Portable cumulative CPU times for one aggregate or logical CPU.
Definition: system_info.h:304
std::chrono::milliseconds nice
Definition: system_info.h:307
std::chrono::milliseconds idle
Definition: system_info.h:309
std::chrono::milliseconds user
Definition: system_info.h:306
std::chrono::milliseconds system
Definition: system_info.h:308
std::string cpu
Definition: system_info.h:305
Stable identity of the filesystem that contains a monitored path.
Definition: system_info.h:170
std::string mount_point
Definition: system_info.h:172
std::string filesystem_id
Definition: system_info.h:171
std::string mount_source
Definition: system_info.h:173
std::string filesystem_type
Definition: system_info.h:174
Filesystem identity and usage collected for one monitored path.
Definition: system_info.h:184
System_result< Filesystem_usage > usage
Definition: system_info.h:186
System_result< Filesystem_identity > identity
Definition: system_info.h:185
Capacity and space available to unprivileged processes, in bytes.
Definition: system_info.h:178
uint64_t capacity_bytes
Definition: system_info.h:179
uint64_t available_bytes
Definition: system_info.h:180
Host CPU capabilities collected at one collection point.
Definition: system_info.h:334
System_result< Cpu_extended_snapshot > extended_times
Definition: system_info.h:336
System_result< Cpu_times_snapshot > times
Definition: system_info.h:335
Optional host memory breakdown values, in bytes.
Definition: system_info.h:277
uint64_t cache_bytes
Definition: system_info.h:279
uint64_t slab_bytes
Definition: system_info.h:280
uint64_t buffer_bytes
Definition: system_info.h:278
Portable host physical memory values, in bytes.
Definition: system_info.h:270
uint64_t free_bytes
Definition: system_info.h:272
uint64_t total_bytes
Definition: system_info.h:271
uint64_t available_bytes
Definition: system_info.h:273
Host memory capabilities collected at one collection point.
Definition: system_info.h:296
System_result< Swap_capacity_info > swap_capacity
Definition: system_info.h:299
System_result< Host_memory_breakdown > breakdown
Definition: system_info.h:298
System_result< Swap_activity_info > swap_activity
Definition: system_info.h:300
System_result< Host_memory_info > memory
Definition: system_info.h:297
Identity of the current process.
Definition: system_info.h:340
uint64_t pid
Definition: system_info.h:341
std::string name
Definition: system_info.h:342
Optional memory details of the current process, in bytes.
Definition: system_info.h:351
uint64_t swap_bytes
Definition: system_info.h:353
uint64_t data_bytes
Definition: system_info.h:352
Resident memory of the current process, in bytes.
Definition: system_info.h:346
uint64_t resident_bytes
Definition: system_info.h:347
Process memory capabilities collected at one collection point.
Definition: system_info.h:362
System_result< Process_memory_residency > residency
Definition: system_info.h:364
System_result< Process_identity > identity
Definition: system_info.h:363
System_result< Process_memory_details > details
Definition: system_info.h:365
System_result< Process_page_faults > page_faults
Definition: system_info.h:366
Cumulative major page faults of the current process.
Definition: system_info.h:357
uint64_t major_faults
Definition: system_info.h:358
Process-wide runtime values for the current process.
Definition: system_info.h:392
uint64_t resident_bytes
Definition: system_info.h:395
uint32_t thread_count
Definition: system_info.h:393
uint64_t virtual_bytes
Definition: system_info.h:394
uint64_t resident_limit_bytes
Definition: system_info.h:396
Process thread capabilities collected at one collection point.
Definition: system_info.h:450
System_result< Thread_scheduler_snapshot > scheduler
Definition: system_info.h:456
System_result< Thread_extended_cpu_snapshot > extended_cpu
Definition: system_info.h:455
System_result< Thread_io_snapshot > io
Definition: system_info.h:457
System_result< Process_identity > identity
Definition: system_info.h:451
System_result< Thread_cpu_snapshot > cpu
Definition: system_info.h:454
System_result< Process_runtime_info > runtime
Definition: system_info.h:453
System_result< Thread_inventory > threads
Definition: system_info.h:452
Storage device capacities collected at one collection point.
Definition: system_info.h:217
std::vector< Storage_device_capacity > devices
Definition: system_info.h:218
Capacity and hardware sector size of one storage device, in bytes.
Definition: system_info.h:210
std::string device
Definition: system_info.h:211
uint64_t capacity_bytes
Definition: system_info.h:212
uint64_t sector_size_bytes
Definition: system_info.h:213
Child and parent relationship between two storage devices.
Definition: system_info.h:222
std::string parent_device
Definition: system_info.h:224
std::string device
Definition: system_info.h:223
Identity and kind of one storage device.
Definition: system_info.h:199
std::string name
Definition: system_info.h:200
Storage_device_kind kind
Definition: system_info.h:201
Cumulative flush counters for one storage device.
Definition: system_info.h:249
uint64_t flush_count
Definition: system_info.h:251
std::chrono::milliseconds flush_time
Definition: system_info.h:252
std::string device
Definition: system_info.h:250
Storage flush counters collected at one collection point.
Definition: system_info.h:256
std::vector< Storage_flush_counters > devices
Definition: system_info.h:257
Storage device relationships collected at one collection point.
Definition: system_info.h:228
std::vector< Storage_device_relationship > relationships
Definition: system_info.h:229
Storage devices visible at one collection point.
Definition: system_info.h:205
std::vector< Storage_device > devices
Definition: system_info.h:206
Cumulative read and write counters for one storage device.
Definition: system_info.h:233
uint64_t read_count
Definition: system_info.h:235
uint64_t write_bytes
Definition: system_info.h:239
std::chrono::milliseconds write_time
Definition: system_info.h:240
uint64_t write_count
Definition: system_info.h:238
uint64_t read_bytes
Definition: system_info.h:236
std::string device
Definition: system_info.h:234
std::chrono::milliseconds read_time
Definition: system_info.h:237
Storage read and write counters collected at one collection point.
Definition: system_info.h:244
std::vector< Storage_read_write_counters > devices
Definition: system_info.h:245
Storage capabilities collected at one collection point.
Definition: system_info.h:261
System_result< Storage_read_write_snapshot > read_write
Definition: system_info.h:265
System_result< Storage_hierarchy > hierarchy
Definition: system_info.h:264
System_result< Storage_inventory > inventory
Definition: system_info.h:262
System_result< Storage_capacities > capacities
Definition: system_info.h:263
System_result< Storage_flush_snapshot > flush
Definition: system_info.h:266
Cumulative host swap activity, in bytes.
Definition: system_info.h:290
uint64_t bytes_out
Definition: system_info.h:292
uint64_t bytes_in
Definition: system_info.h:291
Host swap capacity values, in bytes.
Definition: system_info.h:284
uint64_t total_bytes
Definition: system_info.h:285
uint64_t free_bytes
Definition: system_info.h:286
Portable thread CPU times collected at one collection point.
Definition: system_info.h:407
std::vector< Thread_cpu_times > threads
Definition: system_info.h:408
Portable cumulative CPU times for one process thread.
Definition: system_info.h:400
uint64_t tid
Definition: system_info.h:401
std::chrono::milliseconds system
Definition: system_info.h:403
std::chrono::milliseconds user
Definition: system_info.h:402
Extended thread CPU times collected at one collection point.
Definition: system_info.h:421
std::vector< Thread_extended_cpu_times > threads
Definition: system_info.h:422
Optional cumulative CPU times for one process thread.
Definition: system_info.h:412
std::chrono::milliseconds guest
Definition: system_info.h:416
std::chrono::milliseconds child_guest
Definition: system_info.h:417
std::chrono::milliseconds child_user
Definition: system_info.h:414
std::chrono::milliseconds child_system
Definition: system_info.h:415
uint64_t tid
Definition: system_info.h:413
Identity, name and state of one process thread.
Definition: system_info.h:380
uint64_t tid
Definition: system_info.h:381
std::string name
Definition: system_info.h:382
Thread_state state
Definition: system_info.h:383
Process threads visible at one collection point.
Definition: system_info.h:387
std::vector< Thread_identity > threads
Definition: system_info.h:388
Cumulative I/O byte counters for one process thread.
Definition: system_info.h:438
uint64_t tid
Definition: system_info.h:439
uint64_t read_bytes
Definition: system_info.h:440
uint64_t write_bytes
Definition: system_info.h:441
Thread I/O counters collected at one collection point.
Definition: system_info.h:445
std::vector< Thread_io_counters > threads
Definition: system_info.h:446
Optional scheduler values for one process thread.
Definition: system_info.h:426
std::chrono::milliseconds block_io_delay
Definition: system_info.h:429
uint32_t last_cpu
Definition: system_info.h:428
uint64_t tid
Definition: system_info.h:427
Thread scheduler values collected at one collection point.
Definition: system_info.h:433
std::vector< Thread_scheduler_info > threads
Definition: system_info.h:434