wavefront-cli 2.4.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab-ci.yml +16 -0
  3. data/.travis.yml +5 -5
  4. data/HISTORY.md +91 -0
  5. data/README.md +1 -2
  6. data/lib/wavefront-cli/alert.rb +1 -1
  7. data/lib/wavefront-cli/base.rb +1 -1
  8. data/lib/wavefront-cli/base_write.rb +1 -1
  9. data/lib/wavefront-cli/cloudintegration.rb +1 -1
  10. data/lib/wavefront-cli/commands/alert.rb +1 -1
  11. data/lib/wavefront-cli/commands/cloudintegration.rb +1 -1
  12. data/lib/wavefront-cli/commands/dashboard.rb +3 -3
  13. data/lib/wavefront-cli/commands/derivedmetric.rb +48 -0
  14. data/lib/wavefront-cli/commands/event.rb +1 -1
  15. data/lib/wavefront-cli/commands/integration.rb +1 -1
  16. data/lib/wavefront-cli/commands/link.rb +1 -1
  17. data/lib/wavefront-cli/commands/message.rb +1 -1
  18. data/lib/wavefront-cli/commands/metric.rb +1 -1
  19. data/lib/wavefront-cli/commands/notificant.rb +1 -1
  20. data/lib/wavefront-cli/commands/proxy.rb +1 -1
  21. data/lib/wavefront-cli/commands/query.rb +6 -4
  22. data/lib/wavefront-cli/commands/report.rb +1 -1
  23. data/lib/wavefront-cli/commands/savedsearch.rb +1 -1
  24. data/lib/wavefront-cli/commands/source.rb +1 -1
  25. data/lib/wavefront-cli/commands/user.rb +1 -1
  26. data/lib/wavefront-cli/commands/webhook.rb +1 -1
  27. data/lib/wavefront-cli/commands/window.rb +1 -1
  28. data/lib/wavefront-cli/commands/write.rb +1 -1
  29. data/lib/wavefront-cli/controller.rb +3 -3
  30. data/lib/wavefront-cli/dashboard.rb +1 -1
  31. data/lib/wavefront-cli/derivedmetric.rb +53 -0
  32. data/lib/wavefront-cli/display/alert.rb +1 -1
  33. data/lib/wavefront-cli/display/cloudintegration.rb +1 -1
  34. data/lib/wavefront-cli/display/dashboard.rb +1 -1
  35. data/lib/wavefront-cli/display/derivedmetric.rb +14 -0
  36. data/lib/wavefront-cli/display/event.rb +1 -1
  37. data/lib/wavefront-cli/display/externallink.rb +1 -1
  38. data/lib/wavefront-cli/display/integration.rb +1 -1
  39. data/lib/wavefront-cli/display/maintenancewindow.rb +1 -1
  40. data/lib/wavefront-cli/display/message.rb +1 -1
  41. data/lib/wavefront-cli/display/metric.rb +1 -1
  42. data/lib/wavefront-cli/display/notificant.rb +1 -1
  43. data/lib/wavefront-cli/display/printer/long.rb +1 -1
  44. data/lib/wavefront-cli/display/printer/sparkline.rb +54 -0
  45. data/lib/wavefront-cli/display/printer/terse.rb +1 -1
  46. data/lib/wavefront-cli/display/proxy.rb +1 -1
  47. data/lib/wavefront-cli/display/query.rb +30 -21
  48. data/lib/wavefront-cli/display/report.rb +1 -1
  49. data/lib/wavefront-cli/display/savedsearch.rb +1 -1
  50. data/lib/wavefront-cli/display/source.rb +1 -1
  51. data/lib/wavefront-cli/display/user.rb +1 -1
  52. data/lib/wavefront-cli/display/webhook.rb +1 -1
  53. data/lib/wavefront-cli/display/write.rb +1 -1
  54. data/lib/wavefront-cli/event.rb +1 -1
  55. data/lib/wavefront-cli/externallink.rb +1 -1
  56. data/lib/wavefront-cli/integration.rb +1 -1
  57. data/lib/wavefront-cli/maintenancewindow.rb +1 -1
  58. data/lib/wavefront-cli/message.rb +1 -1
  59. data/lib/wavefront-cli/metric.rb +1 -1
  60. data/lib/wavefront-cli/notificant.rb +1 -1
  61. data/lib/wavefront-cli/opt_handler.rb +1 -1
  62. data/lib/wavefront-cli/proxy.rb +1 -1
  63. data/lib/wavefront-cli/query.rb +1 -1
  64. data/lib/wavefront-cli/savedsearch.rb +1 -1
  65. data/lib/wavefront-cli/source.rb +1 -1
  66. data/lib/wavefront-cli/string.rb +13 -6
  67. data/lib/wavefront-cli/user.rb +1 -1
  68. data/lib/wavefront-cli/version.rb +1 -1
  69. data/lib/wavefront-cli/webhook.rb +1 -1
  70. data/spec/spec_helper.rb +16 -16
  71. data/spec/wavefront-cli/commands/alert_spec.rb +1 -1
  72. data/spec/wavefront-cli/commands/base_spec.rb +1 -1
  73. data/spec/wavefront-cli/commands/cloudintegration_spec.rb +1 -1
  74. data/spec/wavefront-cli/commands/dashboard_spec.rb +1 -1
  75. data/spec/wavefront-cli/commands/derivedmetric_spec.rb +16 -0
  76. data/spec/wavefront-cli/commands/event_spec.rb +1 -1
  77. data/spec/wavefront-cli/commands/link_spec.rb +1 -1
  78. data/spec/wavefront-cli/commands/message_spec.rb +1 -1
  79. data/spec/wavefront-cli/commands/metric_spec.rb +1 -1
  80. data/spec/wavefront-cli/commands/proxy_spec.rb +1 -1
  81. data/spec/wavefront-cli/commands/query_spec.rb +1 -1
  82. data/spec/wavefront-cli/commands/webhook_spec.rb +1 -1
  83. data/spec/wavefront-cli/commands/window_spec.rb +1 -1
  84. data/spec/wavefront-cli/commands/write_spec.rb +1 -1
  85. data/spec/wavefront-cli/derivedmetric_spec.rb +79 -0
  86. data/spec/wavefront-cli/display/base_spec.rb +1 -1
  87. data/spec/wavefront-cli/string_spec.rb +1 -1
  88. data/wavefront-cli.gemspec +1 -1
  89. metadata +17 -8
  90. data/lib/wavefront-cli/output/wavefront.tf +0 -257
