Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
process_usage.h
1#ifndef SOURCEMETA_CORE_PROCESS_USAGE_H_
2#define SOURCEMETA_CORE_PROCESS_USAGE_H_
3
4#ifndef SOURCEMETA_CORE_PROCESS_EXPORT
5#include <sourcemeta/core/process_export.h>
6#endif
7
8#include <chrono> // std::chrono::nanoseconds, std::chrono::system_clock
9#include <cstdint> // std::uint64_t
10#include <optional> // std::optional
11
12namespace sourcemeta::core {
13
22 std::optional<std::chrono::nanoseconds> cpu_time{std::nullopt};
24 std::optional<std::uint64_t> resident_bytes{std::nullopt};
26 std::optional<std::uint64_t> virtual_bytes{std::nullopt};
27};
28
37 std::optional<std::uint64_t> open{std::nullopt};
39 std::optional<std::uint64_t> maximum{std::nullopt};
40};
41
54SOURCEMETA_CORE_PROCESS_EXPORT
55auto process_usage() noexcept -> ProcessUsage;
56
69SOURCEMETA_CORE_PROCESS_EXPORT
71
85SOURCEMETA_CORE_PROCESS_EXPORT
86auto process_start_time() noexcept
87 -> std::optional<std::chrono::system_clock::time_point>;
88
89} // namespace sourcemeta::core
90
91#endif
std::optional< std::chrono::nanoseconds > cpu_time
Combined user and system processor time.
Definition process_usage.h:22
std::optional< std::uint64_t > maximum
The ceiling the platform enforces, where there is one and it is finite.
Definition process_usage.h:39
std::optional< std::uint64_t > open
Open file descriptors, or open handles on platforms that count those.
Definition process_usage.h:37
std::optional< std::uint64_t > resident_bytes
Physical memory currently held, in bytes.
Definition process_usage.h:24
std::optional< std::uint64_t > virtual_bytes
Address space currently mapped, in bytes.
Definition process_usage.h:26
SOURCEMETA_CORE_PROCESS_EXPORT auto process_usage() noexcept -> ProcessUsage
SOURCEMETA_CORE_PROCESS_EXPORT auto process_descriptors() noexcept -> ProcessDescriptors
SOURCEMETA_CORE_PROCESS_EXPORT auto process_start_time() noexcept -> std::optional< std::chrono::system_clock::time_point >
Definition process_usage.h:35
Definition process_usage.h:20