widescreen 0.1.0 → 0.1.1
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.
- data/lib/widescreen.rb +1 -1
- data/lib/widescreen/dashboard.rb +11 -2
- data/lib/widescreen/dashboard/public/excanvas.min.js +57 -0
- data/lib/widescreen/dashboard/public/jqplot.barRenderer.min.js +57 -0
- data/lib/widescreen/dashboard/public/jqplot.dateAxisRenderer.min.js +57 -0
- data/lib/widescreen/dashboard/public/jqplot.highlighter.min.js +57 -0
- data/lib/widescreen/dashboard/public/jquery-1.6.4.min.js +4 -0
- data/lib/widescreen/dashboard/public/jquery.jqplot.min.css +1 -0
- data/lib/widescreen/dashboard/public/jquery.jqplot.min.js +57 -0
- data/lib/widescreen/dashboard/views/layout.erb +9 -0
- data/lib/widescreen/dashboard/views/metric.erb +27 -12
- data/lib/widescreen/metric.rb +6 -5
- data/lib/widescreen/version.rb +1 -1
- data/spec/widescreen/dashboard_spec.rb +10 -2
- metadata +25 -19
- data/README.html +0 -178
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: widescreen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-10-
|
12
|
+
date: 2011-10-29 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: redis
|
16
|
-
requirement: &
|
16
|
+
requirement: &2153402220 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.2.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2153402220
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: redis-namespace
|
27
|
-
requirement: &
|
27
|
+
requirement: &2153401680 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.0.3
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2153401680
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: sinatra
|
38
|
-
requirement: &
|
38
|
+
requirement: &2153401180 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.2.6
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2153401180
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rake
|
49
|
-
requirement: &
|
49
|
+
requirement: &2153400700 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 0.9.2
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2153400700
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: minitest
|
60
|
-
requirement: &
|
60
|
+
requirement: &2153400180 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 2.6.1
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2153400180
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: timecop
|
71
|
-
requirement: &
|
71
|
+
requirement: &2153399700 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 0.3.5
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2153399700
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: rack-test
|
82
|
-
requirement: &
|
82
|
+
requirement: &2153399200 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: '0.6'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *2153399200
|
91
91
|
description:
|
92
92
|
email: marcin.ciunelis@gmail.com
|
93
93
|
executables: []
|
@@ -98,12 +98,18 @@ files:
|
|
98
98
|
- .travis.yml
|
99
99
|
- Gemfile
|
100
100
|
- LICENSE
|
101
|
-
- README.html
|
102
101
|
- README.md
|
103
102
|
- Rakefile
|
104
103
|
- lib/widescreen.rb
|
105
104
|
- lib/widescreen/dashboard.rb
|
105
|
+
- lib/widescreen/dashboard/public/excanvas.min.js
|
106
106
|
- lib/widescreen/dashboard/public/favicon.ico
|
107
|
+
- lib/widescreen/dashboard/public/jqplot.barRenderer.min.js
|
108
|
+
- lib/widescreen/dashboard/public/jqplot.dateAxisRenderer.min.js
|
109
|
+
- lib/widescreen/dashboard/public/jqplot.highlighter.min.js
|
110
|
+
- lib/widescreen/dashboard/public/jquery-1.6.4.min.js
|
111
|
+
- lib/widescreen/dashboard/public/jquery.jqplot.min.css
|
112
|
+
- lib/widescreen/dashboard/public/jquery.jqplot.min.js
|
107
113
|
- lib/widescreen/dashboard/public/reset.css
|
108
114
|
- lib/widescreen/dashboard/public/style.css
|
109
115
|
- lib/widescreen/dashboard/views/layout.erb
|
@@ -132,7 +138,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
132
138
|
version: '0'
|
133
139
|
segments:
|
134
140
|
- 0
|
135
|
-
hash: -
|
141
|
+
hash: -564252431207624732
|
136
142
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
143
|
none: false
|
138
144
|
requirements:
|
@@ -141,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
147
|
version: '0'
|
142
148
|
segments:
|
143
149
|
- 0
|
144
|
-
hash: -
|
150
|
+
hash: -564252431207624732
|
145
151
|
requirements: []
|
146
152
|
rubyforge_project:
|
147
153
|
rubygems_version: 1.8.10
|
data/README.html
DELETED
@@ -1,178 +0,0 @@
|
|
1
|
-
<head>
|
2
|
-
<style>
|
3
|
-
body {
|
4
|
-
font-family: georgia, arial, helvetica;
|
5
|
-
padding: 1em;
|
6
|
-
}
|
7
|
-
p {
|
8
|
-
max-width: 40em;
|
9
|
-
}
|
10
|
-
h1 {
|
11
|
-
background-color: #f1f1fd;
|
12
|
-
border-bottom: 1px solid blue;
|
13
|
-
padding: .25em 1em;
|
14
|
-
margin: 1em -1em .25em;
|
15
|
-
}
|
16
|
-
</style>
|
17
|
-
</head>
|
18
|
-
<body>
|
19
|
-
<h1>Widescreen<a href="http://travis-ci.org/martinciu/widescreen"><img src="https://secure.travis-ci.org/martinciu/widescreen.png?branch=master" alt="travis-ci" /></a></h1>
|
20
|
-
|
21
|
-
<p>Rack based event statistic framework for any Rack app</p>
|
22
|
-
|
23
|
-
<h2>Requirements</h2>
|
24
|
-
|
25
|
-
<p>Widescreen uses redis as a datastore.</p>
|
26
|
-
|
27
|
-
<p>Widescreen only supports redis 2.0 or greater.</p>
|
28
|
-
|
29
|
-
<p>If you're on OS X, Homebrew is the simplest way to install Redis:</p>
|
30
|
-
|
31
|
-
<pre><code>$ brew install redis
|
32
|
-
$ redis-server /usr/local/etc/redis.conf
|
33
|
-
</code></pre>
|
34
|
-
|
35
|
-
<p>You now have a Redis daemon running on 6379.</p>
|
36
|
-
|
37
|
-
<h2>Setup</h2>
|
38
|
-
|
39
|
-
<p>If you are using bundler add widescreen to your Gemfile:</p>
|
40
|
-
|
41
|
-
<pre><code>gem 'widescreen'
|
42
|
-
</code></pre>
|
43
|
-
|
44
|
-
<p>Then run:</p>
|
45
|
-
|
46
|
-
<pre><code>bundle install
|
47
|
-
</code></pre>
|
48
|
-
|
49
|
-
<p>Otherwise install the gem:</p>
|
50
|
-
|
51
|
-
<pre><code>gem install widescreen
|
52
|
-
</code></pre>
|
53
|
-
|
54
|
-
<p>and require it in your project:</p>
|
55
|
-
|
56
|
-
<pre><code>require 'widescreen'
|
57
|
-
</code></pre>
|
58
|
-
|
59
|
-
<h2>Usage</h2>
|
60
|
-
|
61
|
-
<p>Anywhere in you code call</p>
|
62
|
-
|
63
|
-
<pre><code>Widescreen::Stat.add(:metric_name, 10)
|
64
|
-
</code></pre>
|
65
|
-
|
66
|
-
<p>to increase counter by 10 for <code>metric_name</code> metric or</p>
|
67
|
-
|
68
|
-
<pre><code>Widescreen::Stat.add(:metric_name)
|
69
|
-
</code></pre>
|
70
|
-
|
71
|
-
<p>to increase it by 1</p>
|
72
|
-
|
73
|
-
<h2>Web Interface</h2>
|
74
|
-
|
75
|
-
<p>Widescreen comes with a Sinatra-based front end to get an overview of how your experiments are doing.</p>
|
76
|
-
|
77
|
-
<p>If you are running Rails 2: You can mount this inside your app using Rack::URLMap in your <code>config.ru </code></p>
|
78
|
-
|
79
|
-
<pre><code>require 'widescreen/dashboard'
|
80
|
-
|
81
|
-
run Rack::URLMap.new \
|
82
|
-
"/" => Your::App.new,
|
83
|
-
"/widescreen" => Widescreen::Dashboard.new
|
84
|
-
</code></pre>
|
85
|
-
|
86
|
-
<p>However, if you are using Rails 3: You can mount this inside your app routes by first adding this to config/routes.rb</p>
|
87
|
-
|
88
|
-
<pre><code>mount Widescreen::Dashboard, :at => 'widescreen'
|
89
|
-
</code></pre>
|
90
|
-
|
91
|
-
<p>You may want to password protect that page, you can do so with <code>Rack::Auth::Basic</code></p>
|
92
|
-
|
93
|
-
<pre><code>Widescreen::Dashboard.use Rack::Auth::Basic do |username, password|
|
94
|
-
username == 'admin' && password == 'p4s5w0rd'
|
95
|
-
end
|
96
|
-
</code></pre>
|
97
|
-
|
98
|
-
<p>Dashboard is heavely inspirated by <a href="https://github.com/defunkt/resque">Resque</a> and <a href="https://github.com/andrew/split">Split</a></p>
|
99
|
-
|
100
|
-
<h2>Configuration</h2>
|
101
|
-
|
102
|
-
<h3>Redis</h3>
|
103
|
-
|
104
|
-
<p>You may want to change the Redis host and port Wide connects to, or
|
105
|
-
set various other options at startup.</p>
|
106
|
-
|
107
|
-
<p>Widescreen has a <code>redis</code> setter which can be given a string or a Redis
|
108
|
-
object. This means if you're already using Redis in your app, Widescreen
|
109
|
-
can re-use the existing connection.</p>
|
110
|
-
|
111
|
-
<p>String: <code>Widescreen.redis = 'localhost:6379'</code></p>
|
112
|
-
|
113
|
-
<p>Redis: <code>Widescreen.redis = $redis</code></p>
|
114
|
-
|
115
|
-
<p>For our rails app we have a <code>config/initializers/widescreen.rb</code> file where
|
116
|
-
we load <code>config/widescreen.yml</code> by hand and set the Redis information
|
117
|
-
appropriately.</p>
|
118
|
-
|
119
|
-
<p>Here's our <code>config/widescreen.yml</code>:</p>
|
120
|
-
|
121
|
-
<pre><code>development: localhost:6379
|
122
|
-
test: localhost:6379
|
123
|
-
staging: redis1.example.com:6379
|
124
|
-
fi: localhost:6379
|
125
|
-
production: redis1.example.com:6379
|
126
|
-
</code></pre>
|
127
|
-
|
128
|
-
<p>And our initializer:</p>
|
129
|
-
|
130
|
-
<pre><code>rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..'
|
131
|
-
rails_env = ENV['RAILS_ENV'] || 'development'
|
132
|
-
|
133
|
-
widescreen_config = YAML.load_file(rails_root + '/config/widescreen.yml')
|
134
|
-
Widescreen.redis = widescreen_config[rails_env]
|
135
|
-
</code></pre>
|
136
|
-
|
137
|
-
<h2>Namespaces</h2>
|
138
|
-
|
139
|
-
<p>If you're running multiple, separate instances of widescreen you may want
|
140
|
-
to namespace the keyspaces so they do not overlap. This is not unlike
|
141
|
-
the approach taken by many memcached clients.</p>
|
142
|
-
|
143
|
-
<p>This feature is provided by the [redis-namespace][rs] library, which
|
144
|
-
widescreen uses by default to separate the keys it manages from other keys
|
145
|
-
in your Redis server.</p>
|
146
|
-
|
147
|
-
<p>Simply use the <code>Widescreen.redis.namespace</code> accessor:</p>
|
148
|
-
|
149
|
-
<pre><code>Widescreen.redis.namespace = "widescreen:blog"
|
150
|
-
</code></pre>
|
151
|
-
|
152
|
-
<p>We recommend sticking this in your initializer somewhere after Redis
|
153
|
-
is configured.</p>
|
154
|
-
|
155
|
-
<h2>Development</h2>
|
156
|
-
|
157
|
-
<p>Source hosted at <a href="http://github.com/martinciu/widescreen">GitHub</a>.
|
158
|
-
Report Issues/Feature requests on <a href="http://github.com/martinciu/widescreen/issues">GitHub Issues</a>.</p>
|
159
|
-
|
160
|
-
<p>Tests can be ran with <code>rake test</code></p>
|
161
|
-
|
162
|
-
<h3>Note on Patches/Pull Requests</h3>
|
163
|
-
|
164
|
-
<ul>
|
165
|
-
<li>Fork the project.</li>
|
166
|
-
<li>Make your feature addition or bug fix.</li>
|
167
|
-
<li>Add tests for it. This is important so I don't break it in a
|
168
|
-
future version unintentionally.</li>
|
169
|
-
<li>Commit, do not mess with rakefile, version, or history.
|
170
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)</li>
|
171
|
-
<li>Send me a pull request. Bonus points for topic branches.</li>
|
172
|
-
</ul>
|
173
|
-
|
174
|
-
|
175
|
-
<h2>Copyright</h2>
|
176
|
-
|
177
|
-
<p>Copyright (c) 2011 Marcin Ciunelis. See <a href="https://github.com/martinciu/widescreen/blob/master/LICENSE">LICENSE</a> for details.</p>
|
178
|
-
|