summaryrefslogtreecommitdiffstats
path: root/container-core
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2020-06-13 10:46:37 +0200
committerJon Marius Venstad <venstad@gmail.com>2020-06-13 10:46:37 +0200
commit511e2c6059b024f9e7f8aeb3f819723b4ade8799 (patch)
tree512f27ed913e9861e08483790904767b6145e251 /container-core
parent7f764705e58d8ee99fd2e952b97e362e184a51de (diff)
Fix date
Diffstat (limited to 'container-core')
-rw-r--r--container-core/src/main/java/com/yahoo/container/handler/LogReader.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/handler/LogReader.java b/container-core/src/main/java/com/yahoo/container/handler/LogReader.java
index 13c96cd3ada..09330542bea 100644
--- a/container-core/src/main/java/com/yahoo/container/handler/LogReader.java
+++ b/container-core/src/main/java/com/yahoo/container/handler/LogReader.java
@@ -19,6 +19,7 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
+import java.time.Duration;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
@@ -157,12 +158,13 @@ class LogReader {
return ZonedDateTime.of(Integer.parseInt(matcher.group(1)),
Integer.parseInt(matcher.group(2)),
Integer.parseInt(matcher.group(3)),
- Integer.parseInt(matcher.group(4)) + 1, // timestamp is start of hour range of the log file
+ Integer.parseInt(matcher.group(4)),
0,
0,
0,
ZoneId.of("UTC"))
- .toInstant();
+ .toInstant()
+ .plus(Duration.ofHours(1));
}
matcher = vespaLogPathPattern.matcher(relativePath);
if (matcher.matches()) {
@@ -174,10 +176,11 @@ class LogReader {
Integer.parseInt(matcher.group(3)),
Integer.parseInt(matcher.group(4)),
Integer.parseInt(matcher.group(5)),
- Integer.parseInt(matcher.group(6)) + 1, // timestamp is that of the last entry, truncated to second accuracy
+ Integer.parseInt(matcher.group(6)),
0,
ZoneId.of("UTC"))
- .toInstant();
+ .toInstant()
+ .plus(Duration.ofSeconds(1));
}
throw new IllegalArgumentException("Unrecognized file pattern for file at '" + path + "'");
}