@@ -4,7 +4,7 @@ require 'pathname'
4
4
  require_relative(File.join('../../../lib/wavefront-cli/commands',
5
5
  Pathname.new(__FILE__).basename
6
6
  .to_s.sub('_spec.rb', '')))
7
- require_relative './base_spec'
7
+ require_relative 'base_spec'
8
8
 
9
9
  # Test Alert commands and options
10
10
  #
@@ -4,7 +4,7 @@ require 'pathname'
4
4
  require_relative(File.join('../../../lib/wavefront-cli/commands',
5
5
  Pathname.new(__FILE__).basename
6
6
  .to_s.sub('_spec.rb', '')))
7
- require_relative './spec_helper'
7
+ require_relative 'spec_helper'
8
8
 
9
9
  # Test base class for commands
10
10
  #
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require_relative('../../../lib/wavefront-cli/commands/cloudintegration')
4
- require_relative './base_spec'
4
+ require_relative 'base_spec'
5
5
 
6
6
  # Test Cloud Integration commands and options
7
7
  #
@@ -4,7 +4,7 @@ require 'pathname'
4
4
  require_relative(File.join('../../../lib/wavefront-cli/commands',
5
5
  Pathname.new(__FILE__).basename
6
6
  .to_s.sub('_spec.rb', '')))
7
- require_relative './base_spec'
7
+ require_relative 'base_spec'
8
8
 
9
9
  # Test Dashboard commands and options
10
10
  #
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pathname'
4
+ require_relative(File.join('../../../lib/wavefront-cli/commands',
5
+ Pathname.new(__FILE__).basename
6
+ .to_s.sub('_spec.rb', '')))
7
+ require_relative 'base_spec'
8
+
9
+ # Test derived metric commands and options
10
+ #
11
+ class WavefrontCommmandDerivedMetricTest < WavefrontCommmandBaseTest
12
+ def setup
13
+ @wf = WavefrontCommandDerivedmetric.new
14
+ @col_width = 22
15
+ end
16
+ end
@@ -4,7 +4,7 @@ require 'pathname'
4
4
  require_relative(File.join('../../../lib/wavefront-cli/commands',
5
5
  Pathname.new(__FILE__).basename
6
6
  .to_s.sub('_spec.rb', '')))
