wavefront-sdk 3.3.3 → 3.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -17
- data/Gemfile +2 -0
- data/HISTORY.md +4 -0
- data/Rakefile +2 -0
- data/lib/wavefront-sdk/alert.rb +5 -2
- data/lib/wavefront-sdk/api_mixins/acl.rb +3 -0
- data/lib/wavefront-sdk/api_mixins/tag.rb +2 -0
- data/lib/wavefront-sdk/api_mixins/user.rb +4 -0
- data/lib/wavefront-sdk/apitoken.rb +2 -0
- data/lib/wavefront-sdk/cloudintegration.rb +4 -0
- data/lib/wavefront-sdk/core/api.rb +3 -0
- data/lib/wavefront-sdk/core/api_caller.rb +16 -10
- data/lib/wavefront-sdk/core/exception.rb +2 -0
- data/lib/wavefront-sdk/core/logger.rb +6 -3
- data/lib/wavefront-sdk/core/response.rb +6 -3
- data/lib/wavefront-sdk/credentials.rb +5 -2
- data/lib/wavefront-sdk/dashboard.rb +3 -0
- data/lib/wavefront-sdk/defs/constants.rb +3 -1
- data/lib/wavefront-sdk/defs/version.rb +3 -1
- data/lib/wavefront-sdk/derivedmetric.rb +3 -0
- data/lib/wavefront-sdk/distribution.rb +36 -16
- data/lib/wavefront-sdk/event.rb +16 -12
- data/lib/wavefront-sdk/externallink.rb +3 -0
- data/lib/wavefront-sdk/integration.rb +2 -0
- data/lib/wavefront-sdk/maintenancewindow.rb +4 -1
- data/lib/wavefront-sdk/message.rb +2 -0
- data/lib/wavefront-sdk/metric.rb +3 -0
- data/lib/wavefront-sdk/metric_helper.rb +6 -4
- data/lib/wavefront-sdk/notificant.rb +3 -0
- data/lib/wavefront-sdk/paginator/base.rb +5 -0
- data/lib/wavefront-sdk/paginator/delete.rb +2 -0
- data/lib/wavefront-sdk/paginator/get.rb +2 -0
- data/lib/wavefront-sdk/paginator/post.rb +2 -0
- data/lib/wavefront-sdk/paginator/put.rb +2 -0
- data/lib/wavefront-sdk/proxy.rb +2 -0
- data/lib/wavefront-sdk/query.rb +6 -3
- data/lib/wavefront-sdk/report.rb +2 -0
- data/lib/wavefront-sdk/savedsearch.rb +4 -0
- data/lib/wavefront-sdk/search.rb +4 -1
- data/lib/wavefront-sdk/settings.rb +2 -0
- data/lib/wavefront-sdk/source.rb +3 -0
- data/lib/wavefront-sdk/stdlib/array.rb +2 -0
- data/lib/wavefront-sdk/stdlib/hash.rb +5 -1
- data/lib/wavefront-sdk/stdlib/string.rb +2 -0
- data/lib/wavefront-sdk/support/mixins.rb +5 -1
- data/lib/wavefront-sdk/support/parse_time.rb +3 -0
- data/lib/wavefront-sdk/types/status.rb +4 -0
- data/lib/wavefront-sdk/user.rb +18 -8
- data/lib/wavefront-sdk/usergroup.rb +3 -0
- data/lib/wavefront-sdk/validators.rb +28 -0
- data/lib/wavefront-sdk/webhook.rb +3 -0
- data/lib/wavefront-sdk/write.rb +43 -28
- data/lib/wavefront-sdk/writers/api.rb +2 -0
- data/lib/wavefront-sdk/writers/core.rb +21 -4
- data/lib/wavefront-sdk/writers/http.rb +9 -2
- data/lib/wavefront-sdk/writers/socket.rb +11 -9
- data/lib/wavefront-sdk/writers/summary.rb +2 -0
- data/lib/wavefront-sdk/writers/unix.rb +10 -7
- data/lib/wavefront_sdk.rb +3 -1
- data/spec/.rubocop.yml +10 -14
- data/spec/constants.rb +10 -8
- data/spec/spec_helper.rb +2 -0
- data/spec/support/bad_mocket.rb +2 -0
- data/spec/support/hash.rb +2 -0
- data/spec/support/minitest_assertions.rb +2 -0
- data/spec/support/mocket.rb +2 -0
- data/spec/test_mixins/acl.rb +2 -0
- data/spec/test_mixins/general.rb +2 -0
- data/spec/test_mixins/tag.rb +2 -0
- data/spec/test_mixins/update_keys.rb +2 -0
- data/spec/wavefront-sdk/alert_spec.rb +10 -9
- data/spec/wavefront-sdk/api_mixins/user_mixins_spec.rb +1 -0
- data/spec/wavefront-sdk/apitoken_spec.rb +1 -0
- data/spec/wavefront-sdk/cloudintegration_spec.rb +2 -1
- data/spec/wavefront-sdk/core/api_caller_spec.rb +1 -0
- data/spec/wavefront-sdk/core/api_spec.rb +1 -0
- data/spec/wavefront-sdk/core/logger_spec.rb +1 -0
- data/spec/wavefront-sdk/core/response_spec.rb +4 -3
- data/spec/wavefront-sdk/credentials_spec.rb +1 -0
- data/spec/wavefront-sdk/dashboard_spec.rb +1 -0
- data/spec/wavefront-sdk/derivedmetric_spec.rb +1 -0
- data/spec/wavefront-sdk/distribution_spec.rb +6 -5
- data/spec/wavefront-sdk/event_spec.rb +8 -7
- data/spec/wavefront-sdk/externallink_spec.rb +5 -4
- data/spec/wavefront-sdk/integration_spec.rb +1 -0
- data/spec/wavefront-sdk/maintenancewindow_spec.rb +6 -5
- data/spec/wavefront-sdk/message_spec.rb +2 -1
- data/spec/wavefront-sdk/metric_helper_spec.rb +10 -9
- data/spec/wavefront-sdk/metric_spec.rb +1 -0
- data/spec/wavefront-sdk/notificant_spec.rb +1 -0
- data/spec/wavefront-sdk/paginator/base_spec.rb +1 -0
- data/spec/wavefront-sdk/paginator/post_spec.rb +1 -0
- data/spec/wavefront-sdk/proxy_spec.rb +1 -0
- data/spec/wavefront-sdk/query_spec.rb +1 -0
- data/spec/wavefront-sdk/report_spec.rb +1 -0
- data/spec/wavefront-sdk/resources/dummy_points.rb +10 -8
- data/spec/wavefront-sdk/savedsearch_spec.rb +1 -0
- data/spec/wavefront-sdk/search_spec.rb +5 -4
- data/spec/wavefront-sdk/settings_spec.rb +1 -0
- data/spec/wavefront-sdk/source_spec.rb +3 -2
- data/spec/wavefront-sdk/stdlib/array_spec.rb +1 -0
- data/spec/wavefront-sdk/stdlib/hash_spec.rb +1 -0
- data/spec/wavefront-sdk/stdlib/string_spec.rb +1 -0
- data/spec/wavefront-sdk/support/mixins_spec.rb +1 -0
- data/spec/wavefront-sdk/support/parse_time_spec.rb +1 -2
- data/spec/wavefront-sdk/user_spec.rb +1 -0
- data/spec/wavefront-sdk/usergroup_spec.rb +2 -1
- data/spec/wavefront-sdk/validators_spec.rb +1 -2
- data/spec/wavefront-sdk/webhook_spec.rb +7 -6
- data/spec/wavefront-sdk/write_spec.rb +50 -30
- data/spec/wavefront-sdk/writers/api_spec.rb +1 -0
- data/spec/wavefront-sdk/writers/core_spec.rb +1 -0
- data/spec/wavefront-sdk/writers/http_spec.rb +2 -1
- data/spec/wavefront-sdk/writers/socket_spec.rb +1 -0
- data/spec/wavefront-sdk/writers/summary_spec.rb +1 -0
- data/wavefront-sdk.gemspec +4 -2
- metadata +6 -6
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'socket'
|
2
4
|
require_relative 'core'
|
3
5
|
|
@@ -20,13 +22,7 @@ module Wavefront
|
|
20
22
|
end
|
21
23
|
|
22
24
|
logger.log("Connecting to #{creds[:socket]}.", :debug)
|
23
|
-
|
24
|
-
begin
|
25
|
-
@conn = UNIXSocket.new(creds[:socket])
|
26
|
-
rescue StandardError => e
|
27
|
-
logger.log(e, :error)
|
28
|
-
raise Wavefront::Exception::InvalidEndpoint
|
29
|
-
end
|
25
|
+
open_socket(creds[:socket])
|
30
26
|
end
|
31
27
|
|
32
28
|
def close
|
@@ -45,6 +41,13 @@ module Wavefront
|
|
45
41
|
|
46
42
|
private
|
47
43
|
|
44
|
+
def open_socket(socket)
|
45
|
+
@conn = UNIXSocket.new(socket)
|
46
|
+
rescue StandardError => e
|
47
|
+
logger.log(e, :error)
|
48
|
+
raise Wavefront::Exception::InvalidEndpoint
|
49
|
+
end
|
50
|
+
|
48
51
|
# @param point [String] point or points in native Wavefront
|
49
52
|
# format.
|
50
53
|
#
|
data/lib/wavefront_sdk.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Automatically load all SDK classes.
|
2
4
|
#
|
3
5
|
require 'pathname'
|
4
6
|
|
5
|
-
libdir = Pathname.new(
|
7
|
+
libdir = Pathname.new(__dir__) + 'wavefront-sdk'
|
6
8
|
|
7
9
|
libdir.children.select { |f| f.extname == '.rb' }.each do |f|
|
8
10
|
require_relative f
|
data/spec/.rubocop.yml
CHANGED
@@ -1,17 +1,13 @@
|
|
1
|
-
|
2
|
-
TargetRubyVersion: 2.2
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# Allow long blocks of tests
|
6
|
-
#
|
7
|
-
Metrics/BlockLength:
|
8
|
-
Max: 120
|
9
|
-
|
10
|
-
Metrics/MethodLength:
|
11
|
-
Max: 80
|
12
|
-
|
1
|
+
# Offense count: 64
|
13
2
|
Metrics/AbcSize:
|
14
|
-
Max:
|
3
|
+
Max: 64
|
15
4
|
|
5
|
+
# Offense count: 5
|
6
|
+
# Configuration parameters: CountComments.
|
16
7
|
Metrics/ClassLength:
|
17
|
-
Max:
|
8
|
+
Max: 279
|
9
|
+
|
10
|
+
# Offense count: 46
|
11
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
12
|
+
Metrics/MethodLength:
|
13
|
+
Max: 39
|
data/spec/constants.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# rubocop:disable Style/MutableConstant
|
2
4
|
CREDS = { endpoint: 'test.example.com',
|
3
|
-
token:
|
5
|
+
token: '0123456789-ABCDEF' }
|
4
6
|
# rubocop:enable Style/MutableConstant
|
5
7
|
|
6
8
|
W_CREDS = { proxy: 'wavefront', port: 2878 }.freeze
|
@@ -15,16 +17,16 @@ JSON_POST_HEADERS = {
|
|
15
17
|
|
16
18
|
DUMMY_RESPONSE = '{"status":{"result":"OK","message":"","code":200},' \
|
17
19
|
'"response":{"items":[{"name":"test data"}],"offset":0,' \
|
18
|
-
'"limit":100,"totalItems":3,"moreItems":false}}'
|
20
|
+
'"limit":100,"totalItems":3,"moreItems":false}}'
|
19
21
|
|
20
22
|
RESOURCE_DIR = (Pathname.new(__FILE__).dirname +
|
21
23
|
'wavefront-sdk' + 'resources').freeze
|
22
24
|
|
23
|
-
U_ACL_1 = 'someone@example.com'
|
24
|
-
U_ACL_2 = 'other@elsewhere.com'
|
25
|
-
GRP_ACL = 'f8dc0c14-91a0-4ca9-8a2a-7d47f4db4672'
|
25
|
+
U_ACL_1 = 'someone@example.com'
|
26
|
+
U_ACL_2 = 'other@elsewhere.com'
|
27
|
+
GRP_ACL = 'f8dc0c14-91a0-4ca9-8a2a-7d47f4db4672'
|
26
28
|
|
27
|
-
DEFAULT_HEADERS = { 'Accept':
|
29
|
+
DEFAULT_HEADERS = { 'Accept': /.*/,
|
28
30
|
'Accept-Encoding': /.*/,
|
29
|
-
'Authorization':
|
30
|
-
'User-Agent':
|
31
|
+
'Authorization': 'Bearer 0123456789-ABCDEF',
|
32
|
+
'User-Agent': /wavefront-sdk \d+\.\d+\.\d+/ }.freeze
|
data/spec/spec_helper.rb
CHANGED
data/spec/support/bad_mocket.rb
CHANGED
data/spec/support/hash.rb
CHANGED
data/spec/support/mocket.rb
CHANGED
data/spec/test_mixins/acl.rb
CHANGED
data/spec/test_mixins/general.rb
CHANGED
data/spec/test_mixins/tag.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require_relative '../spec_helper'
|
4
5
|
require_relative '../test_mixins/acl'
|
@@ -125,19 +126,19 @@ class WavefrontAlertTest < WavefrontTestBase
|
|
125
126
|
end
|
126
127
|
|
127
128
|
def payload
|
128
|
-
{ name:
|
129
|
-
target:
|
130
|
-
condition:
|
131
|
-
displayExpression:
|
132
|
-
minutes:
|
129
|
+
{ name: 'SDK test alert',
|
130
|
+
target: 'user@example.com',
|
131
|
+
condition: 'ts("app.errors") > 0',
|
132
|
+
displayExpression: 'ts("app.errors")',
|
133
|
+
minutes: 5,
|
133
134
|
resolveAfterMinutes: 5,
|
134
|
-
severity:
|
135
|
+
severity: 'INFO' }
|
135
136
|
end
|
136
137
|
|
137
138
|
def search_payload(value)
|
138
|
-
{ limit:
|
139
|
+
{ limit: 999,
|
139
140
|
offset: 0,
|
140
|
-
query:
|
141
|
-
sort:
|
141
|
+
query: [{ key: 'status', value: value, matchingMethod: 'EXACT' }],
|
142
|
+
sort: { field: 'status', ascending: true } }
|
142
143
|
end
|
143
144
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require_relative '../spec_helper'
|
4
5
|
require_relative '../test_mixins/general'
|
@@ -51,7 +52,7 @@ class WavefrontCloudIntegrationTest < WavefrontTestBase
|
|
51
52
|
service: 'CLOUDWATCH',
|
52
53
|
cloudWatch: {
|
53
54
|
baseCredentials: {
|
54
|
-
roleArn:
|
55
|
+
roleArn: 'arn:aws:iam::<accountid>:role/<rolename>',
|
55
56
|
externalId: 'wave123'
|
56
57
|
}
|
57
58
|
},
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require 'json'
|
4
5
|
require_relative '../../spec_helper'
|
@@ -7,13 +8,13 @@ require_relative '../../../lib/wavefront-sdk/core/response'
|
|
7
8
|
|
8
9
|
GOOD_RESP = '{"status":{"result":"OK","message":"","code":200},' \
|
9
10
|
'"response":{"items":[{"name":"test agent"}],"offset":0,' \
|
10
|
-
'"limit":100,"totalItems":3,"moreItems":false}}'
|
11
|
+
'"limit":100,"totalItems":3,"moreItems":false}}'
|
11
12
|
|
12
13
|
BAD_RESP = "error='not_found'
|
13
14
|
message='resource cannot be found'
|
14
|
-
trackingId=eca22ddc-848b-4e67-876a-366145c8a759"
|
15
|
+
trackingId=eca22ddc-848b-4e67-876a-366145c8a759"
|
15
16
|
|
16
|
-
ERR_RESP = { error:
|
17
|
+
ERR_RESP = { error: 'HTTP 415 Unsupported Media Type',
|
17
18
|
trackingId: 'ce231eaf-8d0e-4138-a82d-12725376a3b0' }.to_json
|
18
19
|
|
19
20
|
# Unit tests for Response class. Also indirectly tests the Status
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require_relative '../spec_helper'
|
4
5
|
require_relative '../../lib/wavefront-sdk/distribution'
|
@@ -66,10 +67,10 @@ class WavefrontDistributionTest < MiniTest::Test
|
|
66
67
|
|
67
68
|
def distribution
|
68
69
|
{ interval: :m,
|
69
|
-
path:
|
70
|
-
value:
|
71
|
-
ts:
|
72
|
-
source:
|
73
|
-
tags:
|
70
|
+
path: 'test.distribution',
|
71
|
+
value: [[5, 11], [15, 2.533], [8, -15], [12, 1e6]],
|
72
|
+
ts: 1_538_865_613,
|
73
|
+
source: 'minitest',
|
74
|
+
tags: { tag1: 'val1', tag2: 'val2' } }
|
74
75
|
end
|
75
76
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require_relative '../spec_helper'
|
4
5
|
require_relative '../test_mixins/general'
|
@@ -57,16 +58,16 @@ class WavefrontEventTest < WavefrontTestBase
|
|
57
58
|
end
|
58
59
|
|
59
60
|
def payload
|
60
|
-
{ name:
|
61
|
+
{ name: 'test_event',
|
61
62
|
annotations: {
|
62
63
|
severity: 'info',
|
63
|
-
type:
|
64
|
-
details:
|
64
|
+
type: 'SDK test event',
|
65
|
+
details: 'an imaginary event to test the SDK'
|
65
66
|
},
|
66
|
-
hosts:
|
67
|
-
startTime:
|
68
|
-
endTime:
|
69
|
-
tags:
|
67
|
+
hosts: %w[host1 host2],
|
68
|
+
startTime: 1_493_385_089_000,
|
69
|
+
endTime: 1_493_385_345_678,
|
70
|
+
tags: %w[tag1 tag2],
|
70
71
|
isEphemeral: false }
|
71
72
|
end
|
72
73
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require_relative '../spec_helper'
|
4
5
|
require_relative '../test_mixins/general'
|
@@ -23,11 +24,11 @@ class WavefrontExternalLinkTest < WavefrontTestBase
|
|
23
24
|
end
|
24
25
|
|
25
26
|
def payload
|
26
|
-
[{ name:
|
27
|
-
template:
|
27
|
+
[{ name: 'test link',
|
28
|
+
template: 'https://example.com/link/{{value}}',
|
28
29
|
description: 'an imaginary link for unit testing purposes' },
|
29
|
-
{ name:
|
30
|
-
template:
|
30
|
+
{ name: 'test link',
|
31
|
+
template: 'https://example.com/link/{{value}}' }]
|
31
32
|
end
|
32
33
|
|
33
34
|
def api_class
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require_relative '../spec_helper'
|
4
5
|
require_relative '../test_mixins/general'
|
@@ -23,11 +24,11 @@ class WavefrontMaintenanceWindowTest < WavefrontTestBase
|
|
23
24
|
end
|
24
25
|
|
25
26
|
def payload
|
26
|
-
{ reason:
|
27
|
-
title:
|
28
|
-
start:
|
29
|
-
end:
|
30
|
-
tags:
|
27
|
+
{ reason: 'testing SDK',
|
28
|
+
title: 'test window',
|
29
|
+
start: Time.now.to_i,
|
30
|
+
end: Time.now.to_i + 600,
|
31
|
+
tags: %w[testtag1 testtag2],
|
31
32
|
hostTags: %w[hosttag1 hosttag2] }
|
32
33
|
end
|
33
34
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require 'minitest/autorun'
|
4
5
|
require_relative '../spec_helper'
|
@@ -91,9 +92,9 @@ class WavefrontMetricHelperTest < MiniTest::Test
|
|
91
92
|
end
|
92
93
|
|
93
94
|
def test_counters_to_wf
|
94
|
-
input = { ['test.counter1', nil]
|
95
|
+
input = { ['test.counter1', nil] => 7,
|
95
96
|
['test.counter1', WH_TAGS] => 8,
|
96
|
-
['test.counter2', nil]
|
97
|
+
['test.counter2', nil] => 9 }
|
97
98
|
|
98
99
|
out = wf.counters_to_wf(input)
|
99
100
|
assert_instance_of(Array, out)
|
@@ -109,7 +110,7 @@ class WavefrontMetricHelperTest < MiniTest::Test
|
|
109
110
|
def test_dists_to_wf
|
110
111
|
input = { ['test.dist1', :m, nil] => [10, 10, 11, 12],
|
111
112
|
['test.dist1', :m, WH_TAGS] => [123, 456, 789],
|
112
|
-
['test.dist1', :h, nil]
|
113
|
+
['test.dist1', :h, nil] => [6, 6, 7, 4, 6, 4, 8] }
|
113
114
|
|
114
115
|
out = wfd.dists_to_wf(input)
|
115
116
|
assert_instance_of(Array, out)
|
@@ -161,9 +162,9 @@ class WavefrontMetricHelperTest < MiniTest::Test
|
|
161
162
|
def test_flush_counters
|
162
163
|
assert_nil(wf.flush_counters([]))
|
163
164
|
|
164
|
-
input = { ['test.counter1', nil]
|
165
|
+
input = { ['test.counter1', nil] => 7,
|
165
166
|
['test.counter1', WH_TAGS] => 8,
|
166
|
-
['test.counter2', nil]
|
167
|
+
['test.counter2', nil] => 9 }
|
167
168
|
|
168
169
|
mocket = Mocket.new
|
169
170
|
spy = Spy.on(wf.writer.writer, :write).and_return(mocket)
|
@@ -189,9 +190,9 @@ class WavefrontMetricHelperTest < MiniTest::Test
|
|
189
190
|
end
|
190
191
|
|
191
192
|
def test_flush_counters_fail
|
192
|
-
input = { ['test.counter1', nil]
|
193
|
+
input = { ['test.counter1', nil] => 7,
|
193
194
|
['test.counter1', WH_TAGS] => 8,
|
194
|
-
['test.counter2', nil]
|
195
|
+
['test.counter2', nil] => 9 }
|
195
196
|
|
196
197
|
mocket = BadMocket.new
|
197
198
|
spy = Spy.on(wf.writer.writer, :write).and_return(mocket)
|
@@ -222,7 +223,7 @@ class WavefrontMetricHelperTest < MiniTest::Test
|
|
222
223
|
|
223
224
|
input = { ['test.dist1', :m, nil] => [10, 10, 11, 12],
|
224
225
|
['test.dist1', :m, WH_TAGS] => [123, 456, 789],
|
225
|
-
['test.dist1', :h, nil]
|
226
|
+
['test.dist1', :h, nil] => [6, 6, 7, 4, 6, 4, 8] }
|
226
227
|
|
227
228
|
mocket = Mocket.new
|
228
229
|
spy = Spy.on(wfd.dist_writer.writer, :write).and_return(mocket)
|
@@ -251,7 +252,7 @@ class WavefrontMetricHelperTest < MiniTest::Test
|
|
251
252
|
def test_flush_dists_fail
|
252
253
|
input = { ['test.dist1', :m, nil] => [10, 10, 11, 12],
|
253
254
|
['test.dist1', :m, WH_TAGS] => [123, 456, 789],
|
254
|
-
['test.dist1', :h, nil]
|
255
|
+
['test.dist1', :h, nil] => [6, 6, 7, 4, 6, 4, 8] }
|
255
256
|
|
256
257
|
mocket = BadMocket.new
|
257
258
|
spy = Spy.on(wfd.dist_writer.writer, :write).and_return(mocket)
|