Skip to content

Commit ad1be6a

Browse files
committed
PAUSED: Use git resume to continue working. [skip ci]
1 parent 2f15564 commit ad1be6a

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

metrics_utility/automation_controller_billing/collectors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def daily_slicing(key, last_gather, **kwargs):
4949
else:
5050
from awx.conf.models import Setting
5151

52+
# FIXME: merge with collector _calculate_collection_interval?
5253
horizon = until - timedelta(days=get_max_gather_period_days())
5354
last_entries = Setting.objects.filter(key='AUTOMATION_ANALYTICS_LAST_ENTRIES').first()
5455
last_entries = json.loads((last_entries.value if last_entries is not None else '') or '{}', object_hook=datetime_hook)

metrics_utility/base/collection.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,17 @@ def slices(self):
9292
return self.fnc_slicing(self.key, last_gather, full_sync_enabled=True)
9393

9494
if self.fnc_slicing:
95+
# TODO: accepts since=None? or just never used that way?
9596
return self.fnc_slicing(self.key, last_gather, since=since, until=until)
9697

9798
# Start/end of gathering based on settings excluding slices
99+
# FIXME: merge with collector _calculate_collection_interval?
98100
last_entry = max(
99101
self.last_gathered_entry or self.collector.last_gather,
100102
self.collector.gather_until - timedelta(days=get_max_gather_period_days()),
101103
)
102104

105+
## TODO: gather_since OR last_entry is the answer to Final since-until .. except both ^returns too
103106
return [(self.collector.gather_since or last_entry, self.collector.gather_until)]
104107

105108
def ship_immediately(self):

metrics_utility/base/collector.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ def _calculate_collection_interval(self, since, until):
211211
# `until`, but we want to keep `since` empty if it wasn't passed in because we use that
212212
# case to know whether to use the bookkeeping settings variables to decide the start of
213213
# the interval.
214+
# FIXME: but we also want to log the real since...
214215
horizon = until - _timedelta
215216
if since is not None and since < horizon:
216217
since = horizon

0 commit comments

Comments
 (0)