Class: RRD::Archive
- Inherits:
-
Object
- Object
- RRD::Archive
- Defined in:
- lib/rrd/archive.rb
Constant Summary collapse
- RRA_cdp_xff_val =
0- RRA_hw_alpha =
1- RRA_hw_beta =
2- RRA_dependent_rra_idx =
3- RRA_period =
4- RRA_seasonal_gamma =
1- RRA_seasonal_smoothing_window =
2- RRA_seasonal_smooth_idx =
4- RRA_delta_pos =
1- RRA_delta_neg =
2- RRA_window_len =
4- RRA_failure_threshold =
5
Instance Attribute Summary collapse
-
#cf ⇒ Object
readonly
Returns the value of attribute cf.
-
#current_row ⇒ Object
Returns the value of attribute current_row.
-
#data_pointer ⇒ Object
Returns the value of attribute data_pointer.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#pdpr ⇒ Object
readonly
Returns the value of attribute pdpr.
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
Class Method Summary collapse
Instance Method Summary collapse
- #cdp ⇒ Object
-
#initialize(cf, rows, per_row, options) ⇒ Archive
constructor
A new instance of Archive.
Constructor Details
#initialize(cf, rows, per_row, options) ⇒ Archive
Returns a new instance of Archive.
20 21 22 |
# File 'lib/rrd/archive.rb', line 20 def initialize(cf, rows, per_row, ) @cf, @rows, @pdpr, @options = cf, rows, per_row, end |
Instance Attribute Details
#cf ⇒ Object (readonly)
Returns the value of attribute cf.
16 17 18 |
# File 'lib/rrd/archive.rb', line 16 def cf @cf end |
#current_row ⇒ Object
Returns the value of attribute current_row.
18 19 20 |
# File 'lib/rrd/archive.rb', line 18 def current_row @current_row end |
#data_pointer ⇒ Object
Returns the value of attribute data_pointer.
18 19 20 |
# File 'lib/rrd/archive.rb', line 18 def data_pointer @data_pointer end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
16 17 18 |
# File 'lib/rrd/archive.rb', line 16 def @options end |
#pdpr ⇒ Object (readonly)
Returns the value of attribute pdpr.
16 17 18 |
# File 'lib/rrd/archive.rb', line 16 def pdpr @pdpr end |
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
16 17 18 |
# File 'lib/rrd/archive.rb', line 16 def rows @rows end |
Class Method Details
.parse(reader) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/rrd/archive.rb', line 28 def self.parse(reader) cf = reader.read_string(20, "A*").downcase.to_sym rows, pdpr = reader.read(16, "QQ", align: true) params = reader.read_uniparams(10) = {} case cf when :hwpredict, :mhwpredict [:alpha] = params[RRA_hw_alpha].to_f [:beta] = params[RRA_hw_beta].to_f when :seasonal, :devseasonal [:gamma] = params[RRA_seasonal_gamma].to_f [:smoothing_window] = params[RRA_seasonal_smoothing_window].to_f when :failures [:delta_pos] = params[RRA_delta_pos].to_f [:delta_neg] = params[RRA_delta_neg].to_f [:failure_threshold] = params[RRA_failure_threshold].to_i [:window_length] = params[RRA_window_len].to_i when :devpredict else [:xff] = params[RRA_cdp_xff_val].to_f end Archive.new(cf, rows, pdpr, ) end |
Instance Method Details
#cdp ⇒ Object
24 25 26 |
# File 'lib/rrd/archive.rb', line 24 def cdp @cdp ||= [] end |