echo_cli 0.6.7 → 0.6.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +66 -20
- data/lib/echo_cli/cli.rb +1 -1
- data/lib/echo_cli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 095ca160f431f4387213366ef4666d663070ba0b
|
4
|
+
data.tar.gz: 5957c858d0157d75dfdb3f2ddb0f544b318c8c2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e58c1ce6e849abe3d81e3861de59408963141394f9d73540dcfef9814eec1b8bfd36a630f11cfdf6f0bbac01229da8cd243108a780eec8b953103539b41b440
|
7
|
+
data.tar.gz: cfb233798dd020ca0509a80c488b6d478e018d45ac1c2b0b96425b37932cacb354504c0a4c502703ad0f74cb58faaaf47ae241dc1e2673a9701878e4b9703c4d
|
data/README.md
CHANGED
@@ -1,9 +1,5 @@
|
|
1
1
|
# Echo_cli
|
2
2
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/echo_cli`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
7
3
|
## Installation
|
8
4
|
|
9
5
|
Ensure git and rbenv (or rvm) are installed on your machine:
|
@@ -11,9 +7,9 @@ Ensure git and rbenv (or rvm) are installed on your machine:
|
|
11
7
|
Install rbenv:
|
12
8
|
|
13
9
|
```bash
|
14
|
-
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
|
15
|
-
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
|
16
|
-
~/.rbenv/bin/rbenv init
|
10
|
+
$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
|
11
|
+
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
|
12
|
+
$ ~/.rbenv/bin/rbenv init
|
17
13
|
```
|
18
14
|
|
19
15
|
See more about rbenv here: https://github.com/rbenv/rbenv
|
@@ -21,13 +17,13 @@ See more about rbenv here: https://github.com/rbenv/rbenv
|
|
21
17
|
Install 'echo_cli':
|
22
18
|
|
23
19
|
```bash
|
24
|
-
gem install echo_cli
|
20
|
+
$ gem install echo_cli
|
25
21
|
```
|
26
22
|
|
27
23
|
Test the installation to ensure it is working properly (no errors should occur if the installation was successful):
|
28
24
|
|
29
25
|
```bash
|
30
|
-
echo_cli
|
26
|
+
$ echo_cli
|
31
27
|
```
|
32
28
|
|
33
29
|
## Usage
|
@@ -35,16 +31,60 @@ echo_cli
|
|
35
31
|
View available echo_cli commands and their short descriptions:
|
36
32
|
|
37
33
|
```bash
|
38
|
-
echo_cli
|
34
|
+
$ echo_cli
|
39
35
|
```
|
40
36
|
|
41
37
|
View a command's long description and an example of its use:
|
42
38
|
|
43
39
|
```bash
|
44
|
-
echo_cli help [COMMAND]
|
40
|
+
$ echo_cli help [COMMAND]
|
45
41
|
```
|
46
42
|
|
43
|
+
### Commands
|
44
|
+
|
45
|
+
#### post
|
46
|
+
```bash
|
47
|
+
$ echo_cli post <IP> '<metric>' {number} {-q}
|
48
|
+
```
|
49
|
+
Parameters:
|
50
|
+
|
51
|
+
`<IP>`: (required) specifies the StatsD endpoint you are attempting to post a metric to
|
52
|
+
|
53
|
+
`'<metric>'`: (required) the metric name, as well as any tags, and data value and data type to be posted to StatsD
|
54
|
+
|
55
|
+
|
56
|
+
`{number}`: (optional) the number of posts to occur, e.g. a number value of '10' would post the metric 10 times to the StatsD server
|
57
|
+
|
58
|
+
|
59
|
+
`{-q}`: (optional) does an automatic query of OpenTSDB immediately following the successful post of the metric to ensure the data transfer between StatsD and OpenTSDB. This option requires approx. 15 seconds to complete, as data flush and HA require ~15 seconds
|
60
|
+
|
61
|
+
####query
|
62
|
+
```bash
|
63
|
+
$ echo_cli query <IP> '<metric>' <time_start> <time_end> {-v}
|
64
|
+
```
|
65
|
+
Parameters:
|
47
66
|
|
67
|
+
`<IP>`: (required) specifies the OpenTSDB endpoint you are attempting to query
|
68
|
+
|
69
|
+
`'<metric>'`: (required) the metric name, including any tags, with which the query for OpenTSDB will be constructed
|
70
|
+
|
71
|
+
`<time_start>`: (required) the start of the range you are attempting to query in seconds from January 1, 1970 (epoch time)
|
72
|
+
|
73
|
+
`<time_end>`: (required) the end of the range you are attempting to query in seconds from January 1, 1970 (epoch time)
|
74
|
+
|
75
|
+
`{-v}`: (optional) verbosely prints the status code and response body of the query
|
76
|
+
|
77
|
+
####quick_query
|
78
|
+
```bash
|
79
|
+
$ echo_cli quick_query <IP> '<metric>' <range>
|
80
|
+
```
|
81
|
+
Parameters:
|
82
|
+
|
83
|
+
`<IP>`: (required) specifies the OpenTSDB endpoint you are attempting to query
|
84
|
+
|
85
|
+
`'<metric>'`: (required) the metric name, including any tags, with which the query for OpenTSDB will be constructed
|
86
|
+
|
87
|
+
`<range>`: (required) the time, in seconds from the current time (epoch time) that you would like to query, e.g. a 'range' value of 300 would query OpenTSDB for the specified metric in the last 5 minutes of time-series data
|
48
88
|
|
49
89
|
## Development
|
50
90
|
|
@@ -53,17 +93,23 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
53
93
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
54
94
|
|
55
95
|
```bash
|
56
|
-
git add .
|
57
|
-
git commit -m
|
58
|
-
git push
|
96
|
+
$ git add .
|
97
|
+
$ git commit -m
|
98
|
+
$ git push
|
59
99
|
|
60
|
-
gem install gem-release
|
61
|
-
gem bump minor/major
|
62
|
-
rake build
|
63
|
-
rake install
|
64
|
-
rake release
|
100
|
+
$ gem install gem-release
|
101
|
+
$ gem bump minor/major
|
102
|
+
$ rake build
|
103
|
+
$ rake install
|
104
|
+
$ rake release
|
65
105
|
|
66
|
-
gem install echo_cli
|
106
|
+
$ gem install echo_cli
|
107
|
+
```
|
108
|
+
|
109
|
+
#### Testing
|
110
|
+
```bash
|
111
|
+
$ gem install webmock
|
112
|
+
$ ruby test/echo_cli_test.rb
|
67
113
|
```
|
68
114
|
|
69
115
|
## Contributing
|
data/lib/echo_cli/cli.rb
CHANGED
data/lib/echo_cli/version.rb
CHANGED