influxer 1.2.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{Changelog.md → CHANGELOG.md} +26 -50
- data/{MIT-LICENSE → LICENSE.txt} +1 -1
- data/README.md +83 -24
- data/lib/influxer/client.rb +1 -1
- data/lib/influxer/config.rb +16 -3
- data/lib/influxer/metrics/metrics.rb +1 -1
- data/lib/influxer/metrics/relation/where_clause.rb +6 -0
- data/lib/influxer/metrics/relation.rb +16 -4
- data/lib/influxer/metrics/scoping/current_scope.rb +16 -2
- data/lib/influxer/rails/client.rb +5 -5
- data/lib/influxer/version.rb +1 -1
- data/lib/influxer.rb +4 -0
- metadata +13 -43
- data/.gitignore +0 -37
- data/.rspec +0 -2
- data/.rubocop.yml +0 -57
- data/.travis.yml +0 -15
- data/Gemfile +0 -13
- data/Rakefile +0 -15
- data/bin/console +0 -8
- data/gemfiles/rails32.gemfile +0 -7
- data/gemfiles/rails42.gemfile +0 -7
- data/gemfiles/rails5.gemfile +0 -7
- data/gemfiles/rails6.gemfile +0 -7
- data/influxer.gemspec +0 -40
- data/spec/cases/points_spec.rb +0 -36
- data/spec/cases/write_points_spec.rb +0 -85
- data/spec/client_spec.rb +0 -46
- data/spec/fixtures/empty_result.json +0 -21
- data/spec/fixtures/single_series.json +0 -29
- data/spec/metrics/metrics_spec.rb +0 -329
- data/spec/metrics/relation_spec.rb +0 -467
- data/spec/metrics/scoping_spec.rb +0 -66
- data/spec/model/user_spec.rb +0 -46
- data/spec/spec_helper.rb +0 -63
- data/spec/support/metrics/action_metrics.rb +0 -5
- data/spec/support/metrics/custom_metrics.rb +0 -6
- data/spec/support/metrics/dummy_metrics.rb +0 -12
- data/spec/support/metrics/user_metrics.rb +0 -6
- data/spec/support/metrics/visits_metrics.rb +0 -8
- data/spec/support/shared_contexts/shared_precision.rb +0 -19
- data/spec/support/shared_contexts/shared_query.rb +0 -16
- data/spec/support/user.rb +0 -16
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
shared_context "precision:seconds", precision: :s do
|
4
|
-
around do |ex|
|
5
|
-
old_precision = Influxer.config.time_precision
|
6
|
-
Influxer.config.time_precision = "s"
|
7
|
-
ex.run
|
8
|
-
Influxer.config.time_precision = old_precision
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
shared_context "with_duration_suffix", duration_suffix: true do
|
13
|
-
around do |ex|
|
14
|
-
old_duration = Influxer.config.time_duration_suffix_enabled
|
15
|
-
Influxer.config.time_duration_suffix_enabled = true
|
16
|
-
ex.run
|
17
|
-
Influxer.config.time_duration_suffix_enabled = old_duration
|
18
|
-
end
|
19
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
shared_context "stub_query", :query do
|
4
|
-
let(:client) { Influxer.client }
|
5
|
-
|
6
|
-
before do
|
7
|
-
# Stub all query methods
|
8
|
-
allow_any_instance_of(InfluxDB::Client).to receive(:query) do |_, sql|
|
9
|
-
sql
|
10
|
-
end
|
11
|
-
|
12
|
-
allow_any_instance_of(InfluxDB::Client).to receive(:time_precision)
|
13
|
-
|
14
|
-
allow_any_instance_of(InfluxDB::Client).to receive(:post)
|
15
|
-
end
|
16
|
-
end
|
data/spec/support/user.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
ActiveRecord::Schema.define do
|
4
|
-
create_table :users do |t|
|
5
|
-
t.string :email
|
6
|
-
t.integer :age
|
7
|
-
t.integer :gender
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
class User < ActiveRecord::Base
|
12
|
-
has_metrics
|
13
|
-
has_metrics :visits_metrics, class_name: "VisitsMetrics", inherits: [:gender, :age]
|
14
|
-
has_metrics :action_metrics, class_name: "ActionMetrics", foreign_key: :user
|
15
|
-
has_metrics :custom_metrics, class_name: "CustomMetrics", foreign_key: nil
|
16
|
-
end
|