influxdb-cli 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +1 -1
- data/bin/influxdb-cli +9 -1
- data/influxdb-cli.gemspec +0 -1
- data/lib/influxdb_client/client.rb +4 -1
- data/lib/influxdb_client/version.rb +1 -1
- data/spec/influxdb_client/client_spec.rb +2 -2
- data/spec/spec_helper.rb +0 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ce4b04c848405e7568e3917616625f6ebdb3b44
|
4
|
+
data.tar.gz: 6119394e1cc3fbb8aa623ef9c771bb91c8dde217
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b305986de06fff53402acb46f62e2f6d12ce7f0cd1344c7de3d90cdaa9417e86017f23649968eb1ad7787424dcf3378070b57785d25beb90d2e3136e2baae64
|
7
|
+
data.tar.gz: 7739e71d2dfb2ad8da8a08b210f3de4ee7c97c44a2a745c64d867ec94d3bbadb63d209dff69dfd5793637ffd0003dd4b6020c3cb62019ced4840e50085cec930
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/bin/influxdb-cli
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# encoding: utf-8
|
2
3
|
|
3
4
|
require 'rubygems'
|
4
5
|
require 'influxdb'
|
@@ -21,11 +22,18 @@ class InfluxDBClientTasks < Thor
|
|
21
22
|
method_option :password, :default => 'root', :desc => 'Password', :aliases => '-p'
|
22
23
|
method_option :database, :default => 'db', :desc => 'Database', :aliases => '-d'
|
23
24
|
method_option :pretty, :default => nil, :desc => 'Human readable times (UTC)'
|
25
|
+
method_option :ssl, :default => false, :desc => 'Connect using TLS/SSL', :type => :boolean
|
24
26
|
|
25
27
|
def db
|
26
28
|
puts "Connecting to #{options.inspect}"
|
27
29
|
@@db ||= InfluxDB::Client.new options[:database],
|
28
|
-
{
|
30
|
+
{
|
31
|
+
username: options[:username],
|
32
|
+
password: options[:password],
|
33
|
+
host: options[:host],
|
34
|
+
port: options[:port],
|
35
|
+
use_ssl: options[:ssl]
|
36
|
+
}
|
29
37
|
InfluxDBClient::Client.pretty = options[:pretty]
|
30
38
|
puts '✔ ready'
|
31
39
|
end
|
data/influxdb-cli.gemspec
CHANGED
@@ -48,7 +48,10 @@ module InfluxDBClient
|
|
48
48
|
def self.generate_table(series, result_series)
|
49
49
|
headings = result_series.first.keys
|
50
50
|
rows = result_series.map do |row|
|
51
|
-
|
51
|
+
if @pretty
|
52
|
+
microseconds_with_frac = "#{row['time'] / 1000}.#{row['time'] % 100}".to_f
|
53
|
+
row['time'] = Time.at(microseconds_with_frac).utc.strftime('%Y-%m-%d %H:%M:%S.%L')
|
54
|
+
end
|
52
55
|
row.values
|
53
56
|
end
|
54
57
|
|
@@ -56,10 +56,10 @@ module InfluxDBClient
|
|
56
56
|
after(:all) { described_class.pretty = false }
|
57
57
|
it 'generates tables' do
|
58
58
|
expect(Terminal::Table).to receive(:new).
|
59
|
-
with(title: :series1, headings: %w[time value1 value2], rows: [['2013-12-17 13:42:03
|
59
|
+
with(title: :series1, headings: %w[time value1 value2], rows: [['2013-12-17 13:42:03.160', 1, 2]])
|
60
60
|
|
61
61
|
expect(Terminal::Table).to receive(:new).
|
62
|
-
with(title: :series2, headings: %w[time value3 value4 value5 value6], rows: [['2014-03-11 15:40:47
|
62
|
+
with(title: :series2, headings: %w[time value3 value4 value5 value6], rows: [['2014-03-11 15:40:47.549', 3, 4, nil, nil], ['2014-03-12 22:45:58.799', nil, 4, 5, 6]])
|
63
63
|
|
64
64
|
described_class.print_tabularize(result)
|
65
65
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: influxdb-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pablo Cantero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: influxdb
|
@@ -122,20 +122,6 @@ dependencies:
|
|
122
122
|
- - '>='
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: pry-byebug
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - '>='
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - '>='
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
139
125
|
description: Ruby CLI for InfluxDB
|
140
126
|
email:
|
141
127
|
- pablo@pablocantero.com
|