README.textile in methodmissing-scrooge-1.0.2 vs README.textile in methodmissing-scrooge-1.0.3

- old
+ new

@@ -18,19 +18,21 @@ * Track : Track attribute access to dump a representative scope profile. * Scope : Scope the process and related resources to a previously persisted scope profile. -* Track then scope : A multi-stage strategy that tracks attribute access for +* Track then scope : A multi-stage strategy that tracks attribute access for a given warmup period, aggregates the results + across multiple processes and enforce a scoping policy representative of the tracking phase. h2. Resources A resource is : * A controller and action endpoint ( inferred through framework specific routing ) * A content type / format - a PDF representation may have different Model attribute requirements than a vanilla ERB view. * Request method - typically popular public facing GET requests +* Public or Private as a logged in / authenticated representation likely have different attribute requirements. All Model to attribute mappings is tracked on a per Resource basis.Multiple Models per Resource is supported. h2. Strategies @@ -73,10 +75,11 @@ --- - hotels_show_get: :action: show :controller: hotels :method: :get + :is_public: true :format: "*/*" :models: - Address: - line1 - line2 @@ -93,10 +96,11 @@ - location_id - locations_index_get: :action: index :controller: locations :method: :get + :is_public: true :format: "*/*" :models: - Location: - name - created_at @@ -106,10 +110,11 @@ - id - countries_index_get: :action: index :controller: countries :method: :get + :is_public: true :format: "*/*" :models: - Country: - name - created_at @@ -120,10 +125,11 @@ - continent_id - hotels_index_get: :action: index :controller: hotels :method: :get + :is_public: true :format: "*/*" :models: - Hotel: - from_price - narrative @@ -369,69 +375,118 @@ storage: :memory strategy: :track_then_scope warmup: 600 # warmup / track for 10 minutes scope: on_missing_attribute: :reload # or :raise + logged_in_session: :user_id # session key that represents the logged in user enabled: true development: orm: :active_record storage: :memory strategy: :track warmup: 600 # warmup / track for 10 minutes scope: on_missing_attribute: :reload # or :raise + logged_in_session: :user_id # session key that represents the logged in user enabled: true test: orm: :active_record storage: :memory strategy: :track warmup: 600 # warmup / track for 10 minutes scope: on_missing_attribute: :reload # or :raise + logged_in_session: :user_id # session key that represents the logged in user enabled: true </code> </pre> h4. ORM Scrooge is ORM agnostic and ships with an ActiveRecord layer. +<pre> +<code> orm: :active_record +</pre> +</code> h4. Storage backend -Tracking results can be persisted to a given backend or storage option.Ships with a memory store, but can be extended to file system, memcached etc. as all Tracker components is designed to be Marshal friendly. +Tracking results can be persisted to a given backend or storage option.Ships with a memory store, but can be extended to file system, memcached etc. as all Tracker components is designed to be Marshal friendly.A stub for future functionality. +<pre> +<code> storage: :memory +</pre> +</code> +h4. Verbose + +Log all tracking interactions to the framework logger when enabled.Disabled for production. + +<pre> +<code> + verbose: false +</pre> +</code> + h4. Strategy One of :track, :scope or :track_then_scope .Only the :track_then_scope strategy respects the :warmup configuration option. h4. Warmup The designated warmup period for the :track_then_scope strategy, given in seconds.Typically 600 to 3600. +<pre> +<code> + warmup: 600 +</pre> +</code> + h4. Scope A scope is a reference to a timestamped Scrooge run where access to Model attributes is tracked on a per Resource basis. +<pre> +<code> scope: 1234567891 +</pre> +</code> If not scope is given in the configuration, ENV['scope'] would also be considered to facilitate configuration through Capistrano etc. h4. Handling Missing Attributes When the contents for a given Model attribute has not been retrieved from the database, most ORM frameworks raise an error by default.This is configurable to reloading the model with all it's columns or raise instead. +<pre> +<code> on_missing_attribute: :reload # or :raise +</pre> +</code> +h4. Private and Public Resources + +An authenticated or logged in resource likely has different model requirements than it's public counterpart. + +<pre> +<code> + logged_in_session: :user_id # session key that represents the logged in user +</pre> +</code> + h4. Status Scrooge can be disabled with : +<pre> +<code> enabled: false +</pre> +</code> h2. Rails specific rake tasks. Ships with tasks to assist in inspecting results. @@ -462,6 +517,19 @@ </code> </pre> h2. Notes -This is an initial release, has not yet been battle tested in production and is pending Ruby 1.9.1 compatibility. +This is an initial release, has not yet been battle tested in production and is pending Ruby 1.9.1 compatibility. + +Developed on and for Rails 2.3, known to work with Rails 2.2.2 + +h2. Known pending issues + +* Do not track columns that isn't explicitly defined ( AR counter caching checks etc. ) : +<code> +<pre> +ActiveRecord::StatementInvalid (Mysql::Error: Unknown column 'orders.brochures_count' in 'field list': SELECT orders.brochures_count, orders.id FROM `orders` WHERE (`orders`.`id` = 1688139) LIMIT 1) +</code> +</pre> + +* alias_attribute compatibility \ No newline at end of file