inst-jobs-statsd 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b329800f873f236c76b0a31ea351db966d2f4392a16c9943c8ff65eb9827a6b
4
- data.tar.gz: 9b21793e8b8a36f86c5c6b543c68a8c8a53ee5cadf2d8456bc370f3ce9ddb09d
3
+ metadata.gz: f299ba77daf29bef9b9a2f8f52710fd23029d3f122d723ec8c19518389ba10cf
4
+ data.tar.gz: 38df7c0062ee2c19622e19e24377d853e05c55eb3d59253f470fb40668afb2c1
5
5
  SHA512:
6
- metadata.gz: 268117eaf634dff1143e388762d02a56902d88eb3081f6f91ef8c27fbf553d0c39d00081f2dffb65bf962889eb75c01a380dc2059aec17873a6acca603c51253
7
- data.tar.gz: 0adefe1325127092dcc7eec77dbccabe9ddef36c5a15398ecf501c728258aeb42e3a27a63be58d9443c3b4983503b2460558f8ba600797e576388b85465be32d
6
+ metadata.gz: f45e0aea9f8e01b3e592754fd596d03a1123d74958803f3b6250964adbaa132fe1d5467fad6a9ac330b68f9df0225e9a1851662a08f29834d769d5020c3b3c47
7
+ data.tar.gz: a1376daa61d0e4db5911c707dc2524af23fabca7788ee626cbfa7d0ca06fd6f77003d7ea2cbda9acff13bd4c0283f52f89ba4b3d64d9608a4a921db2eff96811
@@ -3,7 +3,7 @@ module InstJobsStatsd
3
3
  module Counters
4
4
  def self.report_count(stat, value, job: nil, sample_rate: 1)
5
5
  stats = Naming.qualified_names(stat, job)
6
- InstStatsd::Statsd.count(stats, value, sample_rate, tags: Naming.dd_job_tags(job))
6
+ InstStatsd::Statsd.count(stats, value, sample_rate, short_stat: stat, tags: Naming.dd_job_tags(job))
7
7
  end
8
8
  end
9
9
  end
@@ -12,7 +12,7 @@ module InstJobsStatsd
12
12
 
13
13
  def self.report_gauge(stat, value, job: nil, sample_rate: 1)
14
14
  stats = Naming.qualified_names(stat, job)
15
- InstStatsd::Statsd.gauge(stats, value, sample_rate, tags: Naming.dd_job_tags(job))
15
+ InstStatsd::Statsd.gauge(stats, value, sample_rate, short_stat: stat, tags: Naming.dd_job_tags(job))
16
16
  end
17
17
 
18
18
  class Callbacks
@@ -7,7 +7,7 @@ module InstJobsStatsd
7
7
  if block_given?
8
8
  InstStatsd::Statsd.time(stats, sample_rate, short_stat: stat, tags: Naming.dd_job_tags(job)) { yield }
9
9
  else
10
- InstStatsd::Statsd.timing(stats, timing, sample_rate, tags: Naming.dd_job_tags(job))
10
+ InstStatsd::Statsd.timing(stats, timing, sample_rate, short_stat: stat, tags: Naming.dd_job_tags(job))
11
11
  end
12
12
  end
13
13
 
@@ -1,3 +1,3 @@
1
1
  module InstJobsStatsd
2
- VERSION = '1.2.1'.freeze
2
+ VERSION = '1.2.2'.freeze
3
3
  end
@@ -10,7 +10,7 @@ RSpec.describe InstJobsStatsd::Stats::Counters::Failed do
10
10
  let(:x) { Struct.new(:perform).new(true) }
11
11
  it do
12
12
  expect(InstStatsd::Statsd).to receive(:count)
13
- .with(array_including(/\.failed$/), 1, 1, { tags: {} })
13
+ .with(array_including(/\.failed$/), 1, 1, { short_stat: :failed, tags: {} })
14
14
 
15
15
  InstJobsStatsd::Stats::Counters::Failed.enable_failed_count
16
16
  x.send_later(:perform)
@@ -20,7 +20,7 @@ RSpec.describe InstJobsStatsd::Stats::Counters::Orphaned do
20
20
 
21
21
  it do
22
22
  expect(InstStatsd::Statsd).to receive(:count)
23
- .with(array_including(/\.orphaned$/), 2, 1, { tags: {} })
23
+ .with(array_including(/\.orphaned$/), 2, 1, { short_stat: anything, tags: {} })
24
24
  Delayed::Worker.lifecycle.run_callbacks(:perform, nil, Delayed::Job.first) {}
25
25
  end
26
26
  end
@@ -18,7 +18,7 @@ RSpec.describe InstJobsStatsd::Stats::Counters::Run do
18
18
 
19
19
  it do
20
20
  expect(InstStatsd::Statsd).to receive(:count)
21
- .twice.with(array_including(/\.run$/), 1, 1, { tags: {} })
21
+ .twice.with(array_including(/\.run$/), 1, 1, { short_stat: anything, tags: {} })
22
22
  Delayed::Job.all.each do |job|
23
23
  Delayed::Worker.lifecycle.run_callbacks(:perform, {}, job) {}
24
24
  end
@@ -24,7 +24,7 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Failed do
24
24
 
25
25
  it do
26
26
  expect(InstStatsd::Statsd).to receive(:gauge)
27
- .with(array_including(/\.failed_depth$/), 1, 1, { tags: {} })
27
+ .with(array_including(/\.failed_depth$/), 1, 1, { short_stat: anything, tags: {} })
28
28
  InstJobsStatsd::Stats::Periodic::Failed.report_failed_depth
