Skip to content
Browse files

Working towards default result execution during health computations.

  • Loading branch information...
1 parent 38b1f1d commit edb43e35dc035d469aa78f4fb718e67833716a52 Nick Gerakines committed Nov 1, 2009
Showing with 19 additions and 6 deletions.
  1. +6 −0 README.markdown
  2. +6 −0 hacking.markdown
  3. +5 −5 heman.config
  4. +2 −1 src/heman.erl
View
6 README.markdown
@@ -8,6 +8,11 @@ Heman is an application health monitoring system for application-level health. T
* Allow developers to create 'rules' that help discern overall application health.
* Create a clean, easy to read interface to describe application health.
+*What it is NOT*:
+
+ * A throttling system or framework.
+ * A nagios or cacti replacement.
+
# How does it work?
The key concept here are stats and how they affect the health score of an application. When heman is started, a number of rules are registered that tell heman how to process certain stats. An example rule could be "queuelength" under the namespace "queues" with a rule type of "replace".
@@ -22,3 +27,4 @@ Lastly, the web interface is provided to give a quick view into the health of th
* Create process and code that periodically prunes old data.
* Create event log and process health periodically into that log.
+
View
6 hacking.markdown
@@ -15,6 +15,12 @@ The stats are collected and aggregated.
The health rules are used to create a health score for a given namespace.
+### Conditions
+
+A condition is broken into 3 components: The data aggregate, the case and the results.
+
+There is an additional fourth component called the default. If none of the previous triggers are fired then this result is applied.
+
## Log
The log keeps a record of a health score at a period of time and describes why.
View
10 heman.config
@@ -1,9 +1,9 @@
[{heman, [
{rules, [
- {{<<"iplaywar">>, <<"queuelength">>}, increase},
- {{<<"iplaywar">>, <<"queueminutes">>}, larger},
- {{<<"iplaywar">>, <<"dbtimeouts">>}, increase},
- {{<<"iplaywar">>, <<"webexceptions">>}, increase},
- {{<<"iplaywar">>, <<"noident">>}, increase}
+ {{<<"iplaywar">>, <<"queuelength">>}, increase, <<"Queue Length.">>},
+ {{<<"iplaywar">>, <<"queueminutes">>}, larger, <<"Length in minutes items are in the queue.">>},
+ {{<<"iplaywar">>, <<"dbtimeouts">>}, increase, <<"Number of MongoDB timeouts.">>},
+ {{<<"iplaywar">>, <<"webexceptions">>}, increase, <<"Number of web exceptions raised.">>},
+ {{<<"iplaywar">>, <<"noident">>}, increase, <<"Number of non-existant identities requested.">>}
]}
]}].
View
3 src/heman.erl
@@ -60,7 +60,7 @@ start_phase(mnesia, _, _) ->
ok;
start_phase(populate_rules, _, _) ->
- [ heman:add_rule(Key, Rule) || {Key, Rule} <- env_key(rules, [])],
+ [ heman:rule_set(Key, Rule, DisplayName) || {Key, Rule, DisplayName} <- env_key(rules, [])],
ok.
init(_) ->
@@ -195,6 +195,7 @@ health_iter(Namespace, [Rule | Rules], Acc) ->
%% What data do you need?
%% What is the condition?
%% What is the result?
+%% What is the default result?
health_rule_iter(_, [], _, Acc) -> Acc;
health_rule_iter(Health, [Rule | Rules], Data, Acc) ->
{DRule, CRule, RRule} = Rule,

0 comments on commit edb43e3

Please sign in to comment.
Something went wrong with that request. Please try again.