7
- require_relative './base_spec'
7
+ require_relative 'base_spec'
8
8
 
9
9
  # Test Event commands and options
10
10
  #
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require_relative('../../../lib/wavefront-cli/commands/link')
4
- require_relative './base_spec'
4
+ require_relative 'base_spec'
5
5
 
6
6
  # Test External Link commands and options
7
7
  #
@@ -4,7 +4,7 @@ require 'pathname'
4
4
  require_relative(File.join('../../../lib/wavefront-cli/commands',
5
5
  Pathname.new(__FILE__).basename
6
6
  .to_s.sub('_spec.rb', '')))
7
- require_relative './base_spec'
7
+ require_relative 'base_spec'
8
8
 
9
9
  # Test Message commands and options
10
10
  #
@@ -4,7 +4,7 @@ require 'pathname'
4
4
  require_relative(File.join('../../../lib/wavefront-cli/commands',
5
5
  Pathname.new(__FILE__).basename
6
6
  .to_s.sub('_spec.rb', '')))
7
- require_relative './base_spec'
7
+ require_relative 'base_spec'
8
8
 
9
9
  # Test Metric commands and options
10
10
  #
@@ -4,7 +4,7 @@ require 'pathname'
4
4
  require_relative(File.join('../../../lib/wavefront-cli/commands',
5
5
  Pathname.new(__FILE__).basename
6
6
  .to_s.sub('_spec.rb', '')))
7
- require_relative './base_spec'
7
+ require_relative 'base_spec'
8
8
 
9
9
  # Test Proxy commands and options
10
10
  #
@@ -4,7 +4,7 @@ require 'pathname'
4
4
  require_relative(File.join('../../../lib/wavefront-cli/commands',
5
5
  Pathname.new(__FILE__).basename
6
6
  .to_s.sub('_spec.rb', '')))
7
- require_relative './base_spec'
7
+ require_relative 'base_spec'
8
8
 
9
9
  # Test Query commands and options
10
10
  #
@@ -4,7 +4,7 @@ require 'pathname'
4
4
  require_relative(File.join('../../../lib/wavefront-cli/commands',
5
5
  Pathname.new(__FILE__).basename
6
6
  .to_s.sub('_spec.rb', '')))
7
- require_relative './base_spec'
7
+ require_relative 'base_spec'
8
8
 
9
9
  # Test Webhook commands and options
10
10
  #
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require_relative('../../../lib/wavefront-cli/commands/window')
4
- require_relative './base_spec'
4
+ require_relative 'base_spec'
5
5
 
6
6
  # Test Maintenance Window commands and options
7
7
  #
@@ -4,7 +4,7 @@ require 'pathname'
4
4
  require_relative(File.join('../../../lib/wavefront-cli/commands',
5
5
  Pathname.new(__FILE__).basename
6
6
  .to_s.sub('_spec.rb', '')))
7
- require_relative './base_spec'
7
+ require_relative 'base_spec'
8
8
 
9
9
  # Test Write commands and options
