Module: Mtracker
- Defined in:
- lib/mtracker.rb,
lib/mtracker/version.rb
Overview
module for tracking time
Constant Summary collapse
- VERSION =
'0.3.1'
Instance Attribute Summary collapse
-
#mtracker_log_pid_and_tid ⇒ Object
Returns the value of attribute mtracker_log_pid_and_tid.
-
#mtracker_slack_url ⇒ Object
Returns the value of attribute mtracker_slack_url.
Instance Method Summary collapse
Instance Attribute Details
#mtracker_log_pid_and_tid ⇒ Object
Returns the value of attribute mtracker_log_pid_and_tid.
5 6 7 |
# File 'lib/mtracker.rb', line 5 def mtracker_log_pid_and_tid @mtracker_log_pid_and_tid end |
#mtracker_slack_url ⇒ Object
Returns the value of attribute mtracker_slack_url.
5 6 7 |
# File 'lib/mtracker.rb', line 5 def mtracker_slack_url @mtracker_slack_url end |
Instance Method Details
#track(label, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mtracker.rb', line 7 def track(label, = {}) slack = [:slack] start_time = Time.now increment_nest_level start_msg = "#{indent}[start#{pid_and_tid}] #{label}" put_track_info start_msg, slack result = yield finish_msg = "#{indent}[end #{pid_and_tid}] #{label} (#{sprintf('%.3f', Time.now - start_time)} sec)" put_track_info finish_msg, slack decrement_nest_level result end |