wavefront-cli 2.6.0 → 2.7.0

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: b7e6e0c9d8fddd6df88fbd3f2f3f8410a74f508627b818b95e5eccaeafdcaf06
4
- data.tar.gz: ac3fabdf56be3ce5585802ea5459d66a0a37471171460dd7a30bc22cb07d0992
3
+ metadata.gz: c6829c82ead73104270f19e4f3c06084719720afdc64233f25683940155cef12
4
+ data.tar.gz: 40530d75b0b5ceb505a5afe9268bcb26036c92cc25114f664ba97662a5639506
5
5
  SHA512:
6
- metadata.gz: 5a29eb0de9db686d9a4cd4c32beb3c17379a9385fc5532d398af6553aa33406ad06b4637752f5555cc3482f917022ae3ea08f48bc27ff1f4c361048444be1948
7
- data.tar.gz: 49d870efddc368949dc08e14da1c740e6200255cb667379918b50ec6ab90dca6b35c2b4bc69226fe2ed55df9a8322c88bedda58081acd31f4d6408306a970d14
6
+ metadata.gz: 072f0f0bbd20bce99729bf3ff4e1a0a64fa34599677be8972b00c7ce48c8ac0fa88c6e0eb45f95b8f17e7e77039d1c70c4e03aff37f0354e1e587063a5ae4bbb
7
+ data.tar.gz: 88c1dcd21de080393d131c381c28d98da6624c4a866e4d84ee4694e16ff555f067df52c5993ac33599088015d8e8d70506fd1dbcd59d4095a6a7a38947c5a060
data/HISTORY.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.7.0 (04/07/2018)
4
+
5
+ * Add a `-i` option to the `report` command, to send delta metrics.
6
+ * Fix delta metrics on the `write` command.
7
+
3
8
  ## 2.6.0 (27/06/2018)
4
9
 
5
10
  * Anything which can be imported can be imported from STDIN. The CLI
@@ -20,7 +20,7 @@ module WavefrontCli
20
20
  end
21
21
 
22
22
  def send_point(p)
23
- wf.write(p)
23
+ call_write(p)
24
24
  rescue Wavefront::Exception::InvalidEndpoint
25
25
  abort "could not speak to proxy #{options[:proxy]}:#{options[:port]}."
26
26
  end
@@ -42,17 +42,23 @@ module WavefrontCli
42
42
  process_line(l)
43
43
  end
44
44
 
45
- wf.write(data)
45
+ call_write(data)
46
46
  end
47
47
  end
48
48
 
49
+ # A wrapper which lets us send normal points or deltas
50
+ #
51
+ def call_write(data)
52
+ options[:delta] ? wf.write_delta(data) : wf.write(data)
53
+ end
54
+
49
55
  # Read from standard in and stream points through an open
50
56
  # socket. If the user hits ctrl-c, close the socket and exit
51
57
  # politely.
52
58
  #
53
59
  def read_stdin
54
60
  open_connection
55
- STDIN.each_line { |l| wf.write(process_line(l.strip), false) }
61
+ STDIN.each_line { |l| call_write(process_line(l.strip), false) }
56
62
  close_connection
57
63
  rescue SystemExit, Interrupt
58
64
  puts 'ctrl-c. Exiting.'
@@ -8,8 +8,9 @@ class WavefrontCommandReport < WavefrontCommandBase
8
8
  end
9
9
 
10
10
  def _commands
11
- ["point #{CMN} [-s time] [-H host] [-T tag...] <metric> <value>",
12
- "file #{CMN} [-H host] [-F format] [-m metric] [-T tag...] <file>"]
11
+ ["point #{CMN} [-s time] [-H host] [-T tag...] [-iq] <metric> <value>",
12
+ "file #{CMN} [-H host] [-F format] [-m metric] [-T tag...] " \
13
+ '[-iq] <file>']
13
14
  end
14
15
 
15
16
  def _options
@@ -22,14 +23,15 @@ class WavefrontCommandReport < WavefrontCommandBase
22
23
  '-m, --metric=STRING the metric path to which contents of ' \
23
24
  'a file will be assigned. If the file contains a metric name, ' \
24
25
  'the two will be dot-concatenated, with this value first',
26
+ '-i, --delta increment metric by given value',
25
27
  "-q, --quiet don't report the points sent summary " \
26
28
  '(unless there were errors)']
27
29
  end
28
30
 
29
31
  def postscript
30
32
  'Files are whitespace separated, and fields can be defined ' \
31
- "with the '-F' option. Use 't' for timestamp; 'm' for metric " \
32
- "name; 'v' for value, 's' for source, and 'T' for tags. Put 'T' " \
33
+ "with the '-F' option. Use 't' for timestamp, 'm' for metric " \
34
+ "name, 'v' for value, 's' for source, and 'T' for tags. Put 'T' " \
33
35
  'last.'.cmd_fold(TW, 0)
34
36
  end
35
37
  end
@@ -11,9 +11,9 @@ class WavefrontCommandWrite < WavefrontCommandBase
11
11
  ['point [-DnViq] [-c file] [-P profile] [-E proxy] [-t time] ' \
12
12
  '[-p port] [-H host] [-T tag...] <metric> <value>',
13
13
  'file [-DnViq] [-c file] [-P profile] [-E proxy] [-H host] ' \
14
- '[-p port] [-F format] [-m metric] [-T tag...] ' \
15
- '[-r rate] <file>']
14
+ '[-p port] [-F format] [-m metric] [-T tag...] <file>']
16
15
  end
16
+
17
17
  def _options
18
18
  ['-E, --proxy=URI proxy endpoint',
19
19
  '-t, --time=TIME time of data point (omit to use ' \
@@ -27,15 +27,13 @@ class WavefrontCommandWrite < WavefrontCommandBase
27
27
  'the two will be dot-concatenated, with this value first',
28
28
  '-i, --delta increment metric by given value',
29
29
  "-q, --quiet don't report the points sent summary " \
30
- '(unless there were errors)',
31
- '-r, --rate=INTEGER throttle point sending to this many ' \
32
- 'points per second']
30
+ '(unless there were errors)']
33
31
  end
34
32
 
35
33
  def postscript
36
34
  'Files are whitespace separated, and fields can be defined ' \
37
- "with the '-F' option. Use 't' for timestamp; 'm' for metric " \
38
- "name; 'v' for value, 's' for source, and 'T' for tags. Put 'T' " \
35
+ "with the '-F' option. Use 't' for timestamp, 'm' for metric " \
36
+ "name, 'v' for value, 's' for source, and 'T' for tags. Put 'T' " \
39
37
  'last.'.cmd_fold(TW, 0)
40
38
  end
41
39
  end
@@ -3,7 +3,7 @@ require_relative 'base_write'
3
3
  module WavefrontCli
4
4
  class Report < BaseWrite
5
5
  def send_point(p)
6
- wf.write(p)
6
+ call_write(p)
7
7
  rescue Wavefront::Exception::InvalidEndpoint
8
8
  abort 'could not speak to API'
9
9
  end
@@ -1 +1 @@
1
- WF_CLI_VERSION = '2.6.0'.freeze
1
+ WF_CLI_VERSION = '2.7.0'.freeze
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.6.0
4
+ version: 2.7.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-06-27 00:00:00.000000000 Z
11
+ date: 2018-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt