File: test_statsd.rb

package info (click to toggle)
ruby-god 0.13.7-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 832 kB
  • sloc: ruby: 6,641; ansic: 237; makefile: 3
file content (22 lines) | stat: -rw-r--r-- 589 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require File.dirname(__FILE__) + '/helper'

class TestStatsd < Minitest::Test
  def setup
    @statsd = God::Contacts::Statsd.new
  end

  def test_exists
    God::Contacts::Statsd
  end

  def test_notify
    [
        'cpu out of bounds',
        'memory out of bounds',
        'process is flapping'
    ].each do |event_type|
      ::Statsd.any_instance.expects(:increment).with("god.#{event_type.gsub(/\s/, '_')}.127_0_0_1.myapp-thin-1234")
      @statsd.notify("myapp-thin-1234 [trigger] #{event_type}", Time.now, 'some priority', 'and some category', '127.0.0.1')
    end
  end
end