def stats(options = {})
      now = Time.now
      reset = options[:reset]
      stats = {
        "name"            => @agent_name,
        "identity"        => @identity,
        "hostname"        => Socket.gethostname,
        "memory"          => Platform.process.resident_set_size,
        "version"         => AgentConfig.protocol_version,
        "agent stats"     => agent_stats(reset),
        "receive stats"   => dispatcher_stats(reset),
        "send stats"      => @sender.stats(reset),
        "last reset time" => @last_stat_reset_time.to_i,
        "stat time"       => now.to_i,
        "service uptime"  => @history.analyze_service,
        "machine uptime"  => Platform.shell.uptime
      }
      stats["revision"] = @revision if @revision
      if @mode == :http
        stats.merge!(@client.stats(reset))
      else
        stats["brokers"] = @client.stats(reset)
      end
      result = OperationResult.success(stats)
      @last_stat_reset_time = now if reset
      result
    end
def stats(options = {})
      now = Time.now
      reset = options[:reset]
      stats = {
        "name"            => @agent_name,
        "identity"        => @identity,
        "hostname"        => Socket.gethostname,
        "memory"          => Platform.process.resident_set_size,
        "version"         => AgentConfig.protocol_version,
        "agent stats"     => agent_stats(reset),
        "receive stats"   => dispatcher_stats(reset),
        "send stats"      => @sender.stats(reset),
        "last reset time" => @last_stat_reset_time.to_i,
        "stat time"       => now.to_i,
        "service uptime"  => @history.analyze_service,
        "machine uptime"  => Platform.shell.uptime
      }
      stats["revision"] = @revision if @revision
      if @mode == :http
        stats.merge!(@client.stats(reset))
      else
        stats["brokers"] = @client.stats(reset)
      end
      result = OperationResult.success(stats)
      @last_stat_reset_time = now if reset
      result
    end
Retrieve statistics about agent operation

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

 === Return
 result(OperationResult):: Always returns success