nesta-plugin-diskcached 0.0.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/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ lib/bundler/man
11
+ pkg
12
+ rdoc
13
+ spec/reports
14
+ test/tmp
15
+ test/version_tmp
16
+ tmp
17
+ .*sw*
18
+ vendor/bundle
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in nesta-plugin-diskcached.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Joshua Mervine
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,56 @@
1
+ # Nesta::Plugin::Diskcached
2
+
3
+ ### [Documentation](http://jmervine.github.com/nesta-plugin-diskcached/doc/index.html) | [Why?](https://github.com/jmervine/nesta-plugin-diskcached/blob/master/WHY.md) | [NestaCMS.com](http://nestacms.com) | [Diskcached](http://diskcached.rubyops.net/)
4
+
5
+ A Nesta Plugin for disk cache via diskcached. It is an alternative to using Nesta's built in Sinatra::Cache, which wasn't working quite right for me.
6
+
7
+ ## Installation
8
+
9
+ > ONCE COMPLETED -- This doesn't work yet!
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ gem 'nesta-plugin-diskcached'
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install nesta-plugin-diskcached
22
+
23
+ ## Usage
24
+
25
+ Add optional params to your config/config.yml
26
+
27
+ diskcached: true # default
28
+ diskcached_timeout: 3600 # default (in seconds)
29
+ diskcached_dir: /tmp/diskcached
30
+ # defaults to "Nesta::Env.root/diskcached"
31
+ #
32
+ # Values added for 'diskcached_dir' should
33
+ # be a full path starting with '/', otherwise
34
+ # Nesta::Env.root will be added to the beginning
35
+ # of the path string.
36
+
37
+ ## Notes
38
+
39
+ 1. This has not been tested with nesta-plugin-simplicity and does
40
+ not include overrides to include cacheing for anything Nesta's
41
+ default renderers, namely:
42
+ - haml
43
+ - erb
44
+ 2. Currently this creates cache files for everything passed through
45
+ rendering, which mean it creates a lot of extra and unused files.
46
+ Ideally, it would only create a file for the final rendered result.
47
+ It really doesn't hurt performance, but is just a bit ugly.
48
+
49
+
50
+ ## Contributing
51
+
52
+ 1. Fork it
53
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
54
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
55
+ 4. Push to the branch (`git push origin my-new-feature`)
56
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
3
+
4
+ task :doc do
5
+ puts %x{ yard --protected ./lib }
6
+ end
7
+
8
+ task :pages do
9
+ puts %x{ git checkout gh-pages && git merge master && git push }
10
+ puts %x{ git checkout - }
11
+ end
data/WHY.md ADDED
@@ -0,0 +1,56 @@
1
+ # Why?
2
+
3
+ > Both tests are with Unicorn running 1 worker.
4
+
5
+ ### With Diskcached
6
+
7
+ httperf --client=0/1 --server=localhost --port=8080 --uri=/ --send-buffer=4096 --recv-buffer=16384 --num-conns=100 --num-calls=1
8
+ Maximum connect burst length: 1
9
+
10
+ Total: connections 100 requests 100 replies 100 test-duration 0.991 s
11
+
12
+ Connection rate: 100.9 conn/s (9.9 ms/conn, <=1 concurrent connections)
13
+ Connection time [ms]: min 5.4 avg 9.9 max 136.0 median 6.5 stddev 13.3
14
+ Connection time [ms]: connect 0.1
15
+ Connection length [replies/conn]: 1.000
16
+
17
+ Request rate: 100.9 req/s (9.9 ms/req)
18
+ Request size [B]: 62.0
19
+
20
+ Reply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (0 samples)
21
+ Reply time [ms]: response 9.6 transfer 0.2
22
+ Reply size [B]: header 308.0 content 5203.0 footer 0.0 (total 5511.0)
23
+ Reply status: 1xx=0 2xx=100 3xx=0 4xx=0 5xx=0
24
+
25
+ CPU time [s]: user 0.65 system 0.34 (user 65.5% system 34.3% total 99.8%)
26
+ Net I/O: 549.2 KB/s (4.5*10^6 bps)
27
+
28
+ Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
29
+ Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
30
+
31
+
32
+ ### Without Diskcached
33
+
34
+ httperf --verbose --client=0/1 --server=localhost --port=8080 --uri=/ --send-buffer=4096 --recv-buffer=16384 --num-conns=100 --num-calls=1
35
+ httperf: maximum number of open descriptors = 1024reply-rate = 9.6 Maximum connect burst length: 1Total: connections 100 requests 100 replies 100 test-duration 9.898 s
36
+ Connection rate: 10.1 conn/s (99.0 ms/conn, <=1 concurrent connections)
37
+ Connection time [ms]: min 83.0 avg 99.0 max 155.0 median 96.5 stddev 12.6
38
+ Connection time [ms]: connect 0.1
39
+ Connection length [replies/conn]: 1.000
40
+
41
+ Request rate: 10.1 req/s (99.0 ms/req)
42
+ Request size [B]: 62.0
43
+
44
+ Reply rate [replies/s]: min 9.6 avg 9.6 max 9.6 stddev 0.0 (1 samples)
45
+ Reply time [ms]: response 98.6 transfer 0.3
46
+ Reply size [B]: header 308.0 content 5203.0 footer 0.0 (total 5511.0)
47
+ Reply status: 1xx=0 2xx=100 3xx=0 4xx=0 5xx=0
48
+
49
+ CPU time [s]: user 6.36 system 3.52 (user 64.2% system 35.6% total 99.8%)
50
+ Net I/O: 55.0 KB/s (0.5*10^6 bps)
51
+
52
+ Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
53
+ Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
54
+
55
+
56
+
@@ -0,0 +1,131 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: Nesta::App
8
+
9
+ &mdash; Documentation by YARD 0.8.2.1
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (A)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Nesta.html" title="Nesta (module)">Nesta</a></span></span>
36
+ &raquo;
37
+ <span class="title">App</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: Nesta::App
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Nesta::App</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/nesta-plugin-diskcached/init.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>Setup diskcached global right off the bat!</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+
113
+ </div>
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+ </div>
123
+
124
+ <div id="footer">
125
+ Generated on Thu Aug 23 01:20:42 2012 by
126
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
127
+ 0.8.2.1 (ruby-1.9.3).
128
+ </div>
129
+
130
+ </body>
131
+ </html>