The goal of the Photizo Testing and Alert System is to have a plugin architecture whereby arbitrary tests may be added and configured; data passed to these tests; and results returned and recorded from these tests. This documents discusses the requirement and design decisions related to this section of Photizo.
Since the tests can be pretty much anything (see below), the best solution is probably to pass the entire list of readings to the test. Since Python is implicitly pass-by-reference, this will incur no more overhead than passing a four byte integer (or eight byte on 64 bit systems).
The configuration for a test can also be passed in. In the Photizo configuration file, parameters for the test will be added in a section for defining tests. These parameters will be passed to the test as a standard dict. This way, things such as date-range/temperature tests can be generalized, and not hard coded.
The test can be anything that Python can do. Possibilities include:
Output will be GREEN, YELLOW, or RED (probably enums), along with a message describing the possible error condition.
The results from the tests will need to be stored. Elements needing to be stored:
Results will be derived from these, and will be displayed on a dash-board like layout, with drill-down for further analyzing test failures. (:notoc:)