10
10
  #
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ word = 'derivedmetric'
4
+
5
+ require_relative '../spec_helper'
6
+ require_relative "../../lib/wavefront-cli/#{word}"
7
+
8
+ id = '1529938767979'
9
+ bad_id = '>_<'
10
+
11
+ k = WavefrontCli::DerivedMetric
12
+
13
+ describe "#{word} command" do
14
+ missing_creds(word, ['list', "describe #{id}", "delete #{id}",
15
+ "undelete #{id}", "history #{id}"])
16
+ list_tests(word, nil, k)
17
+ cmd_to_call(word, "describe #{id}", { path: "/api/v2/#{word}/#{id}" }, k)
18
+ cmd_to_call(word, "describe -v 7 #{id}",
19
+ { path: "/api/v2/#{word}/#{id}/history/7" }, k)
20
+ cmd_to_call(word, "history #{id}",
21
+ { path: "/api/v2/#{word}/#{id}/history" }, k)
22
+
23
+ it 'deletes with a check on inTrash' do
24
+ stub_request(:get,
25
+ "https://other.wavefront.com/api/v2/#{word}/#{id}")
26
+ .with(headers: { 'Accept': '*/*',
27
+ 'Accept-Encoding':
28
+ 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
29
+ 'Authorization': 'Bearer 0123456789-ABCDEF',
30
+ 'User-Agent': /wavefront.*/ })
31
+ .to_return(status: 200, body: '', headers: {})
32
+ cmd_to_call(word, "delete #{id}",
33
+ { method: :delete, path: "/api/v2/#{word}/#{id}" }, k)
34
+ end
35
+
36
+ cmd_to_call(word, "search id=#{id}",
37
+ { method: :post, path: "/api/v2/search/#{word}",
38
+ body: { limit: 10,
39
+ offset: 0,
40
+ query: [{ key: 'id',
41
+ value: id,
42
+ matchingMethod: 'EXACT' }],
43
+ sort: { field: 'id', ascending: true } },
44
+ headers: JSON_POST_HEADERS }, k)
45
+
46
+ cmd_to_call(word, "undelete #{id}",
47
+ { method: :post, path: "/api/v2/#{word}/#{id}/undelete" }, k)
48
+ invalid_ids(word, ["describe #{bad_id}", "delete #{bad_id}",
49
+ "undelete #{bad_id}"])
50
+ tag_tests(word, id, bad_id, nil, k)
51
+
52
+ cmd_to_call(word, 'create test_dm ts(series)',
53
+ { method: :post, path: '/api/v2/derivedmetric',
54
+ body: { minutes: 5,
55
+ name: 'test_dm',
56
+ includeObsoleteMetrics: false,
57
+ processRateMinutes: 1,
58
+ query: 'ts(series)' },
59
+ headers: JSON_POST_HEADERS }, k)
60
+
61
+ cmd_to_call(word, 'create -i 3 -r 7 -O test_dm ts(series)',
62
+ { method: :post, path: '/api/v2/derivedmetric',
63
+ body: { minutes: 7,
64
+ name: 'test_dm',
65
+ includeObsoleteMetrics: true,
66
+ processRateMinutes: 3,
67
+ query: 'ts(series)' },
68
+ headers: JSON_POST_HEADERS }, k)
69
+
70
+ cmd_to_call(word, 'create -i 3 -T tag1 -T tag2 test_dm ts(series)',
71
+ { method: :post, path: '/api/v2/derivedmetric',
72
+ body: { minutes: 5,
73
+ name: 'test_dm',
74
+ includeObsoleteMetrics: false,
75
+ processRateMinutes: 3,
76
+ tags: ['tag1', 'tag2'],
77
+ query: 'ts(series)' },
78
+ headers: JSON_POST_HEADERS }, k)
79
+ end
@@ -6,7 +6,7 @@ require 'pathname'
6
6
  require_relative(File.join('../../../lib/wavefront-cli/display',
7
7
  Pathname.new(__FILE__).basename
8
8
  .to_s.sub('_spec.rb', '')))
9
- require_relative './spec_helper'
9
+ require_relative 'spec_helper'
10
10
 
11
11
  S_DATA = Map.new
12
12
  S_OPTIONS = { '<id>': 'abc123' }.freeze
@@ -28,7 +28,7 @@ class StringTest < MiniTest::Test
28
28
  pad = "\n" + ' ' * 12
29
29
  assert_equal(" -o, --option PARAMETER a#{pad}rather pointless" \
30
30
  "#{pad}option with a#{pad}needlessly wordy#{pad}" \
31
- "description#{pad}string\n",str.opt_fold(30, 10))
31
+ "description#{pad}string\n", str.opt_fold(30, 10))
32
32
  end
33
33
 
34
34
  def test_fold_options
@@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
23
23
  gem.require_paths = %w(lib)
24
24
 
25
25
  gem.add_dependency 'docopt', '~> 0.6.0'
26
- gem.add_runtime_dependency 'wavefront-sdk', '~> 1.4', '>= 1.4.0'
26
+ gem.add_runtime_dependency 'wavefront-sdk', '~> 1.5', '>= 1.5.0'
27
27
 
28
28
  gem.add_development_dependency 'bundler', '~> 1.3'
29
29
  gem.add_development_dependency 'rake', '~> 12.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wavefront-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Fisher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-10 00:00:00.000000000 Z
11
+ date: 2018-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt
@@ -30,20 +30,20 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.4'
33
+ version: '1.5'
34
34
  - - ">="
35
35
  - !ruby/object:Gem::Version
36
- version: 1.4.0
36
+ version: 1.5.0
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - "~>"
42
42
  - !ruby/object:Gem::Version
