alarmageddon package¶
Subpackages¶
- alarmageddon.publishing package
- Submodules
- alarmageddon.publishing.emailer module
- alarmageddon.publishing.exceptions module
- alarmageddon.publishing.graphite module
- alarmageddon.publishing.hipchat module
- alarmageddon.publishing.http module
- alarmageddon.publishing.pagerduty module
- alarmageddon.publishing.publisher module
- Module contents
- alarmageddon.validations package
- Submodules
- alarmageddon.validations.kafka module
- alarmageddon.validations.cassandra module
- alarmageddon.validations.graphite module
- alarmageddon.validations.graphite_expectations module
- alarmageddon.validations.http module
- alarmageddon.validations.http_expectations module
- alarmageddon.validations.json_expectations module
- alarmageddon.validations.rabbitmq module
- alarmageddon.validations.ssh module
- Module contents
Submodules¶
alarmageddon.config module¶
Configuration object used by Alarmageddon
-
class
alarmageddon.config.
Config
(dictionary, environment_name)[source]¶ Bases:
dict
Alarmageddon configuration object.
A configuration object that both acts like a read-only dictionary and provides some methods to access application specific settings
Parameters: - dictionary – A dictionary of the form {‘env’:{config options},...}
- environment_name – The environment that this Config object belongs to
-
ENVIRONMENT_KEY
= 'environment'¶
-
static
from_file
(config_path, environment_name)[source]¶ Load a Config object from a file
An environment_name must be provided so that the resulting Config object can provide access to environment specific settings.
alarmageddon.reporter module¶
Reports test results to registered publishers.
-
class
alarmageddon.reporter.
Reporter
(publishers)[source]¶ Bases:
object
Class for collecting and sending results to publishers.
Parameters: publishers – List of Publisher
objects to send results to.
alarmageddon.result module¶
Classes that represent possible results of running a test.
-
class
alarmageddon.result.
Failure
(test_name, validation, description, time=None)[source]¶ Bases:
alarmageddon.result.TestResult
The result of a failed validation.
description is required.
-
class
alarmageddon.result.
Success
(test_name, validation, description=None, time=None)[source]¶ Bases:
alarmageddon.result.TestResult
The result of a successful validation.
-
class
alarmageddon.result.
TestResult
(test_name, validation, description=None, time=None)[source]¶ Bases:
object
Base class representing the result of performing a validation.
Contains the outcome information that Alarmageddon will publish.
Parameters: - test_name – Name of the validation this result is associated with.
- validation – The
Validation
this result is associated with. - description – Default None. A description of the outcome of the validation. If the validation failed, this field is expected to not be None.
- time – Default None. How long the validation took to perform.
alarmageddon.run module¶
Methods that support running tests
-
alarmageddon.run.
construct_publishers
(config)[source]¶ Construct the built-in publishers.
Parameters: config – Config object to construct the publishers from.
-
alarmageddon.run.
do_dry_run
(validations, publishers)[source]¶ Print which validations will be published by which publishers.
Assume all validations fail and list the messages that would have been published.
Parameters: - validations – List of
Validation
objects that Alarmageddon would perform. - publishers – List of
Publisher
objects that Alarmageddon would publish validation results to.
- validations – List of
-
alarmageddon.run.
load_config
(config_path, environment_name)[source]¶ Helper method for loading a
Config
Parameters: - config_path – Path to the JSON configuration file.
- environment_name – The config environment to run Alarmageddon in.
-
alarmageddon.run.
run_tests
(validations, publishers=None, config_path=None, environment_name=None, config=None, dry_run=False, processes=1, print_banner=True)[source]¶ Main entry point into Alarmageddon.
Run the given validations and report them to given publishers.
Either both config_path and environment_name should not be None, or config should not be None.
Parameters: - validations – List of
Validation
objects that Alarmageddon will perform. - publishers – List of
Publisher
objects that Alarmageddon will publish validation results to. - dry_run – When True, will prevent Alarmageddon from performing validations or publishing results, and instead will print which validations will be published by which publishers upon failure.
- processes – The number of worker processes to spawn. Does not run spawn additional processes if set to 1.
- print_banner – When True, print the Alarmageddon banner.
Deprecated since version 1.0.0: These parameters are no longer used: config_path, environment_name, config. Configuration happens when constructing publishers instead.
- validations – List of
Module contents¶
Alarmageddon main module