influxdb-cli 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: c973d4bc6e8ab8bd0671edabb94494404fff84ee
4
- data.tar.gz: cd28988ee12a4ca03682f1a9ecef55865c13deb6
3
+ metadata.gz: 6ce4b04c848405e7568e3917616625f6ebdb3b44
4
+ data.tar.gz: 6119394e1cc3fbb8aa623ef9c771bb91c8dde217
5
5
  SHA512:
6
- metadata.gz: 8ef30a9b139ad42ea041d8622ea9287dfab0e0b1064ff3a68b4096c1415576c82dcffe9bb4cfb9a84663b4cc8a9312aa4cb3d13a242693dee99ac694c2a3f74e
7
- data.tar.gz: e167e953a7ae1ad706c8d803ca8284781b4f3b2c58b29ce415d8be17e8b9f04845d236ca5e498c13b4be62f6835dec0c153143c50422bd09ca23de9eb5192a89
6
+ metadata.gz: 7b305986de06fff53402acb46f62e2f6d12ce7f0cd1344c7de3d90cdaa9417e86017f23649968eb1ad7787424dcf3378070b57785d25beb90d2e3136e2baae64
7
+ data.tar.gz: 7739e71d2dfb2ad8da8a08b210f3de4ee7c97c44a2a745c64d867ec94d3bbadb63d209dff69dfd5793637ffd0003dd4b6020c3cb62019ced4840e50085cec930
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ influxdb.log
@@ -6,7 +6,7 @@ rvm:
6
6
  # - 2.1.0
7
7
  # - ruby-head
8
8
  - jruby-19mode
9
- - jruby-head
9
+ # - jruby-head
10
10
 
11
11
  notifications:
12
12
  email:
@@ -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
- { username: options[:username], password: options[:password], host: options[:host], port: options[:port] }
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
@@ -25,6 +25,5 @@ Gem::Specification.new do |gem|
25
25
  gem.add_development_dependency 'rspec'
26
26
  gem.add_development_dependency 'bundler'
27
27
  gem.add_development_dependency 'rake'
28
- gem.add_development_dependency 'pry-byebug'
29
28
  end
30
29
 
@@ -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
- row['time'] = Time.at(row['time'] / 1000).utc.to_s if @pretty
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
 
@@ -1,3 +1,3 @@
1
1
  module InfluxDBClient
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
@@ -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 UTC', 1, 2]])
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 UTC', 3, 4, nil, nil], ['2014-03-12 22:45:58 UTC', nil, 4, 5, 6]])
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
@@ -1,7 +1,6 @@
1
1
  require 'rspec'
2
2
  require 'fileutils'
3
3
  require 'tempfile'
4
- require 'pry-byebug'
5
4
 
6
5
  Dir['../lib/**/*.rb'].each &method(:require)
7
6
 
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.2
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-03-29 00:00:00.000000000 Z
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