Module: Statsn
- Defined in:
- lib/statsn.rb,
lib/statsn/version.rb
Constant Summary collapse
- PREFIX =
"Custom"
- VERSION =
"0.1.1"
Class Attribute Summary collapse
-
.api_key ⇒ Object
Returns the value of attribute api_key.
Class Method Summary collapse
-
.increment(who, amount = 1) ⇒ Object
Increments the count of the key by the given amount, default 1.
-
.time(who, &block) ⇒ Object
Times the given block and returns the output of the block.
Class Attribute Details
.api_key ⇒ Object
Returns the value of attribute api_key.
8 9 10 |
# File 'lib/statsn.rb', line 8 def api_key @api_key end |
Class Method Details
.increment(who, amount = 1) ⇒ Object
Increments the count of the key by the given amount, default 1
11 12 13 |
# File 'lib/statsn.rb', line 11 def increment(who, amount = 1) stat(key(who)).record_data_point(amount) end |
.time(who, &block) ⇒ Object
Times the given block and returns the output of the block
16 17 18 |
# File 'lib/statsn.rb', line 16 def time(who, &block) trace_execution_unscoped(key(who), {}, &block) end |