MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / timePointToString

Function timePointToString

src/Interpreters/QueryMetricLog.cpp:45–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43static auto logger = getLogger("QueryMetricLog");
44
45static String timePointToString(QueryMetricLog::TimePoint time)
46{
47 /// fmtlib supports subsecond formatting in 10.0.0. We're in 9.1.0, so we need to add the milliseconds ourselves.
48 auto seconds = std::chrono::time_point_cast<std::chrono::seconds>(time);
49 auto microseconds = std::chrono::duration_cast<std::chrono::microseconds>(time - seconds).count();
50
51 return fmt::format("{:%Y.%m.%d %H:%M:%S}.{:06}", seconds, microseconds);
52}
53
54ColumnsDescription QueryMetricLogElement::getColumnsDescription()
55{

Callers 2

scheduleNextMethod · 0.85

Calls 2

formatFunction · 0.70
countMethod · 0.45

Tested by

no test coverage detected