43
- version: '1.4'
43
+ version: '1.5'
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 1.4.0
46
+ version: 1.5.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -157,9 +157,11 @@ extra_rdoc_files: []
157
157
  files:
158
158
  - ".codeclimate.yml"
159
159
  - ".gitignore"
160
+ - ".gitlab-ci.yml"
160
161
  - ".rubocop.yml"
161
162
  - ".travis.yml"
162
163
  - Gemfile
164
+ - HISTORY.md
163
165
  - LICENSE.txt
164
166
  - README.md
165
167
  - Rakefile
@@ -172,6 +174,7 @@ files:
172
174
  - lib/wavefront-cli/commands/base.rb
173
175
  - lib/wavefront-cli/commands/cloudintegration.rb
174
176
  - lib/wavefront-cli/commands/dashboard.rb
177
+ - lib/wavefront-cli/commands/derivedmetric.rb
175
178
  - lib/wavefront-cli/commands/event.rb
176
179
  - lib/wavefront-cli/commands/integration.rb
177
180
  - lib/wavefront-cli/commands/link.rb
@@ -190,10 +193,12 @@ files:
190
193
  - lib/wavefront-cli/constants.rb
191
194
  - lib/wavefront-cli/controller.rb
192
195
  - lib/wavefront-cli/dashboard.rb
196
+ - lib/wavefront-cli/derivedmetric.rb
193
197
  - lib/wavefront-cli/display/alert.rb
194
198
  - lib/wavefront-cli/display/base.rb
195
199
  - lib/wavefront-cli/display/cloudintegration.rb
196
200
  - lib/wavefront-cli/display/dashboard.rb
201
+ - lib/wavefront-cli/display/derivedmetric.rb
197
202
  - lib/wavefront-cli/display/event.rb
198
203
  - lib/wavefront-cli/display/externallink.rb
199
204
  - lib/wavefront-cli/display/integration.rb
@@ -203,6 +208,7 @@ files:
203
208
  - lib/wavefront-cli/display/notificant.rb
204
209
  - lib/wavefront-cli/display/printer/base.rb
205
210
  - lib/wavefront-cli/display/printer/long.rb
211
+ - lib/wavefront-cli/display/printer/sparkline.rb
206
212
  - lib/wavefront-cli/display/printer/terse.rb
207
213
  - lib/wavefront-cli/display/proxy.rb
208
214
  - lib/wavefront-cli/display/query.rb
@@ -229,7 +235,6 @@ files:
229
235
  - lib/wavefront-cli/output/hcl/notificant.rb
230
236
  - lib/wavefront-cli/output/json.rb
231
237
  - lib/wavefront-cli/output/ruby.rb
232
- - lib/wavefront-cli/output/wavefront.tf
233
238
  - lib/wavefront-cli/output/yaml.rb
234
239
  - lib/wavefront-cli/proxy.rb
235
240
  - lib/wavefront-cli/query.rb
@@ -250,6 +255,7 @@ files:
250
255
  - spec/wavefront-cli/commands/base_spec.rb
251
256
  - spec/wavefront-cli/commands/cloudintegration_spec.rb
252
257
  - spec/wavefront-cli/commands/dashboard_spec.rb
258
+ - spec/wavefront-cli/commands/derivedmetric_spec.rb
253
259
  - spec/wavefront-cli/commands/event_spec.rb
254
260
  - spec/wavefront-cli/commands/link_spec.rb
255
261
  - spec/wavefront-cli/commands/message_spec.rb
@@ -262,6 +268,7 @@ files:
262
268
  - spec/wavefront-cli/commands/write_spec.rb
263
269
  - spec/wavefront-cli/controller_spec.rb
264
270
  - spec/wavefront-cli/dashboard_spec.rb
271
+ - spec/wavefront-cli/derivedmetric_spec.rb
265
272
  - spec/wavefront-cli/display/base_spec.rb
266
273
  - spec/wavefront-cli/display/printer/base_spec.rb
267
274
  - spec/wavefront-cli/display/printer/long_spec.rb
@@ -303,7 +310,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
303
310
  version: '0'
304
311
  requirements: []
305
312
  rubyforge_project:
306
- rubygems_version: 2.7.6
313
+ rubygems_version: 2.7.7
307
314
  signing_key:
308
315
  specification_version: 4
309
316
  summary: CLI for Wavefront API v2
