fnordmetric 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -0
- data/VERSION +1 -1
- data/doc/preview1.png +0 -0
- data/doc/preview2.png +0 -0
- data/doc/ulm_stats.rb +622 -0
- data/doc/version +1 -0
- data/fnordmetric.gemspec +16 -38
- data/haml/app.haml +12 -5
- data/lib/fnordmetric.rb +3 -0
- data/lib/fnordmetric/app.rb +19 -10
- data/lib/fnordmetric/bars_widget.rb +26 -0
- data/lib/fnordmetric/context.rb +3 -3
- data/lib/fnordmetric/gauge.rb +20 -0
- data/lib/fnordmetric/gauge_calculations.rb +28 -4
- data/lib/fnordmetric/gauge_modifiers.rb +39 -6
- data/lib/fnordmetric/logger.rb +19 -0
- data/lib/fnordmetric/numbers_widget.rb +5 -15
- data/lib/fnordmetric/pie_widget.rb +23 -0
- data/lib/fnordmetric/standalone.rb +1 -1
- data/lib/fnordmetric/timeline_widget.rb +16 -23
- data/lib/fnordmetric/toplist_widget.rb +25 -0
- data/lib/fnordmetric/widget.rb +3 -3
- data/pub/{fnordmetric/fnordmetric.css → fnordmetric.css} +46 -36
- data/pub/fnordmetric.js +1069 -0
- data/pub/loader.gif +0 -0
- data/pub/{highcharts → vendor}/highcharts.js +0 -0
- data/pub/{jquery-1.6.1.min.js → vendor/jquery-1.6.1.min.js} +0 -0
- data/readme.rdoc +228 -311
- data/spec/app_spec.rb +63 -3
- data/spec/gauge_modifiers_spec.rb +157 -2
- data/spec/gauge_spec.rb +143 -12
- data/spec/widget_spec.rb +18 -18
- metadata +33 -58
- data/.document +0 -5
- data/_spec/app_spec.rb +0 -178
- data/_spec/cache_spec.rb +0 -53
- data/_spec/combine_metric_spec.rb +0 -19
- data/_spec/core_spec.rb +0 -50
- data/_spec/count_metric_spec.rb +0 -32
- data/_spec/dashboard_spec.rb +0 -67
- data/_spec/event_spec.rb +0 -46
- data/_spec/metric_spec.rb +0 -118
- data/_spec/report_spec.rb +0 -87
- data/_spec/sum_metric_spec.rb +0 -33
- data/_spec/widget_spec.rb +0 -107
- data/doc/example_server.rb +0 -56
- data/doc/import_dump.rb +0 -26
- data/pub/fnordmetric/fnordmetric.js +0 -543
- data/pub/fnordmetric/widget_numbers.js +0 -71
- data/pub/fnordmetric/widget_timeline.css +0 -0
- data/pub/fnordmetric/widget_timeline.js +0 -110
- data/pub/highcharts/adapters/mootools-adapter.js +0 -12
- data/pub/highcharts/adapters/mootools-adapter.src.js +0 -243
- data/pub/highcharts/adapters/prototype-adapter.js +0 -14
- data/pub/highcharts/adapters/prototype-adapter.src.js +0 -284
- data/pub/highcharts/highcharts.src.js +0 -11103
- data/pub/highcharts/modules/exporting.js +0 -22
- data/pub/highcharts/modules/exporting.src.js +0 -703
- data/pub/highcharts/themes/dark-blue.js +0 -268
- data/pub/highcharts/themes/dark-green.js +0 -268
- data/pub/highcharts/themes/gray.js +0 -262
- data/pub/highcharts/themes/grid.js +0 -97
- data/pub/raphael-min.js +0 -8
- data/pub/raphael-utils.js +0 -221
- data/ulm_stats.rb +0 -198
data/.travis.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm: 1.9.3
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.2
|
data/doc/preview1.png
ADDED
Binary file
|
data/doc/preview2.png
ADDED
Binary file
|
data/doc/ulm_stats.rb
ADDED
@@ -0,0 +1,622 @@
|
|
1
|
+
$: << ::File.expand_path("../../../fnordmetric/lib/", __FILE__)
|
2
|
+
require "fnordmetric"
|
3
|
+
|
4
|
+
FnordMetric.namespace :ulikeme do
|
5
|
+
|
6
|
+
gauge :skip_votes, :tick => 1.day.to_i, :title => "Skip-Votes"
|
7
|
+
gauge :yes_votes, :tick => 1.day.to_i, :title => "Yes-Votes"
|
8
|
+
gauge :maybe_votes, :tick => 1.day.to_i, :title => "Maybe-Votes"
|
9
|
+
|
10
|
+
gauge :pageviews_daily_unique, :tick => 1.day.to_i, :unique => true, :title => "Unique Visits (Daily)"
|
11
|
+
gauge :pageviews_hourly_unique, :tick => 1.hour.to_i, :unique => true, :title => "Unique Visits (Hourly)"
|
12
|
+
gauge :pageviews_monthly_unique, :tick => 40.days.to_i, :unique => true, :title => "Unique Visits (Month)"
|
13
|
+
|
14
|
+
gauge :messages_sent, :tick => 1.day.to_i, :title => "Messages (sent)"
|
15
|
+
gauge :messages_read, :tick => 1.day.to_i, :title => "Messages (read)"
|
16
|
+
gauge :winks_sent, :tick => 1.day.to_i, :title => "Winks sent"
|
17
|
+
|
18
|
+
gauge :pageviews_per_url_daily,
|
19
|
+
:tick => 1.day.to_i,
|
20
|
+
:title => "Daily Pageviews per URL",
|
21
|
+
:three_dimensional => true
|
22
|
+
|
23
|
+
gauge :pageviews_per_url_monthly,
|
24
|
+
:tick => 30.days.to_i,
|
25
|
+
:title => "Monthly Pageviews per URL",
|
26
|
+
:three_dimensional => true
|
27
|
+
|
28
|
+
event :_pageview do
|
29
|
+
incr :pageviews_daily_unique
|
30
|
+
incr :pageviews_hourly_unique
|
31
|
+
incr :pageviews_monthly_unique
|
32
|
+
incr_field :pageviews_per_url_daily, data[:url]
|
33
|
+
incr_field :pageviews_per_url_monthly, data[:url]
|
34
|
+
end
|
35
|
+
|
36
|
+
event(:action_wink){ incr :winks_sent }
|
37
|
+
event(:wink_sent){ incr :winks_sent }
|
38
|
+
event(:message_sent){ incr :messages_sent }
|
39
|
+
event(:message_read){ incr :messages_read }
|
40
|
+
|
41
|
+
event(:skip_vote){ incr :skip_votes }
|
42
|
+
event(:action_skip){ incr :skip_votes }
|
43
|
+
event(:yes_vote){ incr :yes_votes }
|
44
|
+
event(:action_yes){ incr :yes_votes }
|
45
|
+
event(:maybe_vote){ incr :maybe_votes }
|
46
|
+
event(:action_maybe){ incr :maybe_votes }
|
47
|
+
|
48
|
+
|
49
|
+
gauge :mails_sent, :tick => 1.day.to_i, :title => "Mails (sent)"
|
50
|
+
gauge :mails_clicked, :tick => 1.day.to_i, :title => "Mails (clicked)"
|
51
|
+
|
52
|
+
event(:mail_sent){ incr :mails_sent }
|
53
|
+
event(:mail_clicked){ incr :mails_clicked }
|
54
|
+
|
55
|
+
|
56
|
+
gauge :app_requests_sent, :tick => 1.day.to_i, :title => "App-Requests (sent)"
|
57
|
+
gauge :app_requests_clicked, :tick => 1.day.to_i, :title => "App-Requests (clicked)"
|
58
|
+
|
59
|
+
gauge :app_invites_sent, :tick => 1.day.to_i, :title => "App-Invites (sent)"
|
60
|
+
gauge :app_invites_clicked, :tick => 1.day.to_i, :title => "App-Invites (clicked)"
|
61
|
+
|
62
|
+
event(:app_request_sent){ incr :app_requests_sent }
|
63
|
+
event(:app_request_click){ incr :app_requests_clicked }
|
64
|
+
|
65
|
+
event(:app_invite_sent){ incr :app_invites_sent }
|
66
|
+
event(:app_invite_click){ incr :app_invites_clicked }
|
67
|
+
|
68
|
+
gauge :rockyou1_ppis, :tick => 1.day.to_i, :title => "RockYou (12/11): Paid Installs"
|
69
|
+
gauge :rockyou1_requests, :tick => 1.day.to_i, :title => "RockYou (12/11): Invites sent"
|
70
|
+
gauge :rockyou1_refs, :tick => 1.day.to_i, :title => "RockYou (12/11): Ref. Installs"
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
widget 'Overview', {
|
76
|
+
:title => "Unique Visits per Day",
|
77
|
+
:type => :timeline,
|
78
|
+
:width => 67,
|
79
|
+
:gauges => :pageviews_daily_unique,
|
80
|
+
:include_current => true,
|
81
|
+
:autoupdate => 30
|
82
|
+
}
|
83
|
+
|
84
|
+
widget 'Overview', {
|
85
|
+
:title => "Unique Visits per Hour",
|
86
|
+
:type => :timeline,
|
87
|
+
:width => 33,
|
88
|
+
:gauges => :pageviews_hourly_unique,
|
89
|
+
:include_current => true,
|
90
|
+
:autoupdate => 30
|
91
|
+
}
|
92
|
+
|
93
|
+
widget 'Overview', {
|
94
|
+
:title => "uLikeMe Key Metrics",
|
95
|
+
:type => :numbers,
|
96
|
+
:width => 100,
|
97
|
+
:autoupdate => 30,
|
98
|
+
:gauges => [
|
99
|
+
:pageviews_daily_unique, :pageviews_monthly_unique, :app_requests_sent, :app_requests_clicked, :mails_sent, :mails_clicked,
|
100
|
+
:app_invites_sent, :app_invites_clicked
|
101
|
+
]
|
102
|
+
}
|
103
|
+
|
104
|
+
widget 'Overview', {
|
105
|
+
:title => "User-Activity",
|
106
|
+
:type => :timeline,
|
107
|
+
:width => 67,
|
108
|
+
:autoupdate => 30,
|
109
|
+
:gauges => [:skip_votes, :yes_votes, :maybe_votes]
|
110
|
+
}
|
111
|
+
|
112
|
+
widget 'Overview', {
|
113
|
+
:title => "Top Pages",
|
114
|
+
:type => :toplist,
|
115
|
+
:autoupdate => 30,
|
116
|
+
:width => 33,
|
117
|
+
:gauges => [ :pageviews_per_url_daily, :pageviews_per_url_monthly ]
|
118
|
+
}
|
119
|
+
|
120
|
+
|
121
|
+
widget 'Overview', {
|
122
|
+
:title => "uLikeMe User Metrics",
|
123
|
+
:type => :numbers,
|
124
|
+
:width => 67,
|
125
|
+
:autoupdate => 30,
|
126
|
+
:gauges => [
|
127
|
+
:skip_votes, :yes_votes,
|
128
|
+
:maybe_votes, :winks_sent, :messages_sent, :messages_read,
|
129
|
+
]
|
130
|
+
}
|
131
|
+
|
132
|
+
widget 'Overview', {
|
133
|
+
:title => "RockYou Campaign (12/11) Metrics",
|
134
|
+
:type => :numbers,
|
135
|
+
:width => 33,
|
136
|
+
:autoupdate => 30,
|
137
|
+
:gauges => [ :rockyou1_ppis, :rockyou1_refs, :rockyou1_requests ]
|
138
|
+
}
|
139
|
+
|
140
|
+
|
141
|
+
# user activity
|
142
|
+
|
143
|
+
widget 'UserActivity', {
|
144
|
+
:title => "Yes/No/Skip-Votes",
|
145
|
+
:type => :timeline,
|
146
|
+
:gauges => [:skip_votes, :yes_votes, :maybe_votes]
|
147
|
+
}
|
148
|
+
|
149
|
+
widget 'UserActivity', {
|
150
|
+
:title => "Yes/No/Skip Numbers",
|
151
|
+
:type => :numbers,
|
152
|
+
:gauges => [:skip_votes, :yes_votes, :maybe_votes]
|
153
|
+
}
|
154
|
+
|
155
|
+
|
156
|
+
widget 'UserActivity', {
|
157
|
+
:title => "Messages sent/read",
|
158
|
+
:type => :timeline,
|
159
|
+
:gauges => [:messages_sent, :messages_read, :winks_sent]
|
160
|
+
}
|
161
|
+
|
162
|
+
widget 'UserActivity', {
|
163
|
+
:title => "Messages sent+read/Winks Numbers",
|
164
|
+
:type => :numbers,
|
165
|
+
:gauges => [:messages_sent, :messages_read, :winks_sent]
|
166
|
+
}
|
167
|
+
|
168
|
+
|
169
|
+
widget 'TrafficChannels', {
|
170
|
+
:title => "Mails sent/read",
|
171
|
+
:type => :timeline,
|
172
|
+
:gauges => [:mails_sent, :mails_clicked]
|
173
|
+
}
|
174
|
+
|
175
|
+
widget 'TrafficChannels', {
|
176
|
+
:title => "Mail sent/read Numbers",
|
177
|
+
:type => :numbers,
|
178
|
+
:gauges => [:mails_sent, :mails_clicked]
|
179
|
+
}
|
180
|
+
|
181
|
+
widget 'TrafficChannels', {
|
182
|
+
:title => "App-Requests sent/clicked",
|
183
|
+
:type => :timeline,
|
184
|
+
:gauges => [:app_requests_sent, :app_requests_clicked]
|
185
|
+
}
|
186
|
+
|
187
|
+
widget 'TrafficChannels', {
|
188
|
+
:title => "App-Requests sent/clicked Numbers",
|
189
|
+
:type => :numbers,
|
190
|
+
:gauges => [:app_requests_sent, :app_requests_clicked]
|
191
|
+
}
|
192
|
+
|
193
|
+
widget 'TrafficChannels', {
|
194
|
+
:title => "App-Invites sent/clicked",
|
195
|
+
:type => :timeline,
|
196
|
+
:gauges => [:app_invites_sent, :app_invites_clicked]
|
197
|
+
}
|
198
|
+
|
199
|
+
widget 'TrafficChannels', {
|
200
|
+
:title => "App-Invites sent/clicked Numbers",
|
201
|
+
:type => :numbers,
|
202
|
+
:gauges => [:app_invites_sent, :app_invites_clicked]
|
203
|
+
}
|
204
|
+
|
205
|
+
gauge :wall_posts_sent, :tick => 1.day.to_i
|
206
|
+
gauge :wall_posts_clicked, :tick => 1.day.to_i
|
207
|
+
|
208
|
+
event(:wallpost_sent){ incr :wall_posts_sent }
|
209
|
+
event(:wallpost_click){ incr :wall_posts_clicked }
|
210
|
+
|
211
|
+
widget 'TrafficChannels', {
|
212
|
+
:title => "Wall-Posts sent/clicked",
|
213
|
+
:type => :timeline,
|
214
|
+
:gauges => [:wall_posts_sent, :wall_posts_clicked]
|
215
|
+
}
|
216
|
+
|
217
|
+
widget 'TrafficChannels', {
|
218
|
+
:title => "Wall-Posts sent/clicked Numbers",
|
219
|
+
:type => :numbers,
|
220
|
+
:gauges => [:wall_posts_sent, :wall_posts_clicked]
|
221
|
+
}
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
event :campaign_install do
|
226
|
+
if %w(ry201112a ry201112b).include?(data[:campaign_key])
|
227
|
+
incr :rockyou1_ppis
|
228
|
+
end
|
229
|
+
if %w(ry201112_ref).include?(data[:campaign_key])
|
230
|
+
incr :rockyou1_refs
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
event :app_request_sent do
|
235
|
+
if %w(ry201112a ry201112b ry201112_ref).include?(data[:campaign_key])
|
236
|
+
incr :rockyou1_requests
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
widget 'Campaigns', {
|
241
|
+
:title => "RockYou (1) - PPI vs. Requests vs. Refs",
|
242
|
+
:gauges => [:rockyou1_requests, :rockyou1_ppis, :rockyou1_refs],
|
243
|
+
:type => :timeline
|
244
|
+
}
|
245
|
+
|
246
|
+
widget 'Campaigns', {
|
247
|
+
:title => "RockYou (1) - Installs via PPI",
|
248
|
+
:type => :timeline,
|
249
|
+
:gauges => [:rockyou1_ppis]
|
250
|
+
}
|
251
|
+
|
252
|
+
widget 'Campaigns', {
|
253
|
+
:title => "RockYou (1) - Installs via Referral",
|
254
|
+
:gauges => [:rockyou1_refs],
|
255
|
+
:type => :timeline
|
256
|
+
}
|
257
|
+
|
258
|
+
widget 'Campaigns', {
|
259
|
+
:title => "RockYou (1) - AppRequests sent",
|
260
|
+
:gauges => [:rockyou1_requests],
|
261
|
+
:type => :timeline
|
262
|
+
}
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
gauge :abtest_sidebar_btn_totals,
|
267
|
+
:tick => 36000.days.to_i,
|
268
|
+
:title => "(A/B) sidebar_btn: Totals",
|
269
|
+
:three_dimensional => true
|
270
|
+
|
271
|
+
gauge :abtest_sidebar_btn_daily,
|
272
|
+
:tick => 1.day.to_i,
|
273
|
+
:title => "(A/B) sidebar_btn: Daily",
|
274
|
+
:three_dimensional => true
|
275
|
+
|
276
|
+
gauge :abtest_sidebar_btn_leute_treffen,
|
277
|
+
:tick => 1.day.to_i,
|
278
|
+
:title => "leute_treffen"
|
279
|
+
|
280
|
+
gauge :abtest_sidebar_btn_jetzt_losflirten,
|
281
|
+
:tick => 1.day.to_i,
|
282
|
+
:title => "jetzt_losflirten"
|
283
|
+
|
284
|
+
gauge :abtest_sidebar_btn_dates_finden,
|
285
|
+
:tick => 1.day.to_i,
|
286
|
+
:title => "dates_finden"
|
287
|
+
|
288
|
+
gauge :abtest_sidebar_btn_leute_treffen_monthly,
|
289
|
+
:tick => 1.month.to_i,
|
290
|
+
:title => "leute_treffen"
|
291
|
+
|
292
|
+
gauge :abtest_sidebar_btn_jetzt_losflirten_monthly,
|
293
|
+
:tick => 1.month.to_i,
|
294
|
+
:title => "jetzt_losflirten"
|
295
|
+
|
296
|
+
gauge :abtest_sidebar_btn_dates_finden_monthly,
|
297
|
+
:tick => 1.month.to_i,
|
298
|
+
:title => "dates_finden"
|
299
|
+
|
300
|
+
|
301
|
+
event :abtest_sidebar_btn_click do
|
302
|
+
incr :abtest_sidebar_btn_leute_treffen if data[:variant] == "leute_treffen"
|
303
|
+
incr :abtest_sidebar_btn_jetzt_losflirten if data[:variant] == "jetzt_losflirten"
|
304
|
+
incr :abtest_sidebar_btn_dates_finden if data[:variant] == "dates_finden"
|
305
|
+
incr :abtest_sidebar_btn_leute_treffen_monthly if data[:variant] == "leute_treffen"
|
306
|
+
incr :abtest_sidebar_btn_jetzt_losflirten_monthly if data[:variant] == "jetzt_losflirten"
|
307
|
+
incr :abtest_sidebar_btn_dates_finden_monthly if data[:variant] == "dates_finden"
|
308
|
+
incr_field :abtest_sidebar_btn_totals, data[:variant]
|
309
|
+
incr_field :abtest_sidebar_btn_daily, data[:variant]
|
310
|
+
end
|
311
|
+
|
312
|
+
|
313
|
+
widget 'ABTests', {
|
314
|
+
:title => "Sidebar-Button (A/B): Daily Clicks per Variant",
|
315
|
+
:type => :timeline,
|
316
|
+
:autoupdate => 5,
|
317
|
+
:width => 67,
|
318
|
+
:gauges => [
|
319
|
+
:abtest_sidebar_btn_leute_treffen,
|
320
|
+
:abtest_sidebar_btn_jetzt_losflirten,
|
321
|
+
:abtest_sidebar_btn_dates_finden
|
322
|
+
]
|
323
|
+
}
|
324
|
+
|
325
|
+
widget 'ABTests', {
|
326
|
+
:title => "Top Pages",
|
327
|
+
:type => :toplist,
|
328
|
+
:autoupdate => 5,
|
329
|
+
:width => 33,
|
330
|
+
:gauges => [ :abtest_sidebar_btn_totals, :abtest_sidebar_btn_daily ]
|
331
|
+
}
|
332
|
+
|
333
|
+
|
334
|
+
widget 'ABTests', {
|
335
|
+
:title => "Sidebar-Button (A/B): Daily Clicks per Variant (Numbers)",
|
336
|
+
:type => :numbers,
|
337
|
+
:autoupdate => 5,
|
338
|
+
:width => 67,
|
339
|
+
:gauges => [
|
340
|
+
:abtest_sidebar_btn_leute_treffen,
|
341
|
+
:abtest_sidebar_btn_jetzt_losflirten,
|
342
|
+
:abtest_sidebar_btn_dates_finden
|
343
|
+
]
|
344
|
+
}
|
345
|
+
|
346
|
+
widget 'ABTests', {
|
347
|
+
:title => "Sidebar-Button (A/B): Monthly Clicks per Variant",
|
348
|
+
:type => :pie,
|
349
|
+
:autoupdate => 5,
|
350
|
+
:width => 33,
|
351
|
+
:gauges => [
|
352
|
+
:abtest_sidebar_btn_leute_treffen_monthly,
|
353
|
+
:abtest_sidebar_btn_jetzt_losflirten_monthly,
|
354
|
+
:abtest_sidebar_btn_dates_finden_monthly
|
355
|
+
]
|
356
|
+
}
|
357
|
+
|
358
|
+
|
359
|
+
gauge :age_distribution_female_monthly,
|
360
|
+
:tick => 1.month.to_i,
|
361
|
+
:three_dimensional => true,
|
362
|
+
:unique => true,
|
363
|
+
:title => "Age Distribution (female) monthly"
|
364
|
+
|
365
|
+
gauge :age_distribution_male_monthly,
|
366
|
+
:tick => 1.month.to_i,
|
367
|
+
:three_dimensional => true,
|
368
|
+
:unique => true,
|
369
|
+
:title => "Age Distribution (male) monthly"
|
370
|
+
|
371
|
+
gauge :age_distribution_female_daily,
|
372
|
+
:tick => 1.day.to_i,
|
373
|
+
:three_dimensional => true,
|
374
|
+
:unique => true,
|
375
|
+
:title => "Age Distribution (female) daily"
|
376
|
+
|
377
|
+
gauge :age_distribution_male_daily,
|
378
|
+
:tick => 1.day.to_i,
|
379
|
+
:three_dimensional => true,
|
380
|
+
:unique => true,
|
381
|
+
:title => "Age Distribution (male) daily"
|
382
|
+
|
383
|
+
|
384
|
+
widget 'Demography', {
|
385
|
+
:title => "Age Distribution: Female Users (Monthly)",
|
386
|
+
:type => :bars,
|
387
|
+
:width => 50,
|
388
|
+
:autoupdate => 5,
|
389
|
+
:order_by => :field,
|
390
|
+
:gauges => [ :age_distribution_female_monthly ]
|
391
|
+
}
|
392
|
+
|
393
|
+
widget 'Demography', {
|
394
|
+
:title => "Age Distribution: Male Users (Monthly)",
|
395
|
+
:type => :bars,
|
396
|
+
:width => 50,
|
397
|
+
:autoupdate => 5,
|
398
|
+
:order_by => :field,
|
399
|
+
:gauges => [ :age_distribution_male_monthly ]
|
400
|
+
}
|
401
|
+
|
402
|
+
|
403
|
+
widget 'Demography', {
|
404
|
+
:title => "Age Distribution: Female Users",
|
405
|
+
:type => :toplist,
|
406
|
+
:width => 50,
|
407
|
+
:autoupdate => 5,
|
408
|
+
:gauges => [ :age_distribution_female_monthly, :age_distribution_female_daily ]
|
409
|
+
}
|
410
|
+
|
411
|
+
widget 'Demography', {
|
412
|
+
:title => "Age Distribution: Male Users",
|
413
|
+
:type => :toplist,
|
414
|
+
:width => 50,
|
415
|
+
:autoupdate => 5,
|
416
|
+
:gauges => [ :age_distribution_male_monthly, :age_distribution_male_daily ]
|
417
|
+
}
|
418
|
+
|
419
|
+
event "user_demography" do
|
420
|
+
if data[:gender] == "female"
|
421
|
+
incr_field(:age_distribution_female_monthly, data[:age], 1)
|
422
|
+
incr_field(:age_distribution_female_daily, data[:age], 1)
|
423
|
+
end
|
424
|
+
if data[:gender] == "male"
|
425
|
+
incr_field(:age_distribution_male_monthly, data[:age], 1)
|
426
|
+
incr_field(:age_distribution_male_daily, data[:age], 1)
|
427
|
+
end
|
428
|
+
end
|
429
|
+
|
430
|
+
|
431
|
+
gauge :competitors_badoo_mau,
|
432
|
+
:tick => 1.day.to_i,
|
433
|
+
:title => "Badoo (MAU)"
|
434
|
+
|
435
|
+
gauge :competitors_badoo_dau,
|
436
|
+
:tick => 1.day.to_i,
|
437
|
+
:title => "Badoo (DAU)"
|
438
|
+
|
439
|
+
gauge :competitors_zoosk_mau,
|
440
|
+
:tick => 1.day.to_i,
|
441
|
+
:title => "zoosk (MAU)"
|
442
|
+
|
443
|
+
gauge :competitors_zoosk_dau,
|
444
|
+
:tick => 1.day.to_i,
|
445
|
+
:title => "zoosk (DAU)"
|
446
|
+
|
447
|
+
gauge :competitors_areyouinterested_mau,
|
448
|
+
:tick => 1.day.to_i,
|
449
|
+
:title => "areyouinterested (MAU)"
|
450
|
+
|
451
|
+
gauge :competitors_areyouinterested_dau,
|
452
|
+
:tick => 1.day.to_i,
|
453
|
+
:title => "areyouinterested (DAU)"
|
454
|
+
|
455
|
+
gauge :competitors_onetwolike_mau,
|
456
|
+
:tick => 1.day.to_i,
|
457
|
+
:title => "onetwolike (MAU)"
|
458
|
+
|
459
|
+
gauge :competitors_onetwolike_dau,
|
460
|
+
:tick => 1.day.to_i,
|
461
|
+
:title => "onetwolike (DAU)"
|
462
|
+
|
463
|
+
gauge :competitors_kizzle_mau,
|
464
|
+
:tick => 1.day.to_i,
|
465
|
+
:title => "kizzle (MAU)"
|
466
|
+
|
467
|
+
gauge :competitors_kizzle_dau,
|
468
|
+
:tick => 1.day.to_i,
|
469
|
+
:title => "kizzle (DAU)"
|
470
|
+
|
471
|
+
event :competition_data do
|
472
|
+
set_value(:competitors_badoo_mau, data[:badoo_mau]) if data[:badoo_mau]
|
473
|
+
set_value(:competitors_badoo_dau, data[:badoo_dau]) if data[:badoo_dau]
|
474
|
+
set_value(:competitors_areyouinterested_mau, data[:areyouinterested_mau]) if data[:areyouinterested_mau]
|
475
|
+
set_value(:competitors_areyouinterested_dau, data[:areyouinterested_dau]) if data[:areyouinterested_dau]
|
476
|
+
set_value(:competitors_zoosk_mau, data[:zoosk_mau]) if data[:zoosk_mau]
|
477
|
+
set_value(:competitors_zoosk_dau, data[:zoosk_dau]) if data[:zoosk_dau]
|
478
|
+
set_value(:competitors_onetwolike_mau, data[:onetwolike_mau]) if data[:onetwolike_mau]
|
479
|
+
set_value(:competitors_onetwolike_dau, data[:onetwolike_dau]) if data[:onetwolike_dau]
|
480
|
+
set_value(:competitors_kizzle_mau, data[:kizzle_mau]) if data[:kizzle_mau]
|
481
|
+
set_value(:competitors_kizzle_dau, data[:kizzle_dau]) if data[:kizzle_dau]
|
482
|
+
end
|
483
|
+
|
484
|
+
widget "Competition", {
|
485
|
+
:title => "Competition: Badoo",
|
486
|
+
:type => :timeline,
|
487
|
+
:ticks => 90,
|
488
|
+
:gauges => [:competitors_badoo_mau, :competitors_badoo_dau]
|
489
|
+
}
|
490
|
+
|
491
|
+
widget "Competition", {
|
492
|
+
:title => "Competition: Badoo (Numbers)",
|
493
|
+
:type => :numbers,
|
494
|
+
:offsets => [10, 30, 90],
|
495
|
+
:gauges => [:competitors_badoo_mau, :competitors_badoo_dau]
|
496
|
+
}
|
497
|
+
|
498
|
+
widget "Competition", {
|
499
|
+
:title => "Competition: zoosk",
|
500
|
+
:type => :timeline,
|
501
|
+
:ticks => 90,
|
502
|
+
:gauges => [:competitors_zoosk_mau, :competitors_zoosk_dau]
|
503
|
+
}
|
504
|
+
|
505
|
+
widget "Competition", {
|
506
|
+
:title => "Competition: zoosk (Numbers)",
|
507
|
+
:type => :numbers,
|
508
|
+
:offsets => [10, 30, 90],
|
509
|
+
:gauges => [:competitors_zoosk_mau, :competitors_zoosk_dau]
|
510
|
+
}
|
511
|
+
|
512
|
+
widget "Competition", {
|
513
|
+
:title => "Competition: onetwolike",
|
514
|
+
:type => :timeline,
|
515
|
+
:ticks => 90,
|
516
|
+
:gauges => [:competitors_onetwolike_mau, :competitors_onetwolike_dau]
|
517
|
+
}
|
518
|
+
|
519
|
+
widget "Competition", {
|
520
|
+
:title => "Competition: onetwolike (Numbers)",
|
521
|
+
:type => :numbers,
|
522
|
+
:offsets => [10, 30, 90],
|
523
|
+
:gauges => [:competitors_onetwolike_mau, :competitors_onetwolike_dau]
|
524
|
+
}
|
525
|
+
|
526
|
+
widget "Competition", {
|
527
|
+
:title => "Competition: kizzle",
|
528
|
+
:type => :timeline,
|
529
|
+
:ticks => 90,
|
530
|
+
:gauges => [:competitors_kizzle_mau, :competitors_kizzle_dau]
|
531
|
+
}
|
532
|
+
|
533
|
+
widget "Competition", {
|
534
|
+
:title => "Competition: kizzle (Numbers)",
|
535
|
+
:type => :numbers,
|
536
|
+
:offsets => [10, 30, 90],
|
537
|
+
:gauges => [:competitors_kizzle_mau, :competitors_kizzle_dau]
|
538
|
+
}
|
539
|
+
|
540
|
+
widget "Competition", {
|
541
|
+
:title => "Competition: areyouinterested",
|
542
|
+
:type => :timeline,
|
543
|
+
:ticks => 90,
|
544
|
+
:gauges => [:competitors_areyouinterested_mau, :competitors_areyouinterested_dau]
|
545
|
+
}
|
546
|
+
|
547
|
+
widget "Competition", {
|
548
|
+
:title => "Competition: areyouinterested (Numbers)",
|
549
|
+
:type => :numbers,
|
550
|
+
:offsets => [10, 30, 90],
|
551
|
+
:gauges => [:competitors_areyouinterested_mau, :competitors_areyouinterested_dau]
|
552
|
+
}
|
553
|
+
|
554
|
+
|
555
|
+
|
556
|
+
gauge :events_per_minute, :tick => 60
|
557
|
+
gauge :events_per_hour, :tick => 1.hour.to_i
|
558
|
+
gauge :events_per_second, :tick => 1
|
559
|
+
gauge :votes_per_second, :tick => 1
|
560
|
+
|
561
|
+
event :"*" do
|
562
|
+
incr :events_per_minute
|
563
|
+
incr :events_per_hour
|
564
|
+
incr :events_per_second
|
565
|
+
end
|
566
|
+
|
567
|
+
|
568
|
+
event(:skip_vote){ incr :votes_per_second }
|
569
|
+
event(:action_skip){ incr :votes_per_second }
|
570
|
+
event(:yes_vote){ incr :votes_per_second }
|
571
|
+
event(:action_yes){ incr :votes_per_second }
|
572
|
+
event(:maybe_vote){ incr :votes_per_second }
|
573
|
+
event(:action_maybe){ incr :votes_per_second }
|
574
|
+
|
575
|
+
|
576
|
+
widget 'TechStats', {
|
577
|
+
:title => "Events per Minute",
|
578
|
+
:type => :timeline,
|
579
|
+
:width => 50,
|
580
|
+
:gauges => :events_per_minute,
|
581
|
+
:include_current => true,
|
582
|
+
:autoupdate => 30
|
583
|
+
}
|
584
|
+
|
585
|
+
widget 'TechStats', {
|
586
|
+
:title => "Events per Hour",
|
587
|
+
:type => :timeline,
|
588
|
+
:width => 50,
|
589
|
+
:gauges => :events_per_hour,
|
590
|
+
:include_current => true,
|
591
|
+
:autoupdate => 30
|
592
|
+
}
|
593
|
+
|
594
|
+
|
595
|
+
widget 'TechStats', {
|
596
|
+
:title => "Events/Second",
|
597
|
+
:type => :timeline,
|
598
|
+
:width => 50,
|
599
|
+
:gauges => :events_per_second,
|
600
|
+
:include_current => true,
|
601
|
+
:plot_style => :areaspline,
|
602
|
+
:autoupdate => 1
|
603
|
+
}
|
604
|
+
|
605
|
+
|
606
|
+
widget 'TechStats', {
|
607
|
+
:title => "Votes/Second",
|
608
|
+
:type => :timeline,
|
609
|
+
:width => 50,
|
610
|
+
:gauges => :votes_per_second,
|
611
|
+
:include_current => true,
|
612
|
+
:plot_style => :areaspline,
|
613
|
+
:autoupdate => 1
|
614
|
+
}
|
615
|
+
|
616
|
+
end
|
617
|
+
|
618
|
+
#task :setup do
|
619
|
+
# @fm_opts = {:web_interface => ["0.0.0.0", "2323"]} if ENV['DEV']
|
620
|
+
#end
|
621
|
+
|
622
|
+
FnordMetric.standalone
|