Support different publisher interval

Changes the agent manager to poll based on pipeline configuration, to
support different interval requirement from different publishers.

This patch clean up the test case for agent managers. It makes the changes
a bit bigger, however, it's not so easy to seprate this cleanup patch
with different interval part.

For bp publisher-counters-frequency

Change-Id: I3c1163e37de6a17261d2c570843845696ebff58f
Signed-off-by: Yunhong, Jiang <yunhong.jiang@intel.com>
This commit is contained in:
Yunhong, Jiang
2013-02-17 14:16:39 +08:00
parent d767d2c5f5
commit 9335d81316
13 changed files with 418 additions and 149 deletions

View File

@@ -64,13 +64,16 @@ class TransformerExtensionManager(extension.ExtensionManager):
return self.by_name[name]
class Publisher(object):
class PublishContext(object):
def __init__(self, pipelines, context, source):
self.pipelines = pipelines
def __init__(self, context, source, pipelines=[]):
self.pipelines = set(pipelines)
self.context = context
self.source = source
def add_pipelines(self, pipelines):
self.pipelines.update(pipelines)
def __enter__(self):
def p(counters):
for p in self.pipelines:
@@ -360,7 +363,7 @@ class PipelineManager(object):
:param context: The context.
:param source: Counter source.
"""
return Publisher(self.pipelines, context, source)
return PublishContext(context, source, self.pipelines)
def setup_pipeline(publisher_manager):