OGLplus  (0.59.0) a C++ wrapper for rendering APIs

eagine/uptime.cpp

Copyright Matus Chochlik. Distributed under the Boost Software License, Version 1.0. See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt

#include <eagine/main.hpp>
#include <iostream>
namespace eagine {
auto main(main_ctx& ctx) -> int {
const string_view n_a("N/A");
auto& sys = ctx.system();
ctx.log()
.stat("system stats")
.arg(
EAGINE_ID(shtLoadAvg),
EAGINE_ID(Ratio),
either_or(sys.short_average_load(), n_a))
.arg(
EAGINE_ID(lngLoadAvg),
EAGINE_ID(Ratio),
either_or(sys.long_average_load(), n_a))
.arg(EAGINE_ID(uptime), sys.uptime());
return 0;
}
} // namespace eagine
basic_string_span< const char > string_view
Alias for const string views.
Definition: string_span.hpp:116
#define EAGINE_ID(NAME)
Macro for constructing instances of eagine::identifier.
Definition: identifier.hpp:353
Common code is placed in this namespace.
Definition: eagine.hpp:21
static auto either_or(valid_if< T, P > vi, F f) noexcept(noexcept(valid_if< T, P >(std::declval< valid_if< T, P > && >())) &&noexcept(F(std::declval< F && >()))) -> valid_if_or_fallback< T, P, F >
Constructor function for valid_if_or_fallback.
Definition: decl.hpp:290

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).