influxer 1.2.0 → 1.4.0

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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/{Changelog.md → CHANGELOG.md} +26 -50
  3. data/{MIT-LICENSE → LICENSE.txt} +1 -1
  4. data/README.md +83 -24
  5. data/lib/influxer/client.rb +1 -1
  6. data/lib/influxer/config.rb +16 -3
  7. data/lib/influxer/metrics/metrics.rb +1 -1
  8. data/lib/influxer/metrics/relation/where_clause.rb +6 -0
  9. data/lib/influxer/metrics/relation.rb +16 -4
  10. data/lib/influxer/metrics/scoping/current_scope.rb +16 -2
  11. data/lib/influxer/rails/client.rb +5 -5
  12. data/lib/influxer/version.rb +1 -1
  13. data/lib/influxer.rb +4 -0
  14. metadata +13 -43
  15. data/.gitignore +0 -37
  16. data/.rspec +0 -2
  17. data/.rubocop.yml +0 -57
  18. data/.travis.yml +0 -15
  19. data/Gemfile +0 -13
  20. data/Rakefile +0 -15
  21. data/bin/console +0 -8
  22. data/gemfiles/rails32.gemfile +0 -7
  23. data/gemfiles/rails42.gemfile +0 -7
  24. data/gemfiles/rails5.gemfile +0 -7
  25. data/gemfiles/rails6.gemfile +0 -7
  26. data/influxer.gemspec +0 -40
  27. data/spec/cases/points_spec.rb +0 -36
  28. data/spec/cases/write_points_spec.rb +0 -85
  29. data/spec/client_spec.rb +0 -46
  30. data/spec/fixtures/empty_result.json +0 -21
  31. data/spec/fixtures/single_series.json +0 -29
  32. data/spec/metrics/metrics_spec.rb +0 -329
  33. data/spec/metrics/relation_spec.rb +0 -467
  34. data/spec/metrics/scoping_spec.rb +0 -66
  35. data/spec/model/user_spec.rb +0 -46
  36. data/spec/spec_helper.rb +0 -63
  37. data/spec/support/metrics/action_metrics.rb +0 -5
  38. data/spec/support/metrics/custom_metrics.rb +0 -6
  39. data/spec/support/metrics/dummy_metrics.rb +0 -12
  40. data/spec/support/metrics/user_metrics.rb +0 -6
  41. data/spec/support/metrics/visits_metrics.rb +0 -8
  42. data/spec/support/shared_contexts/shared_precision.rb +0 -19
  43. data/spec/support/shared_contexts/shared_query.rb +0 -16
  44. 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