X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=lib%2Flinux%2Forg.argeo.slc.systemd%2Fsrc%2Forg%2Fargeo%2Fslc%2Fsystemd%2Fdbus%2FServiceStatistics.java;fp=lib%2Flinux%2Forg.argeo.slc.systemd%2Fsrc%2Forg%2Fargeo%2Fslc%2Fsystemd%2Fdbus%2FServiceStatistics.java;h=b40ba232b769bbc058f5fb1587de80a8b0dad81c;hb=c80a557972da5941386abe3b3642531a2b9b0bb3;hp=787655e7f89481a3d6e89f6063af5c3b22d73737;hpb=40f6e26c40b3397a792d9000d1f70fb9c640a8a2;p=gpl%2Fargeo-slc.git diff --git a/lib/linux/org.argeo.slc.systemd/src/org/argeo/slc/systemd/dbus/ServiceStatistics.java b/lib/linux/org.argeo.slc.systemd/src/org/argeo/slc/systemd/dbus/ServiceStatistics.java index 787655e7f..b40ba232b 100644 --- a/lib/linux/org.argeo.slc.systemd/src/org/argeo/slc/systemd/dbus/ServiceStatistics.java +++ b/lib/linux/org.argeo.slc.systemd/src/org/argeo/slc/systemd/dbus/ServiceStatistics.java @@ -128,8 +128,10 @@ public class ServiceStatistics { while (manager != null) { synchronized (this) { - String dateSuffix = Instant.ofEpochMilli(begin).atOffset(ZoneOffset.UTC) - .format(DateTimeFormatter.ISO_LOCAL_DATE) + "-" + begin; + // We change the prefix in order to have a file per day + // but keep the begin timestamp in order to identify restarts + String dateSuffix = Instant.now().atOffset(ZoneOffset.UTC).format(DateTimeFormatter.ISO_LOCAL_DATE) + + "-" + begin; Path statisticsPath = basePath.resolve("statistics-" + unitName + "-" + dateSuffix + ".csv"); boolean writeHeader = !Files.exists(statisticsPath);