Adding new expectation (Regex) and creating unit tests.

This commit is contained in:
Mitsuo Takaki
2016-04-29 08:48:53 -07:00
parent 2f3106da60
commit c5520450ba
8 changed files with 167 additions and 7 deletions

View File

@@ -7,14 +7,21 @@ import time
class Agent(object):
"""Monitor agent that will be constantly verifying if the URL is healthy
and updating the component.
"""
def __init__(self, configuration):
self.configuration = configuration
def execute(self):
"""Will verify the API status and push the status and metrics to the
cachet server.
"""
self.configuration.evaluate()
self.configuration.push_status_and_metrics()
def start(self):
"""Sets up the schedule based on the configuration file."""
schedule.every(self.configuration.data['frequency']).seconds.do(self.execute)