             # track tasks take the longest time processing in
             # `longest:task_name` sorted set.
             if not err
+              finish_time  = Date.now()
+              process_time = finish_time - start_time
               @redis.hincrby @key('STATISTICS'), 'finished', 1
               @redis.hincrby @key('STATISTICS'), 'total_pending_time', start_time - @queued_time
               @redis.hincrby @key('STATISTICS'), 'total_processing_time', process_time


        retry = => setTimeout (=> @process task), @retry_delay

        # Different error handling approaches:
        #
        #   + `block`: block the group immediately.
        #   + `block-after-retry`: retry n times, block the group if still

      # Process the result of the transaction.
      #
      # 1. Process `STATISTICS` hash:
      #   + Convert:
      #     - `total_pending_time`, and `total_processing_time` into:
      #     - `average_pending_time`, and `average_processing_time`
      #   + Calibrate initial condition (in case of no task is finished).
      # 2. Set `failed` key of returned object.
      statistics = multi_res[0] or {}
      result =
