From b8ed09b1240f1a35da37fae781d16dd9d4fd847c Mon Sep 17 00:00:00 2001 From: geerk Date: Thu, 7 Feb 2013 11:48:23 +0200 Subject: [PATCH] Fix misprints --- source/use-cases/pre-aggregated-reports.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/use-cases/pre-aggregated-reports.txt b/source/use-cases/pre-aggregated-reports.txt index d041376923a..6b76750b785 100644 --- a/source/use-cases/pre-aggregated-reports.txt +++ b/source/use-cases/pre-aggregated-reports.txt @@ -382,7 +382,7 @@ updates. Consider the following :py:func:`preallocate` function: 'page': page } # Get monthly metadata monthly_metadata = { - 'date': daily_m['d'].replace(day=1), + 'date': daily_metadata['date'].replace(day=1), 'site': site, 'page': page } @@ -432,7 +432,7 @@ probability," you can limit redundant :py:func:`preallocate` calls. def log_hit(db, dt_utc, site, page): if random.random() < prob_preallocate: - preallocate(db, dt_utc + timedelta(days=1), site_page) + preallocate(db, dt_utc + timedelta(days=1), site, page) # Update daily stats doc ... @@ -458,7 +458,7 @@ resource (i.e. ``/index.html``) with minute-level granularity: .. code-block:: pycon - >>>``db.stats.daily.find_one( + >>> db.stats.daily.find_one( ... {'metadata': {'date':dt, 'site':'site-1', 'page':'/index.html'}}, ... { 'minute': 1 }) @@ -469,7 +469,7 @@ over the last day, with hour-level granularity: >>> db.stats.daily.find_one( ... {'metadata': {'date':dt, 'site':'site-1', 'page':'/foo.gif'}}, - ... { 'hy': 1 }) + ... { 'hourly': 1 }) If you want a few days of hourly data, you can use a query in the following form: