This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| user system total real | |
| Create 1000 posts with DM and Redis 0.390000 0.130000 0.520000 ( 0.798371) | |
| Create 1000 posts with DM and Postgres 0.430000 0.060000 0.490000 ( 1.276239) | |
| Create 1000 posts with RedisClient 0.190000 0.150000 0.340000 ( 0.555850) | |
| user system total real | |
| Fetch the 500th post with DM and Redis 0.000000 0.000000 0.000000 ( 0.003334) | |
| Fetch the 500th post's text with DM and Postgres 0.000000 0.000000 0.000000 ( 0.002007) | |
| Fetch the 500th post's text with RedisClient 0.000000 0.000000 0.000000 ( 0.000456) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/dm-validations/lib/dm-validations/validators/uniqueness_validator.rb b/dm-validations/lib/dm-validations/validators/uniquen | |
| index 16fc786..6bec021 100644 | |
| --- a/dm-validations/lib/dm-validations/validators/uniqueness_validator.rb | |
| +++ b/dm-validations/lib/dm-validations/validators/uniqueness_validator.rb | |
| @@ -22,8 +22,11 @@ module DataMapper | |
| repository_name = target.repository.name | |
| + fields = target.model.key.dup | |
| + fields << target.model.properties[field_name] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "moneta" | |
| require 'moneta/redis' | |
| module DataMapper | |
| # Tracks objects to help ensure that each object gets loaded only once. | |
| # See: http://www.martinfowler.com/eaaCatalog/identityMap.html | |
| class IdentityMap < Moneta::Redis | |
| extend Deprecate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module PersistentIdentityMap | |
| def self.included(base) | |
| base.extend(ResourceClassMethods) | |
| end | |
| def _dump(depth) | |
| marshaled_properties = properties.inject({}) do |h, p| | |
| h[p.instance_variable_name] = p.get!(self) | |
| h | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source 'http://rubygems.org' | |
| RAILS_VERSION = '~> 3.0.0.beta4' | |
| DM_VERSION = '~> 1.0.0' | |
| RSPEC_VERSION = '~> 2.0.0.beta.13' | |
| gem 'activesupport', RAILS_VERSION, :require => 'active_support' | |
| gem 'actionpack', RAILS_VERSION, :require => 'action_pack' | |
| gem 'actionmailer', RAILS_VERSION, :require => 'action_mailer' | |
| gem 'railties', RAILS_VERSION, :require => 'rails' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select | |
| s.relname, | |
| s.seq_tup_read + s.idx_tup_fetch usage, | |
| (s.idx_tup_fetch/s.seq_tup_read::float)::decimal(18,4) index_ratio, | |
| s.seq_tup_read, s.idx_tup_fetch, | |
| s.seq_scan, s.n_live_tup, | |
| ((io.heap_blks_hit + io.idx_blks_hit)/((io.heap_blks_read + io.idx_blks_read)::float))::decimal(18,4) cache_hit_ratio | |
| FROM pg_stat_user_tables s | |
| INNER JOIN pg_statio_user_tables io | |
| ON s.relid = io.relid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "account_number":0123456789, | |
| "period_start":YYMMDD, | |
| "period_end":YYMMDD, | |
| "starting_balance":9999.99, | |
| "account_balance":9999.99, | |
| "interest_rate":99.99, | |
| "apy":99.99, | |
| "interest_paid":99.99 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test → pwd | |
| /Users/whoahbot/code/test | |
| test → ls | |
| Gemfile Gemfile.lock | |
| test → cat Gemfile | |
| gem 'typhoeus', '0.4.0' | |
| test → bundle show | |
| Gems included by the bundle: | |
| * activesupport (3.2.3) | |
| * bundler (1.1.1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Object.toQueryString({'buh':[1,2]}); | |
| "buh[0]=1&buh[1]=2" | |
| On the server side, it looks like: | |
| buh = {0 => 1, 1 => 2} | |
| And we have to do buh.values in order to get it to return an array. |