def agent_stats(reset = false)
      stats = {
        "request failures"  => @request_failure_stats.all,
        "response failures" => @response_failure_stats.all
      }.merge(ErrorTracker.stats(reset))
      if @mode != :http
        stats["connect requests"] = @connect_request_stats.all
        stats["non-deliveries"] = @non_delivery_stats.all
      end
      reset_agent_stats if reset
      stats
    end
def agent_stats(reset = false)
      stats = {
        "request failures"  => @request_failure_stats.all,
        "response failures" => @response_failure_stats.all
      }.merge(ErrorTracker.stats(reset))
      if @mode != :http
        stats["connect requests"] = @connect_request_stats.all
        stats["non-deliveries"] = @non_delivery_stats.all
      end
      reset_agent_stats if reset
      stats
    end
Get request statistics

 === Parameters
 reset(Boolean):: Whether to reset the statistics after getting the current ones

 === Return
 stats(Hash):: Current statistics:
   "connect requests"(Hash|nil):: Stats about requests to update AMQP broker connections with keys "total", "percent",
     and "last" with percentage breakdown by "connects: <alias>", "disconnects: <alias>", "enroll setup failed:
     <aliases>", or nil if none
   "exceptions"(Hash|nil):: Exceptions raised per category, or nil if none
     "total"(Integer):: Total exceptions for this category
     "recent"(Array):: Most recent as a hash of "count", "type", "message", "when", and "where"
   "non-deliveries"(Hash):: AMQP message non-delivery activity stats with keys "total", "percent", "last", and "rate"
     with percentage breakdown by request type, or nil if none
   "request failures"(Hash|nil):: Request dispatch failure activity stats with keys "total", "percent", "last", and "rate"
     with percentage breakdown per failure type, or nil if none
   "response failures"(Hash|nil):: Response delivery failure activity stats with keys "total", "percent", "last", and "rate"
     with percentage breakdown per failure type, or nil if none