Skip to content

Commit

Permalink
update make_dummy_pageviews_for_metrics for reports
Browse files Browse the repository at this point in the history
  • Loading branch information
aaxelb committed Oct 18, 2024
1 parent b969a2c commit 0235fe3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions osf/management/commands/make_dummy_pageviews_for_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ def _generate_random_countedusage(self, n, max_age):
item_guid=ITEM_GUID,
session_id='freshen by key',
user_is_authenticated=bool(random.randint(0, 1)),
item_public=bool(random.randint(0, 1)),
action_labels=[['view', 'download'][random.randint(0, 1)]],
)

def _run_date_query(self, time_range_filter):
Expand Down Expand Up @@ -103,8 +105,8 @@ def _run_date_query(self, time_range_filter):
},
})
return {
'min': result.aggs['min-timestamp'].value_as_string,
'max': result.aggs['max-timestamp'].value_as_string,
'min': result.aggs['min-timestamp'].value,
'max': result.aggs['max-timestamp'].value,
**{
str(bucket.key.date()): bucket.doc_count
for bucket in result.aggs['by-date']
Expand Down

0 comments on commit 0235fe3

Please sign in to comment.