Class: HealthMode::NetworkIOMetric

Inherits:
Metric
  • Object
show all
Defined in:
lib/metrics/network_io_metric.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.curr_bytes_inObject

Returns the value of attribute curr_bytes_in.



4
5
6
# File 'lib/metrics/network_io_metric.rb', line 4

def curr_bytes_in
  @curr_bytes_in
end

.curr_bytes_outObject

Returns the value of attribute curr_bytes_out.



4
5
6
# File 'lib/metrics/network_io_metric.rb', line 4

def curr_bytes_out
  @curr_bytes_out
end

.curr_packets_inObject

Returns the value of attribute curr_packets_in.



4
5
6
# File 'lib/metrics/network_io_metric.rb', line 4

def curr_packets_in
  @curr_packets_in
end

.curr_packets_outObject

Returns the value of attribute curr_packets_out.



4
5
6
# File 'lib/metrics/network_io_metric.rb', line 4

def curr_packets_out
  @curr_packets_out
end

.curr_system_metricsObject

Returns the value of attribute curr_system_metrics.



4
5
6
# File 'lib/metrics/network_io_metric.rb', line 4

def curr_system_metrics
  @curr_system_metrics
end

.prev_bytes_inObject

Returns the value of attribute prev_bytes_in.



4
5
6
# File 'lib/metrics/network_io_metric.rb', line 4

def prev_bytes_in
  @prev_bytes_in
end

.prev_bytes_outObject

Returns the value of attribute prev_bytes_out.



4
5
6
# File 'lib/metrics/network_io_metric.rb', line 4

def prev_bytes_out
  @prev_bytes_out
end

.prev_packets_inObject

Returns the value of attribute prev_packets_in.



4
5
6
# File 'lib/metrics/network_io_metric.rb', line 4

def prev_packets_in
  @prev_packets_in
end

.prev_packets_outObject

Returns the value of attribute prev_packets_out.



4
5
6
# File 'lib/metrics/network_io_metric.rb', line 4

def prev_packets_out
  @prev_packets_out
end

.prev_system_metricsObject

Returns the value of attribute prev_system_metrics.



4
5
6
# File 'lib/metrics/network_io_metric.rb', line 4

def prev_system_metrics
  @prev_system_metrics
end

Class Method Details

.current_stateObject



15
16
17
18
19
20
21
22
23
# File 'lib/metrics/network_io_metric.rb', line 15

def current_state
  refresh_state
  {
    "bytes_in" => @curr_bytes_in - @prev_bytes_in,
    "bytes_out" => @curr_bytes_out - @prev_bytes_out,
    "packets_in" => @curr_packets_in - @prev_packets_in,
    "packets_out" => @curr_packets_out - @prev_packets_out
  }
end