| { |
| "metrics": { |
| "always_true": { |
| "Eval": "0 == 0" |
| }, |
| "disk_used": {"Selector": "global_data/storage:root.stats:used_bytes"}, |
| "disk_total": {"Selector": "global_data/storage:root.stats:total_bytes"}, |
| "disk_percentage": {"Eval": "(disk_used + 0.0) / disk_total"}, |
| "disk98": {"Eval": "disk_percentage > 0.98"}, |
| "actual_widgets": {"Selector": "widget_maker.cmx:root:total_widgets"}, |
| "too_many_widgets": {"Eval": "actual_widgets > product::max_widgets"} |
| }, |
| "actions": { |
| "always_triggered": { |
| "trigger": "always_true", |
| "print": "Triage is running" |
| }, |
| "disk_full": {"trigger": "disk98", "print": "Disk is over 98% full"}, |
| "widget_overflow": {"trigger": "too_many_widgets", "print": "Too many widgets!"} |
| }, |
| "tests": { |
| "is_full": {"yes": ["disk_full"], "no": [], |
| "inspect": [ |
| {"path": "global_data/storage", |
| "contents": {"root": {"stats": {"total_bytes": 100, "used_bytes": 99}}}} |
| ] |
| }, |
| "not_full": {"yes": [], "no": ["disk_full"], |
| "inspect": [ |
| {"path": "global_data/storage", |
| "contents": {"root": {"stats": {"total_bytes": 100, "used_bytes": 97}}}} |
| ] |
| } |
| } |
| } |