29
29
  end
30
30
  end
@@ -28,13 +28,13 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Queue do
28
28
 
29
29
  it do
30
30
  expect(InstStatsd::Statsd).to receive(:gauge)
31
- .with(array_including(/\.queue_depth$/), 1, 1, { tags: {} })
31
+ .with(array_including(/\.queue_depth$/), 1, 1, { short_stat: anything, tags: {} })
32
32
  InstJobsStatsd::Stats::Periodic::Queue.report_queue_depth
33
33
  end
34
34
 
35
35
  it do
36
36
  expect(InstStatsd::Statsd).to receive(:gauge)
37
- .with(array_including(/\.queue_depth$/), 2, 1, { tags: {} })
37
+ .with(array_including(/\.queue_depth$/), 2, 1, { short_stat: anything, tags: {} })
38
38
  Timecop.freeze(2.minutes.from_now) do
39
39
  InstJobsStatsd::Stats::Periodic::Queue.report_queue_depth
40
40
  end
@@ -42,7 +42,7 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Queue do
42
42
 
43
43
  it do
44
44
  expect(InstStatsd::Statsd).to receive(:gauge)
45
- .with(array_including(/\.queue_depth$/), 3, 1, { tags: {} })
45
+ .with(array_including(/\.queue_depth$/), 3, 1, { short_stat: anything, tags: {} })
46
46
  Timecop.freeze(20.minutes.from_now) do
47
47
  InstJobsStatsd::Stats::Periodic::Queue.report_queue_depth
48
48
  end
@@ -66,17 +66,17 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Queue do
66
66
 
67
67
  it do
68
68
  expect(InstStatsd::Statsd).to receive(:gauge)
69
- .ordered.with(array_including(/\.queue_age_total$/), number_near(0), 1, { tags: {} })
69
+ .ordered.with(array_including(/\.queue_age_total$/), number_near(0), 1, { short_stat: anything, tags: {} })
70
70
  expect(InstStatsd::Statsd).to receive(:gauge)
71
- .ordered.with(array_including(/\.queue_age_max$/), number_near(0), 1, { tags: {} })
71
+ .ordered.with(array_including(/\.queue_age_max$/), number_near(0), 1, { short_stat: anything, tags: {} })
72
72
  InstJobsStatsd::Stats::Periodic::Queue.report_queue_age
73
73
  end
74
74
 
75
75
  it do
76
76
  expect(InstStatsd::Statsd).to receive(:gauge)
77
- .ordered.with(array_including(/\.queue_age_total$/), number_near(180), 1, { tags: {} })
77
+ .ordered.with(array_including(/\.queue_age_total$/), number_near(180), 1, { short_stat: anything, tags: {} })
78
78
  expect(InstStatsd::Statsd).to receive(:gauge)
79
- .ordered.with(array_including(/\.queue_age_max$/), number_near(120), 1, { tags: {} })
79
+ .ordered.with(array_including(/\.queue_age_max$/), number_near(120), 1, { short_stat: anything, tags: {} })
80
80
  Timecop.freeze(2.minutes.from_now) do
81
81
  InstJobsStatsd::Stats::Periodic::Queue.report_queue_age
82
82
  end
@@ -84,9 +84,9 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Queue do
84
84
 
85
85
  it do
86
86
  expect(InstStatsd::Statsd).to receive(:gauge)
87
- .ordered.with(array_including(/\.queue_age_total$/), number_near(2940), 1, { tags: {} })
87
+ .ordered.with(array_including(/\.queue_age_total$/), number_near(2940), 1, { short_stat: anything, tags: {} })
88
88
  expect(InstStatsd::Statsd).to receive(:gauge)
89
- .ordered.with(array_including(/\.queue_age_max$/), number_near(1200), 1, { tags: {} })
89
+ .ordered.with(array_including(/\.queue_age_max$/), number_near(1200), 1, { short_stat: anything, tags: {} })
90
90
  Timecop.freeze(20.minutes.from_now) do
91
91
  InstJobsStatsd::Stats::Periodic::Queue.report_queue_age
92
92
  end
@@ -25,7 +25,7 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Run do
25
25
 
26
26
  it do
27
27
  expect(InstStatsd::Statsd).to receive(:gauge)
28
- .with(array_including(/\.run_depth$/), 1, 1, { tags: {} })
28
+ .with(array_including(/\.run_depth$/), 1, 1, { short_stat: anything, tags: {} })
29
29
  InstJobsStatsd::Stats::Periodic::Run.report_run_depth
30
30
  end
31
31
  end
@@ -44,9 +44,9 @@ RSpec.describe InstJobsStatsd::Stats::Periodic::Run do
44
44
 
45
45
  it do
46
46
  expect(InstStatsd::Statsd).to receive(:gauge)
47
- .ordered.with(array_including(/\.run_age_total$/), number_near(0), 1, { tags: {} })
47
+ .ordered.with(array_including(/\.run_age_total$/), number_near(0), 1, { short_stat: anything, tags: {} })
48
48
  expect(InstStatsd::Statsd).to receive(:gauge)
49
- .ordered.with(array_including(/\.run_age_max$/), number_near(0), 1, { tags: {} })
49
+ .ordered.with(array_including(/\.run_age_max$/), number_near(0), 1, { short_stat: anything, tags: {} })
50
50
  InstJobsStatsd::Stats::Periodic::Run.report_run_age
51
51
  end
52
52
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inst-jobs-statsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Slade
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-21 00:00:00.000000000 Z
11
+ date: 2019-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inst-jobs