Skip to content

Instantly share code, notes, and snippets.

@mccutchen
Created June 22, 2011 18:48
Show Gist options
  • Save mccutchen/1040802 to your computer and use it in GitHub Desktop.
Save mccutchen/1040802 to your computer and use it in GitHub Desktop.
Simple App Engine mapreduce counter example
from google.appengine.ext.mapreduce import operation as op
def count_impressions_by_month(entity):
key = entity.timestamp.strftime('%Y-%m')
yield op.counters.Increment(key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment