Class: WavefrontCommandWrite

Inherits:
WavefrontCommandBase show all
Defined in:
lib/wavefront-cli/commands/write.rb

Overview

Define the write command.

Instance Method Summary collapse

Methods inherited from WavefrontCommandBase

#commands, #common_options, #docopt, #global_options, #opt_row, #option_column_width, #options, #sdk_class, #sdk_file, #tag_commands, #word

Instance Method Details

#_commandsObject



10
11
12
13
14
15
16
# File 'lib/wavefront-cli/commands/write.rb', line 10

def _commands
  ['point [-DnV] [-c file] [-P profile] [-E proxy] [-t time] ' \
   '[-p port] [-H host] [-T tag...] <metric> <value>',
   'file [-DnV] [-c file] [-P profile] [-E proxy] [-H host] ' \
   '[-p port] [-F format] [-m metric] [-T tag...] ' \
   '[-r rate] <file>']
end

#_optionsObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/wavefront-cli/commands/write.rb', line 18

def _options
  ['-E, --proxy=URI            proxy endpoint',
   '-t, --time=TIME            time of data point (omit to use ' \
   'current time)',
   '-H, --host=STRING          source host', \
   '-p, --port=INT             Wavefront proxy port',
   '-T, --tag=TAG              point tag in key=value form',
   '-F, --infileformat=STRING  format of input file or stdin',
   '-m, --metric=STRING        the metric path to which contents of ' \
   'a file will be assigned. If the file contains a metric name, ' \
   'the two will be dot-concatenated, with this value first',
   '-r, --rate=INTEGER         throttle point sending to this many ' \
   'points per second']
end

#descriptionObject



6
7
8
# File 'lib/wavefront-cli/commands/write.rb', line 6

def description
  'send data to a Wavefront proxy'
end

#postscriptObject



33
34
35
36
37
38
# File 'lib/wavefront-cli/commands/write.rb', line 33

def postscript
  'Files are whitespace separated, and fields can be defined ' \
  "with the '-F' option.  Use 't' for timestamp; 'm' for metric " \
  "name; 'v' for value, 's' for source, and 'T' for tags. Put 'T' " \
  'last.'.cmd_fold(TW, 0)
end