working with template based notigen

This commit is contained in:
Sandy Walsh 2014-08-14 20:49:06 +00:00
parent 402cb38c64
commit ff367dfcc7
2 changed files with 23 additions and 8 deletions

View File

@ -12,20 +12,35 @@ class Callback(pipeline_callback.PipelineCallback):
class Config(oahu.config.Config):
def get_driver(self, callback=None):
inactive = criteria.Inactive(60)
trigger_name = "request-id" # Has to be consistent across yagi workers.
if not callback:
self.callback = Callback()
else:
self.callback = callback
by_request = trigger_definition.TriggerDefinition(trigger_name,
["request_id", ],
inactive,
self.callback)
triggers = [by_request, ]
# Trigger names have to be consistent across all workers
# (yagi and daemons).
by_request = trigger_definition.TriggerDefinition("request-id",
["_context_request_id", ],
criteria.Inactive(60),
self.callback)
# This trigger requires a Trait called "when_date" which is
# the date-only portion of the "when" trait. We will create
# streams based on uuid for a given day. The distiller will
# create this trait for us.
instance_usage = trigger_definition.TriggerDefinition("instance_id",
["payload/instance_id", "audit_bucket"],
criteria.EndOfDayExists(
'compute.instance.exists'),
self.callback)
triggers = [by_request, instance_usage]
return driver.MongoDBDriver(triggers)
def get_distiller_config(self):
return ""
def get_ready_chunk_size(self):
return 100

View File

@ -1,7 +1,7 @@
sessionname tach
hardstatus alwayslastline '%{= .} %-Lw%{= .}%> %n%f %t*%{= .}%+Lw%< %-=%{g}(%{d}%H/%l%{g})'
screen -t gen bash
stuff "cd git/notigen/bin; python event_pump.py\r"
stuff "cd git/notigen/bin; python event_pump.py ../templates 60\r"
screen -t yagi1 bash
stuff "cd git/yagi/bin; ./yagi-event --config ../../../shoebox.conf\r"
screen -t yagi2 bash