{
    return std::chrono::duration_cast<std::chrono::milliseconds>(timepoint.time_since_epoch()).count();
}
inline UInt64 time_in_microseconds(std::chrono::time_point<std::chrono::system_clock> timepoint)
{
    return std::chrono::duration_cast<std::chrono::microseconds>(timepoint.time_since_epoch()).count();
}
inline UInt64 time_in_seconds(std::chrono::time_point<std::chrono::system_clock> timepoint)
{
    return std::chrono::duration_cast<std::chrono::seconds>(timepoint.time_since_epoch()).count();
}
void AsynchronousMetricLog::addValues(const AsynchronousMetricValues & values)
{
    AsynchronousMetricLogElement element;
    const auto now = std::chrono::system_clock::now();
    element.event_time = time_in_seconds(now);
    element.event_time_microseconds = time_in_microseconds(now);
    element.event_date = DateLUT::instance().toDayNum(element.event_time);
    for (const auto & [key, value] : values)
    {
        element.metric_name = key;
        element.value = value;
        add(element);
    }
}
}