]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8798 fix date histogram bounds
authorDaniel Schwarz <daniel.schwarz@sonarsource.com>
Fri, 28 Jul 2017 08:11:34 +0000 (10:11 +0200)
committerDaniel Schwarz <bartfastiel@users.noreply.github.com>
Wed, 9 Aug 2017 13:09:54 +0000 (15:09 +0200)
it seems to internally use UTC

server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java

index 75a172984e1046c8fc960809a54b5f37e4985c70..6172308b6c7c4644510e5a376d44d5d31654d96c 100644 (file)
@@ -542,7 +542,7 @@ public class IssueIndex {
       .timeZone(DateTimeZone.forTimeZone(TimeZone.getTimeZone("GMT")))
       .offset(offsetInSeconds + "s")
       // ES dateHistogram bounds are inclusive while createdBefore parameter is exclusive
-      .extendedBounds(new ExtendedBounds(startTime, endTime - 1_000L));
+      .extendedBounds(new ExtendedBounds(startTime, endTime - (offsetInSeconds*1_000L) -1L));
     dateHistogram = addEffortAggregationIfNeeded(query, dateHistogram);
     return Optional.of(dateHistogram);
   }