MCPcopy Create free account
hub / github.com/MITK/MITK / GetUptimeSeconds

Method GetUptimeSeconds

Modules/RESTAPI/src/mitkRestServer.cpp:580–591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578}
579
580std::optional<int64_t> RestServer::GetUptimeSeconds() const
581{
582 std::lock_guard<std::mutex> lock(m_Mutex);
583 if (!m_Running || !m_StartTime.has_value())
584 {
585 return std::nullopt;
586 }
587
588 auto now = std::chrono::steady_clock::now();
589 auto duration = std::chrono::duration_cast<std::chrono::seconds>(now - m_StartTime.value());
590 return duration.count();
591}
592
593void RestServer::RecordRequest(const std::string& endpoint, const std::string& method,
594 int responseCode, const std::string& clientIP)

Callers 2

StartMethod · 0.95
UpdateServerStatusMethod · 0.80

Calls 2

countMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected