flapjack 0.7.20 → 0.7.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/.gitignore +1 -0
  2. data/.travis.yml +3 -1
  3. data/CHANGELOG.md +10 -0
  4. data/Gemfile +1 -0
  5. data/bin/flapjack +11 -0
  6. data/bin/simulate-failed-check +5 -5
  7. data/features/notification_rules.feature +77 -19
  8. data/features/steps/events_steps.rb +15 -3
  9. data/lib/flapjack/coordinator.rb +3 -3
  10. data/lib/flapjack/data/contact.rb +1 -1
  11. data/lib/flapjack/data/entity.rb +12 -1
  12. data/lib/flapjack/data/entity_check.rb +9 -2
  13. data/lib/flapjack/data/event.rb +4 -4
  14. data/lib/flapjack/data/notification.rb +27 -20
  15. data/lib/flapjack/data/notification_rule.rb +26 -24
  16. data/lib/flapjack/data/tag.rb +5 -0
  17. data/lib/flapjack/gateways/api.rb +1 -1
  18. data/lib/flapjack/gateways/api/contact_methods.rb +3 -3
  19. data/lib/flapjack/gateways/email.rb +73 -46
  20. data/lib/flapjack/gateways/email/alert.html.erb +13 -4
  21. data/lib/flapjack/gateways/email/alert.text.erb +2 -2
  22. data/lib/flapjack/gateways/jabber.rb +22 -16
  23. data/lib/flapjack/gateways/pagerduty.rb +7 -3
  24. data/lib/flapjack/gateways/web.rb +1 -1
  25. data/lib/flapjack/gateways/web/views/check.html.erb +2 -2
  26. data/lib/flapjack/gateways/web/views/contact.html.erb +3 -3
  27. data/lib/flapjack/logger.rb +67 -35
  28. data/lib/flapjack/notifier.rb +9 -3
  29. data/lib/flapjack/pikelet.rb +3 -1
  30. data/lib/flapjack/processor.rb +34 -10
  31. data/lib/flapjack/version.rb +1 -1
  32. data/spec/lib/flapjack/coordinator_spec.rb +17 -13
  33. data/spec/lib/flapjack/data/contact_spec.rb +4 -3
  34. data/spec/lib/flapjack/data/entity_check_spec.rb +10 -0
  35. data/spec/lib/flapjack/data/entity_spec.rb +60 -5
  36. data/spec/lib/flapjack/data/event_spec.rb +4 -4
  37. data/spec/lib/flapjack/data/notification_rule_spec.rb +9 -2
  38. data/spec/lib/flapjack/data/tag_spec.rb +0 -1
  39. data/spec/lib/flapjack/gateways/api/contact_methods_spec.rb +1 -1
  40. data/spec/lib/flapjack/gateways/email_spec.rb +2 -1
  41. data/spec/lib/flapjack/gateways/jabber_spec.rb +5 -3
  42. data/spec/lib/flapjack/gateways/pagerduty_spec.rb +3 -1
  43. data/spec/lib/flapjack/logger_spec.rb +5 -5
  44. data/spec/lib/flapjack/pikelet_spec.rb +4 -2
  45. data/spec/lib/flapjack/processor_spec.rb +16 -7
  46. data/tasks/benchmarks.rake +228 -0
  47. data/tasks/events.rake +11 -10
  48. data/tasks/support/flapjack_config_benchmark.yaml +58 -0
  49. metadata +6 -4
data/tasks/events.rake CHANGED
@@ -2,19 +2,19 @@ require 'redis'
2
2
 
3
3
  namespace :events do
4
4
 
5
+ # add lib to the default include path
6
+ unless $:.include?(File.dirname(__FILE__) + '/../lib/')
7
+ $: << File.dirname(__FILE__) + '/../lib'
8
+ end
9
+
10
+ require 'flapjack/configuration'
11
+ require 'flapjack/data/event'
12
+ require 'flapjack/data/entity_check'
13
+
5
14
  # FIXME: add arguments, make more flexible
6
15
  desc "send events to trigger some notifications"
7
16
  task :test_notification do
8
17
 
9
- # add lib to the default include path
10
- unless $:.include?(File.dirname(__FILE__) + '/../lib/')
11
- $: << File.dirname(__FILE__) + '/../lib'
12
- end
13
-
14
- require 'flapjack/configuration'
15
- require 'flapjack/data/event'
16
- require 'flapjack/data/entity_check'
17
-
18
18
  FLAPJACK_ENV = ENV['FLAPJACK_ENV'] || 'development'
19
19
  config_file = File.join('etc', 'flapjack_config.yaml')
20
20
 
@@ -55,4 +55,5 @@ namespace :events do
55
55
 
56
56
  end
57
57
 
58
- end
58
+
59
+ end
@@ -0,0 +1,58 @@
1
+ test:
2
+ pid_file: tmp/pids/flapjack_test.pid
3
+ log_file: log/flapjack_test.log
4
+ daemonize: no
5
+ redis:
6
+ host: 127.0.0.1
7
+ port: 6379
8
+ db: 14
9
+ processor:
10
+ enabled: yes
11
+ queue: events
12
+ notifier_queue: notifications
13
+ archive_events: false
14
+ events_archive_maxage: 10800
15
+ new_check_scheduled_maintenance_duration: 1 month
16
+ exit_on_queue_empty: true
17
+ logger:
18
+ level: WARN
19
+ notifier:
20
+ enabled: yes
21
+ queue: notifications
22
+ email_queue: email_notifications
23
+ sms_queue: sms_notifications
24
+ jabber_queue: jabber_notifications
25
+ pagerduty_queue: pagerduty_notifications
26
+ notification_log_file: log/notification_test.log
27
+ default_contact_timezone: Australia/Broken_Hill
28
+ logger:
29
+ level: WARN
30
+ development:
31
+ pid_file: tmp/pids/flapjack_development.pid
32
+ log_file: log/flapjack_development.log
33
+ daemonize: no
34
+ redis:
35
+ host: 127.0.0.1
36
+ port: 6379
37
+ db: 13
38
+ processor:
39
+ enabled: yes
40
+ queue: events
41
+ notifier_queue: notifications
42
+ archive_events: true
43
+ events_archive_maxage: 10800
44
+ new_check_scheduled_maintenance_duration: 1 month
45
+ exit_on_queue_empty: true
46
+ logger:
47
+ level: INFO
48
+ notifier:
49
+ enabled: yes
50
+ queue: notifications
51
+ email_queue: email_notifications
52
+ sms_queue: sms_notifications
53
+ jabber_queue: jabber_notifications
54
+ pagerduty_queue: pagerduty_notifications
55
+ notification_log_file: log/notification_test.log
56
+ default_contact_timezone: Australia/Broken_Hill
57
+ logger:
58
+ level: INFO
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flapjack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.20
4
+ version: 0.7.21
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-07-17 00:00:00.000000000 Z
14
+ date: 2013-08-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: dante
@@ -494,8 +494,10 @@ files:
494
494
  - spec/support/erb_view_helper.rb
495
495
  - spec/support/profile_all_formatter.rb
496
496
  - spec/support/uncolored_doc_formatter.rb
497
+ - tasks/benchmarks.rake
497
498
  - tasks/events.rake
498
499
  - tasks/profile.rake
500
+ - tasks/support/flapjack_config_benchmark.yaml
499
501
  - tmp/acknowledge.rb
500
502
  - tmp/create_config_yaml.rb
501
503
  - tmp/create_event_ok.rb
@@ -527,7 +529,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
527
529
  version: '0'
528
530
  segments:
529
531
  - 0
530
- hash: -2799990042721425625
532
+ hash: 358666244309813915
531
533
  required_rubygems_version: !ruby/object:Gem::Requirement
532
534
  none: false
533
535
  requirements:
@@ -536,7 +538,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
536
538
  version: '0'
537
539
  segments:
538
540
  - 0
539
- hash: -2799990042721425625
541
+ hash: 358666244309813915
540
542
  requirements: []
541
543
  rubyforge_project:
542
544
  rubygems_version: 1.8.23