11#pragma GCC diagnostic ignored "-Wunused-result"
22 int bfd = bfd_str ? (int)
std::stoul(bfd_str) : -1;
23 if (bfd >= 0 && (fcntl(bfd, F_GETFD) == -1 || errno == EBADF)) {
27 }
catch (std::exception
const& e) {
28 std::string inner_msg = e.what();
34template <
typename T,
typename Enable =
void>
struct TypeTraits;
36template <
typename T>
struct TypeTraits<T, typename
std::enable_if<std::is_arithmetic<T>::value>::type> {
67 strftime(
buf,
sizeof(
buf),
"%Y-%m-%dT%H:%M:%SZ", now_tm);
68 return std::string(
buf);
73 std::ostringstream oss;
83template <
typename K,
typename V,
typename... Args>
90template <
typename T,
typename... Args>
void write_benchmark(
const std::string& name,
const T&
value, Args... args)
95 std::ostringstream oss;
97 <<
"\"eventName\": \"" << name <<
"\", "
99 <<
"\"value\": " <<
value <<
", "
105 const std::string& tmp = oss.str();
106 write((
int)bfd, tmp.c_str(), tmp.size());
std::string toString(const T &value)
std::string getCurrentTimestamp()
void write_benchmark(const std::string &name, const T &value, Args... args)
void appendToStream(std::ostringstream &)
uint32_t env_hardware_concurrency()
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
void throw_or_abort(std::string const &err)