Commit b79b3435 authored by Mark Harding's avatar Mark Harding

(fix): ensure the date histogram is for the entire period

1 merge request!368WIP: Epic/pro affiliate launch
Pipeline #89281892 passed with stages
in 12 minutes and 2 seconds
......@@ -142,7 +142,11 @@ abstract class AbstractEarningsMetric extends AbstractMetric
'date_histogram' => [
'field' => '@timestamp',
'interval' => $timespan->getInterval(),
'min_doc_count' => 1,
'min_doc_count' => 0,
'extended_bounds' => [
'min' => $timespan->getFromTsMs(),
'max' => time() * 1000,
],
],
'aggs' => [
'2' => [
......
......@@ -139,7 +139,11 @@ class PageviewsMetric extends AbstractMetric
'date_histogram' => [
'field' => '@timestamp',
'interval' => $timespan->getInterval(),
'min_doc_count' => 1,
'min_doc_count' => 0,
'extended_bounds' => [
'min' => $timespan->getFromTsMs(),
'max' => time() * 1000,
],
],
'aggs' => [
'2' => [
......
......@@ -149,12 +149,17 @@ class ViewsMetric extends AbstractMetric
'date_histogram' => [
'field' => '@timestamp',
'interval' => $timespan->getInterval(),
'min_doc_count' => 1,
'min_doc_count' => 0,
'extended_bounds' => [
'min' => $timespan->getFromTsMs(),
'max' => time() * 1000,
],
],
'aggs' => [
'2' => [
'sum' => [
'field' => $field,
//'min_doc_count' => 0,
],
],
],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment