Skip to content

Instantly share code, notes, and snippets.

@autre
Created February 10, 2012 14:38
Show Gist options
  • Save autre/1789947 to your computer and use it in GitHub Desktop.
Save autre/1789947 to your computer and use it in GitHub Desktop.
# Report the sum of read bytes from the users
# of tenant ntua every 10 minutes, if the reads
# have come from the object service and the #bytes
# read are larger than 1000.
#
# The aggregation result will be queued under topic 'foo'
rule 'sum-over-ntua'
topic 'foo'
when
e.tenant = 'ntua',
e.producer = 'object_service',
e.bytes >= 1000,
then
sum e.read every 10 min
# for each user in the cloud, report
# the amount of bytes read
rule 'read-per-user-consumption'
topic 'reads'
when
e.type = 'read-event',
e.producer = 'object-service'
then
forall user = e.user
send user, sum e.read every 10 min
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment