summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHÃ¥kon Hallingstad <hakon@verizonmedia.com>2020-06-13 10:48:18 +0200
committerGitHub <noreply@github.com>2020-06-13 10:48:18 +0200
commit9b2ebf004a4c57090bd4d55ed4c660443a7fa446 (patch)
tree512f27ed913e9861e08483790904767b6145e251
parent7f764705e58d8ee99fd2e952b97e362e184a51de (diff)
parent511e2c6059b024f9e7f8aeb3f819723b4ade8799 (diff)
Merge pull request #13575 from vespa-engine/jonmv/log-server-handler-fix
Fix date
-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 + "'");
}