@@ -317,6 +324,7 @@ test_files:
317
324
  - spec/wavefront-cli/commands/base_spec.rb
318
325
  - spec/wavefront-cli/commands/cloudintegration_spec.rb
319
326
  - spec/wavefront-cli/commands/dashboard_spec.rb
327
+ - spec/wavefront-cli/commands/derivedmetric_spec.rb
320
328
  - spec/wavefront-cli/commands/event_spec.rb
321
329
  - spec/wavefront-cli/commands/link_spec.rb
322
330
  - spec/wavefront-cli/commands/message_spec.rb
@@ -329,6 +337,7 @@ test_files:
329
337
  - spec/wavefront-cli/commands/write_spec.rb
330
338
  - spec/wavefront-cli/controller_spec.rb
331
339
  - spec/wavefront-cli/dashboard_spec.rb
340
+ - spec/wavefront-cli/derivedmetric_spec.rb
332
341
  - spec/wavefront-cli/display/base_spec.rb
333
342
  - spec/wavefront-cli/display/printer/base_spec.rb
334
343
  - spec/wavefront-cli/display/printer/long_spec.rb
@@ -1,257 +0,0 @@
1
- MERP MERP
2
- resource "wavefront_dashboard" "9f8d3f29-d965-4f7e-8473-43571e431b99" {
3
- name = "JPC Website Host"
4
- description = "overview of SmartOS zones"
5
- url = "jpc-webhost"
6
- section = [
7
- { name = "Memory"
8
- row = [
9
- { chart = [
10
- {
11
- units = "B"
12
- name = "Swap Free"
13
- description = "Remember, on Solaris, \"swap\" means backing store, so this is all memory."
14
- source = [
15
- {
16
- scatter_plot_source = "Y"
17
- query_builder_enabled = false
18
- source_description = ""
19
- name = "New Query"
20
- query = "ts(\"tenant.swapresv.value\", env=${env}) - ts(\"tenant.swapresv.usage\", env=${env})"
21
- }]
22
- },
23
- {
24
- units = ""
25
- name = "Free Physical Memory"
26
- source = [
27
- {
28
- scatter_plot_source = "Y"
29
- query_builder_enabled = false
30
- source_description = ""
31
- name = "physical memory"
32
- query = "ts(\"tenant.physicalmem.value\", env=${env}) - ts(\"tenant.physicalmem.usage\", env=${env})"
33
- },
34
- {
35
- scatter_plot_source = "Y"
36
- query_builder_enabled = true
37
- source_description = ""
38
- name = "out of memory"
39
- query = "0"
40
- }]
41
- },
42
- {
43
- units = ""
44
- name = "times over memory"
45
- source = [
46
- {
47
- scatter_plot_source = "Y"
48
- query_builder_enabled = false
49
- source_description = ""
50
- name = "times over memory"
51
- query = "deriv(ts(\"tenant.memory_cap.nover\", env=${env}))"
52
- }]
53
- }]
54
- },
55
- { chart = [
56
- {
57
- units = "B"
58
- name = "Sinatra application memory"
59
- source = [
60
- {
61
- scatter_plot_source = "Y"
62
- query_builder_enabled = false
63
- source_description = ""
64
- name = "New Query"
65
- query = "sum(ts(\"process.memory.pr_rssize.*\", svc=\"svc:/application/sinatra/*\" and env=${env}), svc)"
66
- }]
67
- },
68
- {
69
- units = ""
70
- name = "top memory consumers"
71
- source = [
72
- {
73
- scatter_plot_source = "Y"
74
- query_builder_enabled = false
75
- source_description = ""
76
- name = "by process name"
77
- query = "sum(ts(\"process.memory.pr_rssize.*\", env=${env}), metrics)"
78
- }]
79
- }]
80
- }]
81
- },
82
- { name = "nginx"
83
- row = [
84
- { chart = [
85
- {
86
- units = "req/s"
87
- name = "\"200\" HTTP requests"
88
- source = [
89
- {
90
- scatter_plot_source = "Y"
91
- query_builder_enabled = false
92
- source_description = ""
93
- name = "Query"
94
- query = "rate(ts(\"nginx.code.200\"))"
95
- }]
96
- },
97
- {
98
- units = "ms"
99
- name = "request latency"
100
- source = [
101
- {
102
- scatter_plot_source = "Y"
103
- query_builder_enabled = false
104
- source_description = ""
105
- name = "total response time"
106
- query = "ts(\"nginx.time.response.*\")"
107
- },
108
- {
109
- scatter_plot_source = "Y"
110
- query_builder_enabled = false
111
- source_description = ""
112
- name = "upstream response time"
113
- query = "ts(\"nginx.time.upstream_response.*\")"
114
- }]
115
- },
116
- {
117
- units = "req/s"
118
- name = "HTTP Errors"
119
- source = [
120
- {
121
- scatter_plot_source = "Y"
122
- query_builder_enabled = false
123
- source_description = ""
124
- name = "40x"
125
- query = "ceil(rate(ts(\"nginx.code.4*\")))"
126
- },
127
- {
128
- scatter_plot_source = "Y"
129
- query_builder_enabled = false
130
- source_description = ""
131
- name = "50x"
132
- query = "ceil(rate(ts(\"nginx.code.5*\")))"
133
- }]
134
- }]
135
- }]
136
- },
137
- { name = "Processes and Services"
138
- row = [
139
- { chart = [
140
- {
141
- units = "processes"
142
- name = "processes"
143
- description = "number active processes in zone"
144
- source = [
145
- {
146
- scatter_plot_source = "Y"
147
- query_builder_enabled = true
148
- source_description = ""
149
- name = "running processes"
150
- query = "ts(\"tenant.nprocs.usage\", env=${env})"
151
- }]
152
- },
153
- {
154
- units = "services"
155
- name = "Service States"
156
- description = "count of services in each possible state. Disabled service are not shown,"
157
- source = [
158
- {
159
- scatter_plot_source = "Y"
160
- query_builder_enabled = false
161
- source_description = ""
162
- name = "New Query"
163
- query = "ts(\"smf.svcs.*\", env=${env})"
164
- }]
165
- }]
166
- }]
167
- },
168
- { name = "Network"
169
- row = [
170
- { chart = [
171
- {
172
- units = "bytes"
173
- name = "Network In"
174
- source = [
175
- {
176
- scatter_plot_source = "Y"
177
- query_builder_enabled = false
178
- source_description = ""
179
- name = "New Query"
180
- query = "deriv(ts(\"network.*.net0.rbytes64\", env=${env}))"
181
- }]
182
- },
183
- {
184
- units = "bytes"
185
- name = "Network Out"
186
- source = [
187
- {
188
- scatter_plot_source = "Y"
189
- query_builder_enabled = false
190
- source_description = ""
191
- name = "network out"
192
- query = "deriv(ts(\"network.*.net0.obytes64\", env=${env}))"
193
- }]
194
- }]
195
- },
196
- { chart = [
197
- {
198
- units = "s"
199
- name = "Puppet Run Time"
200
- source = [
201
- {
202
- scatter_plot_source = "Y"
203
- query_builder_enabled = false
204
- source_description = ""
205
- name = "time"
206
- query = "ts(\"puppet.time.*\", env=${env})"
207
- }]
208
- },
209
- {
210
- units = "Units"
211
- name = "Puppet Changes"
212
- description = ""
213
- source = [
214
- {
215
- scatter_plot_source = "Y"
216
- query_builder_enabled = false
217
- source_description = ""
218
- name = "New Query"
219
- query = "ts(\"puppet.changes.total\")"
220
- }]
221
- }]
222
- }]
223
- },
224
- { name = "Page Impressions"
225
- row = [
226
- { chart = [
227
- {
228
- units = ""
229
- name = "Most read posts"
230
- source = [
231
- {
232
- scatter_plot_source = "Y"
233
- query_builder_enabled = false
234
- source_description = ""
235
- name = "Query"
236
- query = "sum(ts(\"nginx.code.200\", vhost=sysdef.xyz and path=\"/post/*\"), pointTags)"
237
- }]
238
- }]
239
- },
240
- { chart = [
241
- {
242
- units = ""
243
- name = "most viewed pieces"
244
- description = ""
245
- source = [
246
- {
247
- scatter_plot_source = "Y"
248
- query_builder_enabled = false
249
- source_description = ""
250
- name = "Query"
251
- query = "sum(ts(\"nginx.code.200\", vhost=\"rdfisher.co.uk\" and path=\"/piece/*\"), pointTags)"
252
- }]
253
- }]
254
- }]
255
- }]
256
- tags = []
257
- }