logfiction 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/logfiction/version.rb +1 -1
- data/lib/logfiction.rb +11 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10516897b47ee315cc9f159fd211ec492e60fe61f9cda42a837bbaebb3662dbb
|
4
|
+
data.tar.gz: 62fdffb792eaf108b6c35f598355909cdf5efea4fd7c542449250c88d7651998
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e988f5e0c99cc51a5656deda8040f0facebbd1a00189be81094b5075877b2e95e612eabc905b2f95f27ea70b41fb2d50519cbb65dcd9cf034493ac55de586bf2
|
7
|
+
data.tar.gz: d3aa5bee73b92a494a242c2c9bd6ea39fe8b5b8cb19f6b788b2d30c0719d36331886069e14c0880fe59cfb4acb6cdf8ad49df42b4e168f57a48605df2434c700
|
data/Gemfile.lock
CHANGED
data/lib/logfiction/version.rb
CHANGED
data/lib/logfiction.rb
CHANGED
@@ -321,12 +321,16 @@ module Logfiction
|
|
321
321
|
# Output:
|
322
322
|
# n_actions(int): total number of user's actions
|
323
323
|
# n_sessions: total number of user's sessions
|
324
|
-
def generate_accesslog(
|
325
|
-
|
324
|
+
def generate_accesslog(n, output_form={})
|
325
|
+
# add row number because of "false" log is not counted
|
326
|
+
if n < 5000
|
327
|
+
n_max = n * 2
|
328
|
+
else
|
329
|
+
n_max = n + (n/4)
|
330
|
+
end
|
326
331
|
# initialize access_log
|
327
332
|
@access_log = {}
|
328
333
|
|
329
|
-
|
330
334
|
# set default value unless another manual settting done
|
331
335
|
if @transitions.size == 0
|
332
336
|
self.generate_state_transiton()
|
@@ -351,10 +355,13 @@ module Logfiction
|
|
351
355
|
while n_actions < user_max_actions && n_sessions < user_max_sessions
|
352
356
|
n_actions, n_sessions = self.update_user_state(user_id)
|
353
357
|
n_row += 1
|
358
|
+
break if n_row > n_max
|
354
359
|
end
|
360
|
+
break if n_row > n_max
|
355
361
|
end
|
362
|
+
break if n_row > n_max
|
356
363
|
end
|
357
|
-
self.output_accesslog(
|
364
|
+
self.output_accesslog(n, output_form)
|
358
365
|
end
|
359
366
|
|
360
367
|
def output_accesslog(n_max, output_form)
|