flipper 0.9.0.beta1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +3 -2
- data/README.md +1 -1
- data/docs/Optimization.md +21 -0
- data/examples/instrumentation.rb +5 -1
- data/lib/flipper/adapters/instrumented.rb +1 -1
- data/lib/flipper/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b652fece0396573ae1b1a0421e62a4af587ed8ab
|
4
|
+
data.tar.gz: 9975765465d8c377410e413e36cd1f82307e5268
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d923bc109e23e0ea10e757560794d3e25da0947f41ab86083827a24e9cc0adc2d81515131c778082ad07b493ba9090663780816b75af7945822f588a5ce8256c
|
7
|
+
data.tar.gz: 03d80c2410192638666e905272a321cb7e5ee0841ac3b5faa6ee9619cd68983036dc3c78a0da1b8866e51bd5d61f767825b33863d8175073d932d5ea34cd8096
|
data/Changelog.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
##
|
1
|
+
## 0.9.0
|
2
2
|
|
3
3
|
* Moves SharedAdapterTests module to Flipper::Test::SharedAdapterTests to avoid clobbering anything top level in apps that use Flipper
|
4
4
|
* Memoizable, Instrumented and OperationLogger now delegate any missing methods to the original adapter. This was lost with the removal of the official decorator in 0.8, but is actually useful functionality for these "wrapping" adapters.
|
5
5
|
* Instrumenting adapters is now off by default. Use Flipper::Adapters::Instrumented.new(adapter) to instrument adapters and maintain the old functionality.
|
6
|
+
* Added dalli cache adapter (https://github.com/jnunemaker/flipper/pull/132)
|
6
7
|
|
7
8
|
## 0.8
|
8
9
|
|
@@ -28,7 +29,7 @@
|
|
28
29
|
|
29
30
|
## 0.7.3
|
30
31
|
|
31
|
-
* Add Flipper
|
32
|
+
* Add Flipper ActiveRecord adapter
|
32
33
|
|
33
34
|
## 0.7.2
|
34
35
|
|
data/README.md
CHANGED
@@ -70,7 +70,7 @@ Of course there are more [examples for you to peruse](examples/). You could also
|
|
70
70
|
* [Gates](docs/Gates.md) - Boolean, Groups, Actors, % of Actors, and % of Time
|
71
71
|
* [Adapters](docs/Adapters.md) - Mongo, Redis, Cassandra, Active Record...
|
72
72
|
* [Instrumentation](docs/Instrumentation.md) - ActiveSupport::Notifications, Statsd and Metriks
|
73
|
-
* [Optimization](docs/Optimization.md) - Memoization middleware
|
73
|
+
* [Optimization](docs/Optimization.md) - Memoization middleware and Cache adapters
|
74
74
|
* [Web Interface](docs/ui/README.md) - Point and click...
|
75
75
|
* [Caveats](docs/Caveats.md) - Flipper beware! (see what I did there)
|
76
76
|
|
data/docs/Optimization.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Optimization
|
2
2
|
|
3
|
+
## Memoizing Middleware
|
4
|
+
|
3
5
|
One optimization that flipper provides is a memoizing middleware. The memoizing middleware ensures that you only make one adapter call per feature per request.
|
4
6
|
|
5
7
|
This means if you check the same feature over and over, it will only make one Mongo, Redis, or whatever call per feature for the length of the request.
|
@@ -31,3 +33,22 @@ config.middleware.use Flipper::Middleware::Memoizer, lambda {
|
|
31
33
|
```
|
32
34
|
|
33
35
|
**Note**: Be sure that the middleware is high enough up in your stack that all feature checks are wrapped.
|
36
|
+
|
37
|
+
## Cache Adapters
|
38
|
+
|
39
|
+
Cache adapters allow you to cache adapter calls for longer than a single request and should be used alongside the memoization middleware to add another caching layer.
|
40
|
+
|
41
|
+
### Dalli
|
42
|
+
|
43
|
+
> Dalli is a high performance pure Ruby client for accessing memcached servers.
|
44
|
+
|
45
|
+
https://github.com/petergoldstein/dalli
|
46
|
+
|
47
|
+
Example using the Dalli cache adapter with the Memory adapter and a TTL of 600 seconds:
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
dalli_client = Dalli::Client.new('localhost:11211')
|
51
|
+
memory_adapter = Flipper::Adapters::Memory.new
|
52
|
+
adapter = Flipper::Adapters::Dalli.new(memory_adapter, dalli_client, 600)
|
53
|
+
flipper = Flipper.new(adapter)
|
54
|
+
```
|
data/examples/instrumentation.rb
CHANGED
@@ -14,12 +14,16 @@ end
|
|
14
14
|
|
15
15
|
require 'flipper'
|
16
16
|
require 'flipper/adapters/memory'
|
17
|
+
require 'flipper/adapters/instrumented'
|
17
18
|
|
18
19
|
# pick an adapter
|
19
20
|
adapter = Flipper::Adapters::Memory.new
|
20
21
|
|
22
|
+
# instrument it if you want, if not you still get the feature instrumentation
|
23
|
+
instrumented = Flipper::Adapters::Instrumented.new(adapter, :instrumenter => ActiveSupport::Notifications)
|
24
|
+
|
21
25
|
# get a handy dsl instance
|
22
|
-
flipper = Flipper.new(
|
26
|
+
flipper = Flipper.new(instrumented, :instrumenter => ActiveSupport::Notifications)
|
23
27
|
|
24
28
|
# grab a feature
|
25
29
|
search = flipper[:search]
|
@@ -9,7 +9,7 @@ module Flipper
|
|
9
9
|
include ::Flipper::Adapter
|
10
10
|
|
11
11
|
# Private: The name of instrumentation events.
|
12
|
-
InstrumentationName = "adapter_operation.#{InstrumentationNamespace}"
|
12
|
+
InstrumentationName = "adapter_operation.#{InstrumentationNamespace}".freeze
|
13
13
|
|
14
14
|
# Private: What is used to instrument all the things.
|
15
15
|
attr_reader :instrumenter
|
data/lib/flipper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.0
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Feature flipper is the act of enabling/disabling features in your application,
|
14
14
|
ideally without re-deploying or changing anything in your code base. Flipper makes
|
@@ -133,9 +133,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
133
133
|
version: '0'
|
134
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- - "
|
136
|
+
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: '0'
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
141
|
rubygems_version: 2.4.5.1
|