aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/admin/admin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenserver/admin/admin.cpp')
-rw-r--r--src/zenserver/admin/admin.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/zenserver/admin/admin.cpp b/src/zenserver/admin/admin.cpp
index d4c69f41b..0b302c36e 100644
--- a/src/zenserver/admin/admin.cpp
+++ b/src/zenserver/admin/admin.cpp
@@ -204,25 +204,21 @@ HttpAdminService::HttpAdminService(GcScheduler& Scheduler,
Details = true;
}
- auto SecondsToString = [](std::chrono::seconds Secs) {
- return NiceTimeSpanMs(uint64_t(std::chrono::milliseconds(Secs).count()));
- };
-
CbObjectWriter Response;
Response << "Status"sv << (GcSchedulerStatus::kIdle == State.Status ? "Idle"sv : "Running"sv);
Response.BeginObject("Config");
{
Response << "RootDirectory" << State.Config.RootDirectory.string();
- Response << "MonitorInterval" << SecondsToString(State.Config.MonitorInterval);
- Response << "Interval" << SecondsToString(State.Config.Interval);
- Response << "MaxCacheDuration" << SecondsToString(State.Config.MaxCacheDuration);
- Response << "MaxProjectStoreDuration" << SecondsToString(State.Config.MaxProjectStoreDuration);
+ Response << "MonitorInterval" << ToTimeSpan(State.Config.MonitorInterval);
+ Response << "Interval" << ToTimeSpan(State.Config.Interval);
+ Response << "MaxCacheDuration" << ToTimeSpan(State.Config.MaxCacheDuration);
+ Response << "MaxProjectStoreDuration" << ToTimeSpan(State.Config.MaxProjectStoreDuration);
Response << "CollectSmallObjects" << State.Config.CollectSmallObjects;
Response << "Enabled" << State.Config.Enabled;
Response << "DiskReserveSize" << NiceBytes(State.Config.DiskReserveSize);
Response << "DiskSizeSoftLimit" << NiceBytes(State.Config.DiskSizeSoftLimit);
Response << "MinimumFreeDiskSpaceToAllowWrites" << NiceBytes(State.Config.MinimumFreeDiskSpaceToAllowWrites);
- Response << "LightweightInterval" << SecondsToString(State.Config.LightweightInterval);
+ Response << "LightweightInterval" << ToTimeSpan(State.Config.LightweightInterval);
}
Response.EndObject();
Response << "AreDiskWritesBlocked" << State.AreDiskWritesBlocked;
@@ -233,8 +229,8 @@ HttpAdminService::HttpAdminService(GcScheduler& Scheduler,
Response.BeginObject("FullGC");
{
- Response << "LastTime" << fmt::format("{}", State.LastFullGcTime);
- Response << "TimeToNext" << SecondsToString(State.RemainingTimeUntilFullGc);
+ Response << "LastTime" << ToDateTime(State.LastFullGcTime);
+ Response << "TimeToNext" << ToTimeSpan(State.RemainingTimeUntilFullGc);
if (State.Config.DiskSizeSoftLimit != 0)
{
Response << "SpaceToNext" << NiceBytes(State.RemainingSpaceUntilFullGC);
@@ -246,7 +242,7 @@ HttpAdminService::HttpAdminService(GcScheduler& Scheduler,
}
else
{
- Response << "LastDuration" << NiceTimeSpanMs(State.LastFullGcDuration.count());
+ Response << "LastDuration" << ToTimeSpan(State.LastFullGcDuration);
Response << "LastDiskFreed" << NiceBytes(State.LastFullGCDiff.DiskSize);
Response << "LastMemoryFreed" << NiceBytes(State.LastFullGCDiff.MemorySize);
}
@@ -254,8 +250,8 @@ HttpAdminService::HttpAdminService(GcScheduler& Scheduler,
Response.EndObject();
Response.BeginObject("LightweightGC");
{
- Response << "LastTime" << fmt::format("{}", State.LastLightweightGcTime);
- Response << "TimeToNext" << SecondsToString(State.RemainingTimeUntilLightweightGc);
+ Response << "LastTime" << ToDateTime(State.LastLightweightGcTime);
+ Response << "TimeToNext" << ToTimeSpan(State.RemainingTimeUntilLightweightGc);
if (State.LastLightweightGCV2Result)
{
@@ -264,7 +260,7 @@ HttpAdminService::HttpAdminService(GcScheduler& Scheduler,
}
else
{
- Response << "LastDuration" << NiceTimeSpanMs(State.LastLightweightGcDuration.count());
+ Response << "LastDuration" << ToTimeSpan(State.LastLightweightGcDuration);
Response << "LastDiskFreed" << NiceBytes(State.LastLightweightGCDiff.DiskSize);
Response << "LastMemoryFreed" << NiceBytes(State.LastLightweightGCDiff.MemorySize);
}