shrew 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/shrew/page_views_controller.rb +0 -1
- data/app/models/shrew/page_view.rb +2 -1
- data/db/migrate/1_add_shrew_page_view_table.rb +3 -1
- data/lib/generators/templates/page_view_migration.rb +3 -1
- data/lib/shrew/engine.rb +2 -0
- data/lib/shrew/tracks_page_views.rb +0 -1
- data/lib/shrew/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c193d8007187da9bf64f9a04b122531c66f4275
|
4
|
+
data.tar.gz: a497bf8cbd97ce74fe0111f839b3120fffe17243
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af19ab6da9fa443bd3186cde3b68541aec22eec968ff8eb14fa74b7d28fbda79e6db2c0a472b3d3c4e2cbea8b504c7d00ff55c25d87b2e33e29f36ba1ceefe16
|
7
|
+
data.tar.gz: 296082a0b4308bf8077bb6daa4dde2119d05dc27913c7c6937b6711720bc0a6d70b7915aff917c6eb021f86e2f3e14599fc2fcff1ac0c9a0959908b4f1ed810b
|
@@ -7,7 +7,6 @@ module Shrew
|
|
7
7
|
empty_response && return unless page_view
|
8
8
|
|
9
9
|
page_view.js_return_time = params[:jRT]
|
10
|
-
page_view.time_between_sent_and_return = page_view.js_return_time - page_view.sent_time if page_view.js_return_time && page_view.sent_time
|
11
10
|
page_view.save
|
12
11
|
|
13
12
|
empty_response
|
@@ -6,7 +6,8 @@ module Shrew
|
|
6
6
|
def self.create_from_payload(payload)
|
7
7
|
attributes = payload.slice(:user_id, :controller, :status, :view_runtime,
|
8
8
|
:db_runtime, :sent_time, :js_return_time,
|
9
|
-
:js_tracking_id, :action, :path
|
9
|
+
:js_tracking_id, :action, :path, :start_time,
|
10
|
+
:duration)
|
10
11
|
.merge(sent_time: milliseconds_since_epoch)
|
11
12
|
create(attributes)
|
12
13
|
end
|
@@ -6,14 +6,16 @@ class AddShrewPageViewTable < ActiveRecord::Migration
|
|
6
6
|
t.string :action
|
7
7
|
t.string :path
|
8
8
|
t.integer :status
|
9
|
+
t.integer :start_time
|
10
|
+
t.integer :duration
|
9
11
|
t.float :view_runtime
|
10
12
|
t.float :db_runtime
|
11
13
|
t.integer :sent_time
|
12
14
|
t.integer :js_return_time
|
13
|
-
t.integer :time_between_sent_and_return
|
14
15
|
t.binary :js_tracking_id, limit: 16
|
15
16
|
end
|
16
17
|
|
17
18
|
add_index :shrew_page_views, :user_id
|
19
|
+
add_index :shrew_page_views, :js_tracking_id
|
18
20
|
end
|
19
21
|
end
|
@@ -6,14 +6,16 @@ class AddShrewPageViewTable < ActiveRecord::Migration
|
|
6
6
|
t.string :action
|
7
7
|
t.string :path
|
8
8
|
t.integer :status
|
9
|
+
t.integer :start_time
|
10
|
+
t.integer :duration
|
9
11
|
t.float :view_runtime
|
10
12
|
t.float :db_runtime
|
11
13
|
t.integer :sent_time
|
12
14
|
t.integer :js_return_time
|
13
|
-
t.integer :time_between_sent_and_return
|
14
15
|
t.binary :js_tracking_id, limit: 16
|
15
16
|
end
|
16
17
|
|
17
18
|
add_index :shrew_page_views, :user_id
|
19
|
+
add_index :shrew_page_views, :js_tracking_id
|
18
20
|
end
|
19
21
|
end
|
data/lib/shrew/engine.rb
CHANGED
data/lib/shrew/version.rb
CHANGED