Module: FiverunsTuneupMerb::Instrumentation::DataMapper::Repository::Ext

Defined in:
lib/fiveruns_tuneup_merb/instrumentation.rb

Instance Method Summary collapse

Instance Method Details

#delete(query) ⇒ Object



176
177
178
179
180
181
182
183
# File 'lib/fiveruns_tuneup_merb/instrumentation.rb', line 176

def delete(query)
  Fiveruns::Tuneup.step("DM Delete", :model,
    'Query' => [
      FiverunsTuneupMerb::Instrumentation.format_sql(query, adapter.send(:delete_statement, query)),
      {'Raw Details' => FiverunsTuneupMerb::Instrumentation.format_query(query)}
    ]
  ) { super }
end

#read_many(query) ⇒ Object



149
150
151
152
153
154
155
156
# File 'lib/fiveruns_tuneup_merb/instrumentation.rb', line 149

def read_many(query)
  Fiveruns::Tuneup.step("DM Read Many", :model,
    'Query' => [
      FiverunsTuneupMerb::Instrumentation.format_sql(query, adapter.send(:read_statement, query)),
      {'Raw Details' => FiverunsTuneupMerb::Instrumentation.format_query(query)}
    ]
  ) { super }
end

#read_one(query) ⇒ Object



158
159
160
161
162
163
164
165
# File 'lib/fiveruns_tuneup_merb/instrumentation.rb', line 158

def read_one(query)
  Fiveruns::Tuneup.step("DM Read One ", :model,
    'Query' => [
      FiverunsTuneupMerb::Instrumentation.format_sql(query, adapter.send(:read_statement, query)),
      {'Raw Details' => FiverunsTuneupMerb::Instrumentation.format_query(query)}
     ]
  ) { super }
end

#update(attributes, query) ⇒ Object



167
168
169
170
171
172
173
174
# File 'lib/fiveruns_tuneup_merb/instrumentation.rb', line 167

def update(attributes, query)
  Fiveruns::Tuneup.step("DM Update", :model,
    'Query' => [
      FiverunsTuneupMerb::Instrumentation.format_sql(query, adapter.send(:update_statement, query), attributes),
      {'Raw Details' => FiverunsTuneupMerb::Instrumentation.format_query(query)}
     ]
  ) { super }
end