conductor 0.5.0 → 0.5.10

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.5.10
@@ -8,6 +8,7 @@ class Conductor
8
8
  @weights = Conductor::Experiment::Weight.all
9
9
  @weight_history = Conductor::Experiment::History.all
10
10
  @dailies = Conductor::Experiment::Daily.all
11
+ render :template => 'dashboard/index'
11
12
  end
12
13
 
13
14
  end
@@ -13,10 +13,15 @@
13
13
 
14
14
  class Conductor::Experiment::Raw < ActiveRecord::Base
15
15
  set_table_name "conductor_raw_experiments"
16
-
16
+
17
17
  validates_presence_of :group_name, :alternative
18
-
18
+ named_scope :since, lambda { |a_date| { :conditions => ['created_at >= ?',a_date] }}
19
+
19
20
  def created_date
20
21
  self.created_at.strftime('%Y-%m-%d')
21
22
  end
23
+
24
+ def self.purge(days_old=30)
25
+ Conductor::Experiment::Raw.delete_all("created_at <= #{days_old.days.ago}")
26
+ end
22
27
  end
@@ -1,7 +1,7 @@
1
1
  class Conductor
2
2
  class RollUp
3
3
  def self.process
4
- Conductor::Experiment::Raw.all.group_by(&:created_date).each do |day, daily_rows|
4
+ Conductor::Experiment::Raw.since(14.days.ago).group_by(&:created_date).each do |day, daily_rows|
5
5
 
6
6
  # remove all the existing data for that day
7
7
  Conductor::Experiment::Daily.delete_all(:activity_date => day)
@@ -0,0 +1,58 @@
1
+ #conductor_dashboard
2
+ #weights
3
+ %h2 Current Experiment Weights
4
+ - @weights.group_by(&:group_name).each do |group_name, group|
5
+ .group
6
+ %fieldset
7
+ %legend= group_name
8
+ %table
9
+ %tr
10
+ %th Alternative
11
+ %th Weight
12
+ - group.each do |row|
13
+ %tr
14
+ %td.name= row.alternative
15
+ %td.weight= row.weight
16
+
17
+ #dailies
18
+ %h2 Experiment Statistics
19
+ - @dailies.group_by(&:group_name).each do |group_name, group|
20
+ .group
21
+ %fieldset
22
+ %legend= group_name
23
+ %table
24
+ %tr
25
+ %th Date
26
+ %th Alternative
27
+ %th Views
28
+ %th Conversions
29
+ %th Value
30
+ - group.sort_by(&:activity_date).reverse.each do |row|
31
+ %tr
32
+ %td.date= row.activity_date
33
+ %td.name= row.alternative
34
+ %td.views= row.views
35
+ %td.conversions= row.conversions
36
+ %td.value= row.conversion_value
37
+
38
+ #history
39
+ %h2 Experiment Weight History
40
+ - @weight_history.group_by(&:group_name).each do |group_name, group|
41
+ .group
42
+ %fieldset
43
+ %legend= group_name
44
+ %table
45
+ %tr
46
+ %th Date
47
+ %th Alternative
48
+ %th Weight
49
+ - group.sort_by(&:computed_at).reverse.each do |row|
50
+ %tr
51
+ %td.date
52
+ = row.computed_at
53
+ - if row.launch_window
54
+ = "(#{launch_window} day(s) till hard launch)"
55
+ %td.name= row.alternative
56
+ %td.weight= row.weight
57
+
58
+
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 0
9
- version: 0.5.0
8
+ - 10
9
+ version: 0.5.10
10
10
  platform: ruby
11
11
  authors:
12
12
  - Noctivity
@@ -43,7 +43,7 @@ files:
43
43
  - lib/conductor/experiment/raw.rb
44
44
  - lib/conductor/experiment/weight.rb
45
45
  - lib/conductor/roll_up.rb
46
- - lib/conductor/views/index.html.haml
46
+ - lib/conductor/views/dashboard/index.html.haml
47
47
  - lib/conductor/weights.rb
48
48
  - test/db/schema.rb
49
49
  - test/test_conductor.rb
@@ -1,33 +0,0 @@
1
- #conductor_dashboard
2
- #weights
3
- - @weights.group_by(&:group_name).each do |group_name, group|
4
- .group
5
- %fieldset
6
- %legend= group_name
7
- = group.each do |row|
8
- .name= row.alternative
9
- .weight= row.weight
10
-
11
- #dailies
12
- - @dailies.group_by(&:group_name).each do |group_name, group|
13
- .group
14
- %fieldset
15
- %legend= group_name
16
- = group.sort_by(&:activity_date).each do |row|
17
- .date= row.activity_date
18
- .name= row.alternative
19
- .views= row.views
20
- .conversions= row.conversions
21
- .value= row.conversion_value
22
-
23
- #history
24
- - @weight_history.group_by(&:group_name).each do |group_name, group|
25
- .group
26
- %fieldset
27
- %legend= group_name
28
- = group.sort_by(&:computed_at).reverse.each do |row|
29
- .date= row.computed_at
30
- .name= row.alternative
31
- .weight= row.weight
32
-
33
-