Class: SISFC::Configuration
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Logging
included, logger, #logger
Constructor Details
Returns a new instance of Configuration.
70
71
72
|
# File 'lib/sisfc/configuration.rb', line 70
def initialize(filename)
@filename = filename
end
|
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
68
69
70
|
# File 'lib/sisfc/configuration.rb', line 68
def filename
@filename
end
|
Class Method Details
.load_from_file(filename) ⇒ Object
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
# File 'lib/sisfc/configuration.rb', line 109
def self.load_from_file(filename)
raise ArgumentError, "File #{filename} does not exist!" unless File.exists?(filename)
conf = Configuration.new(filename)
conf.instance_eval(File.new(filename, 'r').read)
conf.validate
conf
end
|
Instance Method Details
#end_time ⇒ Object
74
75
76
|
# File 'lib/sisfc/configuration.rb', line 74
def end_time
@start_time + @duration
end
|
#validate ⇒ Object
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
# File 'lib/sisfc/configuration.rb', line 78
def validate
@start_time = @start_time.to_f
@duration = @duration.to_f
@warmup_duration = @warmup_duration.to_f
@kpi_customization ||= {}
@request_generation.each do |k,v|
v = v.gsub('<pwd>', File.expand_path(File.dirname(@filename)))
end
IceNine.deep_freeze(@constraints)
IceNine.deep_freeze(@customers)
IceNine.deep_freeze(@custom_stats)
IceNine.deep_freeze(@data_centers)
IceNine.deep_freeze(@duration)
IceNine.deep_freeze(@evaluation)
IceNine.deep_freeze(@kpi_customization)
IceNine.deep_freeze(@latency_models)
IceNine.deep_freeze(@request_generation)
IceNine.deep_freeze(@service_component_types)
IceNine.deep_freeze(@start_time)
IceNine.deep_freeze(@warmup_duration)
IceNine.deep_freeze(@workflow_types)
end
|