statsig 1.8.1.beta.1 → 1.8.4.beta.pre.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/statsig.rb +1 -1
- data/lib/statsig_logger.rb +18 -5
- 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: 8bea35d8e01c06aa973c41af533542e10256eb12ff1b8c790affe92d28e6f762
|
4
|
+
data.tar.gz: 183446325403fc29ffafd0ea498557ae56c59d6959a59d5e96a1c88806b57147
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 116a1a145265084de0877fda45b017f36eda5eed8a19c093e25588e1f4720ac10ef903dfdc9c6f13ae4989565a8b01e4e20ac2aa3efd661a34e1c16bb91d680b
|
7
|
+
data.tar.gz: aa0d99ff3b38ae0e73f037bf31efc4a364fe0e6831efa6347329f525e38c2148837c19e21768fece6b921fbbe6404664e30d9549aa9d4ace4544519c5830dd8b
|
data/lib/statsig.rb
CHANGED
data/lib/statsig_logger.rb
CHANGED
@@ -8,14 +8,12 @@ module Statsig
|
|
8
8
|
def initialize(network)
|
9
9
|
@network = network
|
10
10
|
@events = []
|
11
|
-
@background_flush =
|
12
|
-
sleep 60
|
13
|
-
flush
|
14
|
-
end
|
11
|
+
@background_flush = periodic_flush
|
15
12
|
end
|
16
13
|
|
17
14
|
def log_event(event)
|
18
15
|
@events.push(event)
|
16
|
+
puts "Statsig:: log_event called, new count: #{@events.length.to_s}"
|
19
17
|
if @events.length >= 500
|
20
18
|
flush
|
21
19
|
end
|
@@ -46,13 +44,28 @@ module Statsig
|
|
46
44
|
log_event(event)
|
47
45
|
end
|
48
46
|
|
47
|
+
def periodic_flush
|
48
|
+
puts "Statsig:: starting a thread"
|
49
|
+
Thread.new do
|
50
|
+
loop do
|
51
|
+
puts "Statsig:: beginning to sleep for 60 seconds"
|
52
|
+
sleep 60
|
53
|
+
puts "Statsig:: finished sleeping"
|
54
|
+
flush
|
55
|
+
puts "Statsig:: flushed"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
49
60
|
def flush(closing = false)
|
61
|
+
puts "Statsig:: calling flush function, count: #{@events.length.to_s}"
|
50
62
|
if closing
|
51
|
-
@background_flush
|
63
|
+
@background_flush&.exit
|
52
64
|
end
|
53
65
|
if @events.length == 0
|
54
66
|
return
|
55
67
|
end
|
68
|
+
puts "Statsig:: flushing events, count: #{@events.length.to_s}"
|
56
69
|
flush_events = @events.map { |e| e.serialize }
|
57
70
|
@events = []
|
58
71
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statsig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.4.beta.pre.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Statsig, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|