lib/time/task_timer.rb in bblib-0.4.1 vs lib/time/task_timer.rb in bblib-1.0.2
- old
+ new
@@ -5,11 +5,13 @@
# @author Brandon Black
# @attr [Hash] tasks The information on all running tasks and history of all tasks up to the retention.
# @attr [Integer] retention The number of runs to collect per task before truncation.
class TaskTimer
include Effortless
+ include Prototype unless BBLib.in_opal?
+
attr_hash :tasks, default: {}, serialize: false
- attr_int_between -1, nil, :retention, default: 100
+ attr_int_between(-1, nil, :retention, default: 100)
# Returns an aggregated metric for a given type.
#
# @param [Symbol] task The key value of the task to retrieve
# @param [Symbol] type The metric to return.