-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into repository-encrypted-client-side
- Loading branch information
Showing
2,915 changed files
with
72,172 additions
and
43,551 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,8 @@ BWC_VERSION: | |
- "7.6.0" | ||
- "7.6.1" | ||
- "7.6.2" | ||
- "7.6.3" | ||
- "7.7.0" | ||
- "7.7.1" | ||
- "7.8.0" | ||
- "7.9.0" | ||
- "8.0.0" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
name: Bug | ||
about: "Report a confirmed bug. For unconfirmed bugs please | ||
visit https://discuss.elastic.co/c/elasticsearch" | ||
labels: ">bug,needs:triage" | ||
|
||
--- | ||
<!-- | ||
GitHub is reserved for bug reports and feature requests; it is not the place | ||
for general questions. If you have a question or an unconfirmed bug , please | ||
visit the [forums](https://discuss.elastic.co/c/elasticsearch). Please also | ||
check your OS is [supported](https://www.elastic.co/support/matrix#show_os). | ||
If it is not, the issue is likely to be closed. | ||
For security vulnerabilities please only send reports to security@elastic.co. | ||
See https://www.elastic.co/community/security for more information. | ||
Please fill in the following details to help us reproduce the bug: | ||
--> | ||
|
||
**Elasticsearch version** (`bin/elasticsearch --version`): | ||
|
||
**Plugins installed**: [] | ||
|
||
**JVM version** (`java -version`): | ||
|
||
**OS version** (`uname -a` if on a Unix-like system): | ||
|
||
**Description of the problem including expected versus actual behavior**: | ||
|
||
**Steps to reproduce**: | ||
|
||
Please include a *minimal* but *complete* recreation of the problem, | ||
including (e.g.) index creation, mappings, settings, query etc. The easier | ||
you make for us to reproduce it, the more likely that somebody will take the | ||
time to look at it. | ||
|
||
1. | ||
2. | ||
3. | ||
|
||
**Provide logs (if relevant)**: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
blank_issues_enabled: true | ||
contact_links: | ||
- name: Question | ||
url: https://discuss.elastic.co/c/elasticsearch | ||
about: Ask (and answer) questions here. | ||
- name: Security Vulnerability | ||
url: https://www.elastic.co/community/security | ||
about: Send security vulnerability reports to security@elastic.co. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
name: Feature Request | ||
about: Request a new feature we haven't thought of | ||
labels: ">enhancement,needs:triage" | ||
|
||
--- | ||
<!-- | ||
Please first search existing issues for the feature you are requesting; | ||
it may already exist, even as a closed issue. | ||
--> | ||
|
||
<!-- | ||
Describe the feature. | ||
Please give us as much context as possible about the feature. For example, | ||
you could include a story about a time when you wanted to use the feature, | ||
and also tell us what you had to do instead. The last part is helpful | ||
because it gives us an idea of how much harder your life is without the | ||
feature. | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
name: Test Failure | ||
about: A test failure in CI | ||
labels: ">test-failure" | ||
|
||
--- | ||
|
||
<!-- | ||
Please fill out the following information, and ensure you have attempted | ||
to reproduce locally | ||
--> | ||
|
||
**Build scan**: | ||
|
||
**Repro line**: | ||
|
||
**Reproduces locally?**: | ||
|
||
**Applicable branches**: | ||
|
||
**Failure history**: | ||
<!-- | ||
Link to build stats and possible indication of when this started failing and how often it fails | ||
<https://build-stats.elastic.co/app/kibana> | ||
--> | ||
**Failure excerpt**: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
benchmarks/src/main/java/org/elasticsearch/common/RoundingBenchmark.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.elasticsearch.common; | ||
|
||
import org.elasticsearch.common.time.DateFormatter; | ||
import org.elasticsearch.common.unit.TimeValue; | ||
import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; | ||
import org.openjdk.jmh.annotations.Benchmark; | ||
import org.openjdk.jmh.annotations.BenchmarkMode; | ||
import org.openjdk.jmh.annotations.Fork; | ||
import org.openjdk.jmh.annotations.Measurement; | ||
import org.openjdk.jmh.annotations.Mode; | ||
import org.openjdk.jmh.annotations.OutputTimeUnit; | ||
import org.openjdk.jmh.annotations.Param; | ||
import org.openjdk.jmh.annotations.Scope; | ||
import org.openjdk.jmh.annotations.Setup; | ||
import org.openjdk.jmh.annotations.State; | ||
import org.openjdk.jmh.annotations.Warmup; | ||
import org.openjdk.jmh.infra.Blackhole; | ||
|
||
import java.time.ZoneId; | ||
import java.util.concurrent.TimeUnit; | ||
import java.util.function.Supplier; | ||
|
||
@Fork(2) | ||
@Warmup(iterations = 10) | ||
@Measurement(iterations = 5) | ||
@BenchmarkMode(Mode.AverageTime) | ||
@OutputTimeUnit(TimeUnit.NANOSECONDS) | ||
@State(Scope.Benchmark) | ||
public class RoundingBenchmark { | ||
private static final DateFormatter FORMATTER = DateFormatter.forPattern("date_optional_time"); | ||
|
||
@Param({ | ||
"2000-01-01 to 2020-01-01", // A super long range | ||
"2000-10-01 to 2000-11-01", // A whole month which is pretty believable | ||
"2000-10-29 to 2000-10-30", // A date right around daylight savings time. | ||
"2000-06-01 to 2000-06-02" // A date fully in one time zone. Should be much faster than above. | ||
}) | ||
public String range; | ||
|
||
@Param({ "java time", "es" }) | ||
public String rounder; | ||
|
||
@Param({ "UTC", "America/New_York" }) | ||
public String zone; | ||
|
||
@Param({ "calendar year", "calendar hour", "10d", "5d", "1h" }) | ||
public String interval; | ||
|
||
@Param({ "1", "10000", "1000000", "100000000" }) | ||
public int count; | ||
|
||
private long min; | ||
private long max; | ||
private long[] dates; | ||
private Supplier<Rounding.Prepared> rounderBuilder; | ||
|
||
@Setup | ||
public void buildDates() { | ||
String[] r = range.split(" to "); | ||
min = FORMATTER.parseMillis(r[0]); | ||
max = FORMATTER.parseMillis(r[1]); | ||
dates = new long[count]; | ||
long date = min; | ||
long diff = (max - min) / dates.length; | ||
for (int i = 0; i < dates.length; i++) { | ||
if (date >= max) { | ||
throw new IllegalStateException("made a bad date [" + date + "]"); | ||
} | ||
dates[i] = date; | ||
date += diff; | ||
} | ||
Rounding.Builder roundingBuilder; | ||
if (interval.startsWith("calendar ")) { | ||
roundingBuilder = Rounding.builder( | ||
DateHistogramAggregationBuilder.DATE_FIELD_UNITS.get(interval.substring("calendar ".length())) | ||
); | ||
} else { | ||
roundingBuilder = Rounding.builder(TimeValue.parseTimeValue(interval, "interval")); | ||
} | ||
Rounding rounding = roundingBuilder.timeZone(ZoneId.of(zone)).build(); | ||
switch (rounder) { | ||
case "java time": | ||
rounderBuilder = rounding::prepareJavaTime; | ||
break; | ||
case "es": | ||
rounderBuilder = () -> rounding.prepare(min, max); | ||
break; | ||
default: | ||
throw new IllegalArgumentException("Expectd rounder to be [java time] or [es]"); | ||
} | ||
} | ||
|
||
@Benchmark | ||
public void round(Blackhole bh) { | ||
Rounding.Prepared rounder = rounderBuilder.get(); | ||
for (int i = 0; i < dates.length; i++) { | ||
bh.consume(rounder.round(dates[i])); | ||
} | ||
} | ||
|
||
@Benchmark | ||
public void nextRoundingValue(Blackhole bh) { | ||
Rounding.Prepared rounder = rounderBuilder.get(); | ||
for (int i = 0; i < dates.length; i++) { | ||
bh.consume(rounder.nextRoundingValue(dates[i])); | ||
} | ||
} | ||
} |
Oops, something went wrong.