@@ -382,7 +382,7 @@ updates. Consider the following :py:func:`preallocate` function:
382
382
'page': page }
383
383
# Get monthly metadata
384
384
monthly_metadata = {
385
- 'date': daily_m['d '].replace(day=1),
385
+ 'date': daily_metadata['date '].replace(day=1),
386
386
'site': site,
387
387
'page': page }
388
388
@@ -432,7 +432,7 @@ probability," you can limit redundant :py:func:`preallocate` calls.
432
432
433
433
def log_hit(db, dt_utc, site, page):
434
434
if random.random() < prob_preallocate:
435
- preallocate(db, dt_utc + timedelta(days=1), site_page )
435
+ preallocate(db, dt_utc + timedelta(days=1), site, page )
436
436
# Update daily stats doc
437
437
...
438
438
@@ -458,7 +458,7 @@ resource (i.e. ``/index.html``) with minute-level granularity:
458
458
459
459
.. code-block:: pycon
460
460
461
- >>>`` db.stats.daily.find_one(
461
+ >>> db.stats.daily.find_one(
462
462
... {'metadata': {'date':dt, 'site':'site-1', 'page':'/index.html'}},
463
463
... { 'minute': 1 })
464
464
@@ -469,7 +469,7 @@ over the last day, with hour-level granularity:
469
469
470
470
>>> db.stats.daily.find_one(
471
471
... {'metadata': {'date':dt, 'site':'site-1', 'page':'/foo.gif'}},
472
- ... { 'hy ': 1 })
472
+ ... { 'hourly ': 1 })
473
473
474
474
If you want a few days of hourly data, you can use a query in the
475
475
following form:
0 commit comments