From ae767fdee9b812b7521a1e8838d71d3f76dc2e27 Mon Sep 17 00:00:00 2001
From: Simon Crowle <sgc@it-innovation.soton.ac.uk>
Date: Tue, 3 Apr 2018 15:15:55 +0100
Subject: [PATCH] Adds initial documentation on configuration state modelling
 and monitoring

---
 README.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index f611cad..8948957 100644
--- a/README.md
+++ b/README.md
@@ -56,7 +56,7 @@ Testing is implemented using pytest.
 
 The installation script is here:
 
-`test/services/pytest/install.sh`
+`sudo clmctest/services/pytest/install.sh`
 
 using the following convention:
 
@@ -120,3 +120,49 @@ If pytest is not installed, an easy solution is to use the Python Package Index
 `sudo apt-get install python3-pip` 
   
 `pip3 install pytest`
+
+#### Configuration status modelling and monitoring
+
+FLAME _endpoints_ (VMs created and managed by the SFEMC) and media service _media components_ (processes that realise the execution of the media service) both undergo changes in configuration state during the lifetime of a media service's deployment. Observations of these state changes are recorded in the CLMC under named measurement sets, for example 'endpoint_config' and '\<media component name\>_config' for endpoint and media component labels respectively. In each case, all recordable states of the endpoint/media component are enumerated as columns within the measurement set (see respective state models below for details).
+
+Observation of these states will be performed by a third party - for example, a Telegraf plugin will continuously __report__ on the state of an NGINX service to the CLMC using a _fixed_ interval (say 10 seconds). During this _reporting_ period, the actual state of the NGINX service will be sampled (polled) by the plugin several times (say 10 each second). During any reporting period, the NGINX service _may_ transition from one state to another:
+
+| State observation # | State |
+| --- | --- |
+|  1 | stopped  |
+|  2 | stopped  |
+|  3 | stopped  |
+|  4 | stopped |
+|  5 | starting |
+|  6 | starting |
+|  7 | starting |
+|  8 | starting |
+|  9 | starting |
+| 10 | starting |
+
+_Above: example observations within a single reporting period of a media component configuration state_
+
+Therefore each report will include for each state:
+
+* The total time in the state for the reporting period
+* The avarage time in the state for the reporting period
+
+##### Endpoint configuration state model
+
+
+##### Media component configuration state model
+
+A media component configuration state model consists of the following states:
+
+* stopped
+* starting [transitional]
+* running
+* stopping [transitional]
+
+An example measurement row for a media component configuration states is below:
+
+| tags | stopped | avg_stopped | starting | avg_starting | running | avg_running | stopping | avg_stopping | time |
+| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
+| \<global tags...\> | 0 | 0 | 4 | 0.4 | 6 | 0.6 | 0.0 | 0.0 | 0 |
+
+In this example, the _reporting period_ is 10 seconds and with an observation rate of 1/second; the observed states were 'stopped' (4 observations) and 'starting' (6 observations).
\ No newline at end of file
-- 
GitLab