Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public BucketScriptAggregationUsageTests(ReadOnlyCluster cluster, EndpointUsage
{
field = "startedOn",
interval = "month",
min_doc_count = 1
},
aggs = new
{
Expand Down Expand Up @@ -77,6 +78,7 @@ public BucketScriptAggregationUsageTests(ReadOnlyCluster cluster, EndpointUsage
.DateHistogram("projects_started_per_month", dh => dh
.Field(p => p.StartedOn)
.Interval(DateInterval.Month)
.MinimumDocumentCount(1)
.Aggregations(aa => aa
.Sum("commits", sm => sm
.Field(p => p.NumberOfCommits)
Expand Down Expand Up @@ -106,6 +108,7 @@ public BucketScriptAggregationUsageTests(ReadOnlyCluster cluster, EndpointUsage
{
Field = "startedOn",
Interval = DateInterval.Month,
MinimumDocumentCount = 1,
Aggregations =
new SumAggregation("commits", "numberOfCommits") &&
new FilterAggregation("stable_state")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public DerivativeAggregationUsageTests(ReadOnlyCluster cluster, EndpointUsage us
{
field = "startedOn",
interval = "month",
min_doc_count = 1
},
aggs = new
{
Expand All @@ -47,6 +48,7 @@ public DerivativeAggregationUsageTests(ReadOnlyCluster cluster, EndpointUsage us
.DateHistogram("projects_started_per_month", dh => dh
.Field(p => p.StartedOn)
.Interval(DateInterval.Month)
.MinimumDocumentCount(1)
.Aggregations(aa => aa
.Sum("commits", sm => sm
.Field(p => p.NumberOfCommits)
Expand All @@ -62,6 +64,7 @@ public DerivativeAggregationUsageTests(ReadOnlyCluster cluster, EndpointUsage us
{
Field = "startedOn",
Interval = DateInterval.Month,
MinimumDocumentCount = 1,
Aggregations =
new SumAggregation("commits", "numberOfCommits") &&
new DerivativeAggregation("commits_derivative", "commits")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public MovingAverageEwmaAggregationUsageTests(ReadOnlyCluster cluster, EndpointU
{
field = "startedOn",
interval = "month",
min_doc_count = 1
},
aggs = new
{
Expand Down Expand Up @@ -54,6 +55,7 @@ public MovingAverageEwmaAggregationUsageTests(ReadOnlyCluster cluster, EndpointU
.DateHistogram("projects_started_per_month", dh => dh
.Field(p => p.StartedOn)
.Interval(DateInterval.Month)
.MinimumDocumentCount(1)
.Aggregations(aa => aa
.Sum("commits", sm => sm
.Field(p => p.NumberOfCommits)
Expand All @@ -74,6 +76,7 @@ public MovingAverageEwmaAggregationUsageTests(ReadOnlyCluster cluster, EndpointU
{
Field = "startedOn",
Interval = DateInterval.Month,
MinimumDocumentCount = 1,
Aggregations =
new SumAggregation("commits", "numberOfCommits")
&& new MovingAverageAggregation("commits_moving_avg", "commits")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public MovingAverageHoltLinearAggregationUsageTests(ReadOnlyCluster cluster, End
date_histogram = new
{
field = "startedOn",
interval = "month"
interval = "month",
min_doc_count = 1
},
aggs = new
{
Expand Down Expand Up @@ -55,6 +56,7 @@ public MovingAverageHoltLinearAggregationUsageTests(ReadOnlyCluster cluster, End
.DateHistogram("projects_started_per_month", dh => dh
.Field(p => p.StartedOn)
.Interval(DateInterval.Month)
.MinimumDocumentCount(1)
.Aggregations(aa => aa
.Sum("commits", sm => sm.Field(p => p.NumberOfCommits))
.MovingAverage("commits_moving_avg", mv => mv
Expand All @@ -74,6 +76,7 @@ public MovingAverageHoltLinearAggregationUsageTests(ReadOnlyCluster cluster, End
{
Field = "startedOn",
Interval = DateInterval.Month,
MinimumDocumentCount = 1,
Aggregations =
new SumAggregation("commits", "numberOfCommits")
&& new MovingAverageAggregation("commits_moving_avg", "commits")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public MovingAverageHoltWintersUsageTests(ReadOnlyCluster cluster, EndpointUsage
date_histogram = new
{
field = "startedOn",
interval = "month"
interval = "month",
min_doc_count = 1
},
aggs = new
{
Expand Down Expand Up @@ -59,6 +60,7 @@ public MovingAverageHoltWintersUsageTests(ReadOnlyCluster cluster, EndpointUsage
.DateHistogram("projects_started_per_month", dh => dh
.Field(p => p.StartedOn)
.Interval(DateInterval.Month)
.MinimumDocumentCount(1)
.Aggregations(aa => aa
.Sum("commits", sm => sm
.Field(p => p.NumberOfCommits)
Expand All @@ -85,6 +87,7 @@ public MovingAverageHoltWintersUsageTests(ReadOnlyCluster cluster, EndpointUsage
{
Field = "startedOn",
Interval = DateInterval.Month,
MinimumDocumentCount = 1,
Aggregations =
new SumAggregation("commits", "numberOfCommits")
&& new MovingAverageAggregation("commits_moving_avg", "commits")
Expand Down Expand Up @@ -124,7 +127,7 @@ protected override void ExpectResponse(ISearchResponse<Project> response)
var movingAverage = item.MovingAverage("commits_moving_avg");

// Moving Average specifies a window of 4 so
// moving average values should exist from 5th bucketr onwards
// moving average values should exist from 5th bucket onwards
if (bucketCount <= 4)
movingAverage.Should().BeNull();
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public MovingAverageSimpleAggregationUsageTests(ReadOnlyCluster cluster, Endpoin
date_histogram = new
{
field = "startedOn",
interval = "month",
interval = "month"
},
aggs = new
{
Expand All @@ -41,6 +41,7 @@ public MovingAverageSimpleAggregationUsageTests(ReadOnlyCluster cluster, Endpoin
model = "simple",
window = 30,
predict = 10,
gap_policy = "insert_zeros",
settings = new { }
}
}
Expand All @@ -61,6 +62,7 @@ public MovingAverageSimpleAggregationUsageTests(ReadOnlyCluster cluster, Endpoin
.BucketsPath("commits")
.Window(30)
.Predict(10)
.GapPolicy(GapPolicy.InsertZeros)
.Model(m => m
.Simple()
)
Expand All @@ -79,6 +81,7 @@ public MovingAverageSimpleAggregationUsageTests(ReadOnlyCluster cluster, Endpoin
{
Window = 30,
Predict = 10,
GapPolicy = GapPolicy.InsertZeros,
Model = new SimpleModel()
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public SerialDifferencingAggregationUsageTests(ReadOnlyCluster cluster, Endpoint
date_histogram = new
{
field = "startedOn",
interval = "month"
interval = "month",
min_doc_count = 1
},
aggs = new
{
Expand Down Expand Up @@ -47,6 +48,7 @@ public SerialDifferencingAggregationUsageTests(ReadOnlyCluster cluster, Endpoint
.DateHistogram("projects_started_per_month", dh => dh
.Field(p => p.StartedOn)
.Interval(DateInterval.Month)
.MinimumDocumentCount(1)
.Aggregations(aa => aa
.Sum("commits", sm => sm
.Field(p => p.NumberOfCommits)
Expand All @@ -63,6 +65,7 @@ public SerialDifferencingAggregationUsageTests(ReadOnlyCluster cluster, Endpoint
{
Field = "startedOn",
Interval = DateInterval.Month,
MinimumDocumentCount = 1,
Aggregations =
new SumAggregation("commits", "numberOfCommits")
&& new SerialDifferencingAggregation("second_difference", "commits")
Expand Down