Class: Arachni::OptionGroups::Dispatcher
- Inherits:
-
Arachni::OptionGroup
- Object
- Arachni::OptionGroup
- Arachni::OptionGroups::Dispatcher
- Defined in:
- lib/arachni/option_groups/dispatcher.rb
Overview
Holds options for RPC::Server::Dispatcher servers.
Constant Summary collapse
- GRID_MODES =
Returns Supported grid modes.
[:balance, :aggregate]
Instance Attribute Summary collapse
-
#external_address ⇒ String
External (hostname or IP) address for the RPC::Server::Dispatcher to advertise.
-
#grid_mode ⇒ nil, Symbol
Grid mode to use for multi-RPC::Server::Instance scans with interconnected RPC::Server::Dispatchers, available modes are:.
-
#instance_port_range ⇒ Array<Integer>
Range of ports to use when spawning instances, first entry should be the lowest port number, last the max port number.
-
#neighbour ⇒ String
The URL of a neighbouring RPC::Server::Dispatcher, applicable when RPC::Server::Dispatcher are connected to each other to form a Grid.
-
#node_cost ⇒ Float
Cost of using this Dispatcher node.
-
#node_nickname ⇒ String
Dispatcher node nickname.
-
#node_ping_interval ⇒ Float
How soon to check for #neighbour node status.
-
#node_pipe_id ⇒ String
A string identifying the bandwidth pipe used by this Dispatcher node.
-
#node_weight ⇒ Float
Weight used to calculate the score of this Dispatcher node.
-
#pool_size ⇒ Integer
Amount of RPC::Server::Instances to keep in the RPC::Server::Dispatcher pool.
-
#url ⇒ String
URL of a RPC::Server::Dispatcher (used by the UI::CLI::RPC client interface).
Instance Method Summary collapse
- #grid=(bool) ⇒ Object
-
#grid? ⇒ Bool
`true` if the Grid should be used, `false` otherwise.
-
#grid_aggregate? ⇒ Bool
`true` if the grid mode is in line-aggregation mode, `false` otherwise.
-
#grid_balance? ⇒ Bool
`true` if the grid mode is in load-balancing mode, `false` otherwise.
Methods inherited from Arachni::OptionGroup
#==, attr_accessor, attributes, #attributes, defaults, #defaults, #hash, inherited, #initialize, #merge, set_defaults, #to_h, #to_hash, #to_rpc_data, #update, #validate
Constructor Details
This class inherits a constructor from Arachni::OptionGroup
Instance Attribute Details
#external_address ⇒ String
Returns External (hostname or IP) address for the RPC::Server::Dispatcher to advertise.
27 28 29 |
# File 'lib/arachni/option_groups/dispatcher.rb', line 27 def external_address @external_address end |
#grid_mode ⇒ nil, Symbol
Returns Grid mode to use for multi-RPC::Server::Instance scans with interconnected RPC::Server::Dispatchers, available modes are:
-
`nil` – No grid.
-
`:balance` – Default load balancing across available Dispatchers.
-
`:aggregate` – Default load balancing *with* line aggregation.
Will only request Instances from Grid members with different {OptionGroups::Dispatcher#node_pipe_id Pipe-IDs}.
48 49 50 |
# File 'lib/arachni/option_groups/dispatcher.rb', line 48 def grid_mode @grid_mode end |
#instance_port_range ⇒ Array<Integer>
Returns Range of ports to use when spawning instances, first entry should be the lowest port number, last the max port number.
37 38 39 |
# File 'lib/arachni/option_groups/dispatcher.rb', line 37 def instance_port_range @instance_port_range end |
#neighbour ⇒ String
Returns The URL of a neighbouring RPC::Server::Dispatcher, applicable when RPC::Server::Dispatcher are connected to each other to form a Grid.
55 56 57 |
# File 'lib/arachni/option_groups/dispatcher.rb', line 55 def neighbour @neighbour end |
#node_cost ⇒ Float
Returns Cost of using this Dispatcher node.
63 64 65 |
# File 'lib/arachni/option_groups/dispatcher.rb', line 63 def node_cost @node_cost end |
#node_nickname ⇒ String
Returns Dispatcher node nickname.
75 76 77 |
# File 'lib/arachni/option_groups/dispatcher.rb', line 75 def node_nickname @node_nickname end |
#node_ping_interval ⇒ Float
Returns How soon to check for #neighbour node status.
59 60 61 |
# File 'lib/arachni/option_groups/dispatcher.rb', line 59 def node_ping_interval @node_ping_interval end |
#node_pipe_id ⇒ String
Returns A string identifying the bandwidth pipe used by this Dispatcher node.
67 68 69 |
# File 'lib/arachni/option_groups/dispatcher.rb', line 67 def node_pipe_id @node_pipe_id end |
#node_weight ⇒ Float
Returns Weight used to calculate the score of this Dispatcher node.
71 72 73 |
# File 'lib/arachni/option_groups/dispatcher.rb', line 71 def node_weight @node_weight end |
#pool_size ⇒ Integer
Returns Amount of RPC::Server::Instances to keep in the RPC::Server::Dispatcher pool.
32 33 34 |
# File 'lib/arachni/option_groups/dispatcher.rb', line 32 def pool_size @pool_size end |
#url ⇒ String
Returns URL of a RPC::Server::Dispatcher (used by the UI::CLI::RPC client interface).
22 23 24 |
# File 'lib/arachni/option_groups/dispatcher.rb', line 22 def url @url end |
Instance Method Details
#grid=(bool) ⇒ Object
92 93 94 |
# File 'lib/arachni/option_groups/dispatcher.rb', line 92 def grid=( bool ) @grid_mode = bool ? :balance : nil end |
#grid? ⇒ Bool
Returns `true` if the Grid should be used, `false` otherwise.
85 86 87 |
# File 'lib/arachni/option_groups/dispatcher.rb', line 85 def grid? !!@grid_mode end |
#grid_aggregate? ⇒ Bool
Returns `true` if the grid mode is in line-aggregation mode, `false` otherwise.
121 122 123 |
# File 'lib/arachni/option_groups/dispatcher.rb', line 121 def grid_aggregate? @grid_mode == :aggregate end |
#grid_balance? ⇒ Bool
Returns `true` if the grid mode is in load-balancing mode, `false` otherwise.
127 128 129 |
# File 'lib/arachni/option_groups/dispatcher.rb', line 127 def grid_balance? @grid_mode == :balance end |