rails_local_analytics 0.2.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/rails_local_analytics/version.rb +1 -1
- data/lib/rails_local_analytics.rb +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e1f4be59a2ab3441a9797c4e903262deb94e88f6e0185e18e76675ce3c0c494
|
4
|
+
data.tar.gz: b64c1f23ff32b3ecf058e972734264b2f435ea09e2db406021b81f5d6bef304b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6c5290db60c958fbf9fabfd7f65fd9f82fd3a7c8ff39a99aeb2c929e21803fdfac703ae471282874f17fa5bd2c4a5323291275a56e771c244eae784e2de74ba
|
7
|
+
data.tar.gz: be174afa37617cd178bc1286778384590feda9b7dcd9b856a84e11623c7f6b6995b2d7704d4bbfe82dff3c20803bd74e5ed879f384ec6932a34d51e3a3b30e4f
|
data/README.md
CHANGED
@@ -73,7 +73,7 @@ class CreateAnalyticsTables < ActiveRecord::Migration[6.0]
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
```
|
76
|
-
The reason we store our
|
76
|
+
The reason we store our analytics in two separate tables to keep the cardinality of our data low. You are permitted to store everything in only one table but I recommend you try the 2 table approach first and see if it meets your needs. See the performance optimization section for more details.
|
77
77
|
|
78
78
|
Add the route for the analytics dashboard at the desired endpoint:
|
79
79
|
|
@@ -29,7 +29,7 @@ module RailsLocalAnalytics
|
|
29
29
|
json_str = JSON.generate(json_hash) # convert to json string so that its compatible with all job backends
|
30
30
|
RecordRequestJob.perform_later(json_str)
|
31
31
|
else
|
32
|
-
RecordRequestJob.new.perform(json_hash)
|
32
|
+
RecordRequestJob.new.perform(json_hash.deep_stringify_keys)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -44,12 +44,19 @@ module RailsLocalAnalytics
|
|
44
44
|
end
|
45
45
|
|
46
46
|
class Config
|
47
|
-
|
47
|
+
DEFAULTS = {
|
48
|
+
background_jobs: true,
|
49
|
+
}.freeze
|
50
|
+
|
48
51
|
mattr_reader :background_jobs
|
49
52
|
|
50
53
|
def self.background_jobs=(val)
|
51
54
|
@@background_jobs = !!val
|
52
55
|
end
|
56
|
+
|
57
|
+
DEFAULTS.each do |k,v|
|
58
|
+
self.send("#{k}=", v)
|
59
|
+
end
|
53
60
|
end
|
54
61
|
|
55
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_local_analytics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Weston Ganger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|