Module: Insight::Database::RequestDataClient
- Included in:
- Panel, SpeedTracer::TraceApp
- Defined in:
- lib/insight/database.rb
Instance Method Summary collapse
- #key_sql_template(sql) ⇒ Object
- #retrieve(request_id) ⇒ Object (also: #retreive)
- #store(env, *keys_and_value) ⇒ Object
- #table_length ⇒ Object
- #table_setup(name, *keys) ⇒ Object
Instance Method Details
#key_sql_template(sql) ⇒ Object
8 9 10 |
# File 'lib/insight/database.rb', line 8 def key_sql_template(sql) @key_sql_template = sql end |
#retrieve(request_id) ⇒ Object Also known as: retreive
30 31 32 |
# File 'lib/insight/database.rb', line 30 def retrieve(request_id) @table.for_request(request_id) end |
#store(env, *keys_and_value) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/insight/database.rb', line 19 def store(env, *keys_and_value) return if env.nil? request_id = env["insight.request-id"] return if request_id.nil? value = keys_and_value[-1] keys = keys_and_value[0...-1] @table.store(request_id, value, @key_sql_template % keys) end |
#table_length ⇒ Object
35 36 37 |
# File 'lib/insight/database.rb', line 35 def table_length @table.length end |