Class: Flare::Tools::Stats

Inherits:
Client
  • Object
show all
Defined in:
lib/flare/tools/stats.rb

Overview

Description

Direct Known Subclasses

IndexServer, Node

Constant Summary

Constants included from Util::Result

Util::Result::ClientError, Util::Result::Deleted, Util::Result::End, Util::Result::Error, Util::Result::Exists, Util::Result::Found, Util::Result::None, Util::Result::NotFound, Util::Result::NotStored, Util::Result::Ok, Util::Result::ServerError, Util::Result::Stored

Constants included from Util::Constant

Util::Constant::DefalutBwlimit, Util::Constant::DefaultIndexServerName, Util::Constant::DefaultIndexServerPort, Util::Constant::DefaultNodePort, Util::Constant::DefaultTimeout, Util::Constant::STATUS_NG, Util::Constant::STATUS_OK

Instance Method Summary collapse

Methods inherited from Client

#close, defcmd, defcmd_generic, defcmd_key, defcmd_listelement, defcmd_noreply, defcmd_oneline, defcmd_value, #host, #hostname, #initialize, open, #port, #received_size, #request, #required_version?, #sent_size, #server_version, #version

Methods included from Util::Logging

#debug, #error, #fatal, #info, logger, #puts, set_logger, #trace, #warn

Methods included from Util::Result

result_of_string, string_of_result

Constructor Details

This class inherits a constructor from Flare::Tools::Client

Instance Method Details

#stats_threadsObject



49
50
51
52
# File 'lib/flare/tools/stats.rb', line 49

def stats_threads
  return {} unless required_version?([1, 0, 10])
  stats_threads_
end

#stats_threads_by_peerObject



38
39
40
41
42
43
44
45
46
47
# File 'lib/flare/tools/stats.rb', line 38

def stats_threads_by_peer
  result = {}
  stats_threads.each do |thread_id, stat|
    k = stat['peer']
    result[k] = {} if result[k].nil?
    result[k]['thread_id'] = thread_id
    result[k].merge!(stat)
  end
  result
end