sisfc 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.projections.json +12 -0
- data/.travis.yml +6 -0
- data/README.md +37 -19
- data/Rakefile +4 -2
- data/TODO +5 -0
- data/bin/sisfc +29 -6
- data/examples/generator.R +3 -1
- data/examples/simulator.conf +80 -29
- data/lib/sisfc.rb +4 -4
- data/lib/sisfc/configuration.rb +73 -6
- data/lib/sisfc/data_center.rb +42 -29
- data/lib/sisfc/evaluation.rb +23 -15
- data/lib/sisfc/event.rb +9 -6
- data/lib/sisfc/generator.rb +14 -21
- data/lib/sisfc/latency_manager.rb +65 -0
- data/lib/sisfc/logger.rb +28 -0
- data/lib/sisfc/request.rb +42 -85
- data/lib/sisfc/service_type.rb +2 -0
- data/lib/sisfc/simulation.rb +234 -47
- data/lib/sisfc/sorted_array.rb +2 -0
- data/lib/sisfc/statistics.rb +37 -3
- data/lib/sisfc/support/dsl_helper.rb +2 -0
- data/lib/sisfc/version.rb +3 -1
- data/lib/sisfc/vm.rb +46 -27
- data/sisfc.gemspec +9 -5
- data/spec/minitest_helper.rb +9 -0
- data/{test/sisfc/configuration_test.rb → spec/sisfc/configuration_spec.rb} +4 -2
- data/spec/sisfc/data_center_spec.rb +19 -0
- data/{test/sisfc/evaluation_test.rb → spec/sisfc/evaluation_spec.rb} +5 -3
- data/{test/sisfc/generator_test.rb → spec/sisfc/generator_spec.rb} +21 -18
- data/spec/sisfc/latency_manager_spec.rb +13 -0
- data/spec/sisfc/reference_configuration.rb +534 -0
- data/spec/sisfc/request_spec.rb +19 -0
- metadata +115 -49
- data/test/sisfc/reference_configuration.rb +0 -191
- data/test/sisfc/request_test.rb +0 -13
- data/test/test_helper.rb +0 -4
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'minitest_helper'
|
4
|
+
|
5
|
+
require_relative './reference_configuration'
|
6
|
+
|
7
|
+
|
8
|
+
describe SISFC::Request do
|
9
|
+
|
10
|
+
it 'should create a valid request' do
|
11
|
+
r = SISFC::Request.new(rid: rand(100),
|
12
|
+
generation_time: (Time.now - 1.hour).to_f,
|
13
|
+
initial_data_center_id: rand(10),
|
14
|
+
arrival_time: Time.now.to_f,
|
15
|
+
workflow_type_id: rand(4),
|
16
|
+
customer_id: 0)
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
metadata
CHANGED
@@ -1,85 +1,141 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sisfc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mauro Tortonesi
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
+
name: as-duration
|
14
15
|
requirement: !ruby/object:Gem::Requirement
|
15
16
|
requirements:
|
16
|
-
- - ~>
|
17
|
+
- - "~>"
|
17
18
|
- !ruby/object:Gem::Version
|
18
|
-
version:
|
19
|
-
name: activesupport
|
20
|
-
prerelease: false
|
19
|
+
version: 0.1.1
|
21
20
|
type: :runtime
|
21
|
+
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.1.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
+
name: erv
|
28
29
|
requirement: !ruby/object:Gem::Requirement
|
29
30
|
requirements:
|
30
|
-
- - ~>
|
31
|
+
- - "~>"
|
31
32
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
33
|
-
|
33
|
+
version: 0.3.5
|
34
|
+
type: :runtime
|
34
35
|
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.3.5
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: ice_nine
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.11.2
|
35
48
|
type: :runtime
|
49
|
+
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
|
-
- - ~>
|
52
|
+
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
54
|
+
version: 0.11.2
|
41
55
|
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
42
57
|
requirement: !ruby/object:Gem::Requirement
|
43
58
|
requirements:
|
44
|
-
- - ~>
|
59
|
+
- - "~>"
|
45
60
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
47
|
-
|
61
|
+
version: '1.16'
|
62
|
+
type: :development
|
48
63
|
prerelease: false
|
49
|
-
type: :runtime
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- - ~>
|
66
|
+
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
68
|
+
version: '1.16'
|
55
69
|
- !ruby/object:Gem::Dependency
|
70
|
+
name: dotenv
|
56
71
|
requirement: !ruby/object:Gem::Requirement
|
57
72
|
requirements:
|
58
|
-
- - ~>
|
73
|
+
- - "~>"
|
59
74
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
61
|
-
|
75
|
+
version: '2.5'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.5'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '12.3'
|
90
|
+
type: :development
|
62
91
|
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '12.3'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: minitest
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '5.11'
|
63
104
|
type: :development
|
105
|
+
prerelease: false
|
64
106
|
version_requirements: !ruby/object:Gem::Requirement
|
65
107
|
requirements:
|
66
|
-
- - ~>
|
108
|
+
- - "~>"
|
67
109
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
110
|
+
version: '5.11'
|
69
111
|
- !ruby/object:Gem::Dependency
|
112
|
+
name: minitest-reporters
|
70
113
|
requirement: !ruby/object:Gem::Requirement
|
71
114
|
requirements:
|
72
|
-
- - ~>
|
115
|
+
- - "~>"
|
73
116
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
75
|
-
|
117
|
+
version: '1.3'
|
118
|
+
type: :development
|
76
119
|
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '1.3'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: minitest-spec-context
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 0.0.3
|
77
132
|
type: :development
|
133
|
+
prerelease: false
|
78
134
|
version_requirements: !ruby/object:Gem::Requirement
|
79
135
|
requirements:
|
80
|
-
- - ~>
|
136
|
+
- - "~>"
|
81
137
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
138
|
+
version: 0.0.3
|
83
139
|
description: Simulator for IT Services in Federated Clouds
|
84
140
|
email:
|
85
141
|
- mauro.tortonesi@unife.it
|
@@ -88,10 +144,13 @@ executables:
|
|
88
144
|
extensions: []
|
89
145
|
extra_rdoc_files: []
|
90
146
|
files:
|
147
|
+
- ".projections.json"
|
148
|
+
- ".travis.yml"
|
91
149
|
- Gemfile
|
92
150
|
- LICENSE
|
93
151
|
- README.md
|
94
152
|
- Rakefile
|
153
|
+
- TODO
|
95
154
|
- bin/sisfc
|
96
155
|
- examples/generator.R
|
97
156
|
- examples/simulator.conf
|
@@ -102,6 +161,8 @@ files:
|
|
102
161
|
- lib/sisfc/evaluation.rb
|
103
162
|
- lib/sisfc/event.rb
|
104
163
|
- lib/sisfc/generator.rb
|
164
|
+
- lib/sisfc/latency_manager.rb
|
165
|
+
- lib/sisfc/logger.rb
|
105
166
|
- lib/sisfc/request.rb
|
106
167
|
- lib/sisfc/service_type.rb
|
107
168
|
- lib/sisfc/simulation.rb
|
@@ -111,40 +172,45 @@ files:
|
|
111
172
|
- lib/sisfc/version.rb
|
112
173
|
- lib/sisfc/vm.rb
|
113
174
|
- sisfc.gemspec
|
114
|
-
-
|
115
|
-
-
|
116
|
-
-
|
117
|
-
-
|
118
|
-
-
|
119
|
-
-
|
175
|
+
- spec/minitest_helper.rb
|
176
|
+
- spec/sisfc/configuration_spec.rb
|
177
|
+
- spec/sisfc/data_center_spec.rb
|
178
|
+
- spec/sisfc/evaluation_spec.rb
|
179
|
+
- spec/sisfc/generator_spec.rb
|
180
|
+
- spec/sisfc/latency_manager_spec.rb
|
181
|
+
- spec/sisfc/reference_configuration.rb
|
182
|
+
- spec/sisfc/request_spec.rb
|
120
183
|
homepage: https://github.com/mtortonesi/sisfc
|
121
184
|
licenses:
|
122
185
|
- MIT
|
123
186
|
metadata: {}
|
124
|
-
post_install_message:
|
187
|
+
post_install_message:
|
125
188
|
rdoc_options: []
|
126
189
|
require_paths:
|
127
190
|
- lib
|
128
191
|
required_ruby_version: !ruby/object:Gem::Requirement
|
129
192
|
requirements:
|
130
|
-
- -
|
193
|
+
- - ">="
|
131
194
|
- !ruby/object:Gem::Version
|
132
195
|
version: '0'
|
133
196
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
197
|
requirements:
|
135
|
-
- -
|
198
|
+
- - ">="
|
136
199
|
- !ruby/object:Gem::Version
|
137
200
|
version: '0'
|
138
201
|
requirements: []
|
139
|
-
rubyforge_project:
|
140
|
-
rubygems_version: 2.
|
141
|
-
signing_key:
|
202
|
+
rubyforge_project:
|
203
|
+
rubygems_version: 2.7.6
|
204
|
+
signing_key:
|
142
205
|
specification_version: 4
|
143
|
-
summary: A simulator for business-driven IT management research capable of evaluating
|
206
|
+
summary: A simulator for business-driven IT management research capable of evaluating
|
207
|
+
IT service component placement in federated Cloud environments
|
144
208
|
test_files:
|
145
|
-
-
|
146
|
-
-
|
147
|
-
-
|
148
|
-
-
|
149
|
-
-
|
150
|
-
-
|
209
|
+
- spec/minitest_helper.rb
|
210
|
+
- spec/sisfc/configuration_spec.rb
|
211
|
+
- spec/sisfc/data_center_spec.rb
|
212
|
+
- spec/sisfc/evaluation_spec.rb
|
213
|
+
- spec/sisfc/generator_spec.rb
|
214
|
+
- spec/sisfc/latency_manager_spec.rb
|
215
|
+
- spec/sisfc/reference_configuration.rb
|
216
|
+
- spec/sisfc/request_spec.rb
|
@@ -1,191 +0,0 @@
|
|
1
|
-
require 'sisfc/configuration'
|
2
|
-
|
3
|
-
START_TIME = Time.utc(1978, 'Aug', 12, 14, 30, 0).to_f
|
4
|
-
DURATION = 1.minute.to_f
|
5
|
-
WARMUP_DURATION = 10.seconds.to_f
|
6
|
-
SIMULATION_CHARACTERIZATION = <<END
|
7
|
-
# start time, duration, and warmup time for simulations
|
8
|
-
start_time Time.utc(1978, 'Aug', 12, 14, 30, 0)
|
9
|
-
duration 1.minute
|
10
|
-
warmup_duration 10.seconds
|
11
|
-
END
|
12
|
-
|
13
|
-
|
14
|
-
# characterization of data centers
|
15
|
-
DATA_CENTERS_CHARACTERIZATION = <<END
|
16
|
-
data_centers \
|
17
|
-
1 => {
|
18
|
-
:maximum_vm_capacity => {
|
19
|
-
:tiny => 300,
|
20
|
-
:small => 300,
|
21
|
-
:medium => 300,
|
22
|
-
:large => 300,
|
23
|
-
:huge => 300,
|
24
|
-
},
|
25
|
-
},
|
26
|
-
2 => {
|
27
|
-
:maximum_vm_capacity => {
|
28
|
-
:tiny => 300,
|
29
|
-
:small => 300,
|
30
|
-
:medium => 300,
|
31
|
-
:large => 300,
|
32
|
-
:huge => 300,
|
33
|
-
},
|
34
|
-
},
|
35
|
-
3 => {
|
36
|
-
:maximum_vm_capacity => {
|
37
|
-
:tiny => 300,
|
38
|
-
:small => 300,
|
39
|
-
:medium => 300,
|
40
|
-
:large => 300,
|
41
|
-
:huge => 300,
|
42
|
-
},
|
43
|
-
},
|
44
|
-
4 => {
|
45
|
-
:maximum_vm_capacity => {
|
46
|
-
:tiny => 300,
|
47
|
-
:small => 300,
|
48
|
-
:medium => 300,
|
49
|
-
:large => 300,
|
50
|
-
:huge => 300,
|
51
|
-
},
|
52
|
-
},
|
53
|
-
5 => {
|
54
|
-
:maximum_vm_capacity => {
|
55
|
-
:tiny => 300,
|
56
|
-
:small => 300,
|
57
|
-
:medium => 300,
|
58
|
-
:large => 300,
|
59
|
-
:huge => 300,
|
60
|
-
},
|
61
|
-
}
|
62
|
-
END
|
63
|
-
|
64
|
-
|
65
|
-
# characterization of component types
|
66
|
-
SERVICE_COMPONENT_TYPES_CHARACTERIZATION = <<END
|
67
|
-
service_component_types \
|
68
|
-
'Web Server' => {
|
69
|
-
:allowed_vm_types => [ :medium, :large ],
|
70
|
-
:service_time_distribution => {
|
71
|
-
:medium => { :distribution => :gaussian,
|
72
|
-
:mu => 0.009, # 1 request processed every 9ms
|
73
|
-
:sigma => 0.001 },
|
74
|
-
:large => { :distribution => :gaussian,
|
75
|
-
:mu => 0.007, # 1 request processed every 7ms
|
76
|
-
:sigma => 0.001 } },
|
77
|
-
:estimated_workload => 50,
|
78
|
-
},
|
79
|
-
'App Server' => {
|
80
|
-
:allowed_vm_types => [ :medium, :large, :huge ],
|
81
|
-
:service_time_distribution => {
|
82
|
-
:medium => { :distribution => :gaussian,
|
83
|
-
:mu => 0.015, # 1 request processed every 15ms
|
84
|
-
:sigma => 0.005 },
|
85
|
-
:large => { :distribution => :gaussian,
|
86
|
-
:mu => 0.012, # 1 request processed every 12ms
|
87
|
-
:sigma => 0.003 },
|
88
|
-
:huge => { :distribution => :gaussian,
|
89
|
-
:mu => 0.009, # 1 request processed every 7ms
|
90
|
-
:sigma => 0.002 } },
|
91
|
-
:estimated_workload => 70,
|
92
|
-
},
|
93
|
-
'Financial Transaction Server' => {
|
94
|
-
:allowed_vm_types => [ :large, :huge ],
|
95
|
-
:service_time_distribution => {
|
96
|
-
:large => { :distribution => :gaussian,
|
97
|
-
:mu => 0.015, # 1 request processed every 15ms
|
98
|
-
:sigma => 0.004 },
|
99
|
-
:huge => { :distribution => :gaussian,
|
100
|
-
:mu => 0.008, # 1 request processed every 8ms
|
101
|
-
:sigma => 0.003 } },
|
102
|
-
:estimated_workload => 80,
|
103
|
-
}
|
104
|
-
END
|
105
|
-
|
106
|
-
|
107
|
-
# workflow (or job) types descriptions
|
108
|
-
WORKFLOW_TYPES_CHARACTERIZATION = <<END
|
109
|
-
workflow_types \
|
110
|
-
1 => {
|
111
|
-
:component_sequence => [
|
112
|
-
{ :name => 'Web Server' }, # no need for :type => dedicated / shared
|
113
|
-
{ :name => 'App Server' },
|
114
|
-
{ :name => 'Financial Transaction Server' },
|
115
|
-
],
|
116
|
-
:next_component_selection => :random,
|
117
|
-
},
|
118
|
-
2 => {
|
119
|
-
:component_sequence => [
|
120
|
-
{ :name => 'Web Server' }, # no need for :type => dedicated / shared
|
121
|
-
{ :name => 'App Server' },
|
122
|
-
],
|
123
|
-
# :next_component_selection => :least_loaded,
|
124
|
-
:next_component_selection => :random,
|
125
|
-
}
|
126
|
-
END
|
127
|
-
|
128
|
-
|
129
|
-
REQUEST_GENERATION_CHARACTERIZATION = <<END
|
130
|
-
request_generation \
|
131
|
-
command: "<pwd>/generator.R"
|
132
|
-
END
|
133
|
-
|
134
|
-
EVALUATION_CHARACTERIZATION = <<END
|
135
|
-
evaluation \
|
136
|
-
:vm_hourly_cost => [
|
137
|
-
{ :data_center => 1, :vm_type => :medium, :cost => 0.160 },
|
138
|
-
{ :data_center => 1, :vm_type => :large, :cost => 0.320 },
|
139
|
-
{ :data_center => 2, :vm_type => :medium, :cost => 0.184 },
|
140
|
-
{ :data_center => 2, :vm_type => :large, :cost => 0.368 }
|
141
|
-
],
|
142
|
-
# 500$ penalties if MTTR takes more than 50 msecs
|
143
|
-
:penalties => lambda {|kpis,dc_kpis| 500.0 if kpis[:mttr] > 0.050 }
|
144
|
-
END
|
145
|
-
|
146
|
-
# this is the whole reference configuration
|
147
|
-
# (useful for spec'ing configuration.rb)
|
148
|
-
REFERENCE_CONFIGURATION =
|
149
|
-
SIMULATION_CHARACTERIZATION +
|
150
|
-
DATA_CENTERS_CHARACTERIZATION +
|
151
|
-
SERVICE_COMPONENT_TYPES_CHARACTERIZATION +
|
152
|
-
WORKFLOW_TYPES_CHARACTERIZATION +
|
153
|
-
REQUEST_GENERATION_CHARACTERIZATION +
|
154
|
-
EVALUATION_CHARACTERIZATION
|
155
|
-
|
156
|
-
|
157
|
-
evaluator = Object.new
|
158
|
-
evaluator.extend SISFC::Configurable
|
159
|
-
evaluator.instance_eval(REFERENCE_CONFIGURATION)
|
160
|
-
|
161
|
-
# these are preprocessed portions of the reference configuration
|
162
|
-
# (useful for spec'ing everything else)
|
163
|
-
DATA_CENTERS = evaluator.data_centers
|
164
|
-
SERVICE_COMPONENT_TYPES = evaluator.service_component_types
|
165
|
-
WORKFLOW_TYPES = evaluator.workflow_types
|
166
|
-
EVALUATION = evaluator.evaluation
|
167
|
-
|
168
|
-
|
169
|
-
def with_reference_config(opts={})
|
170
|
-
begin
|
171
|
-
# create temporary file with reference configuration
|
172
|
-
tf = Tempfile.open('REFERENCE_CONFIGURATION')
|
173
|
-
tf.write(REFERENCE_CONFIGURATION)
|
174
|
-
tf.close
|
175
|
-
|
176
|
-
# create a configuration object from the reference configuration file
|
177
|
-
conf = SISFC::Configuration.load_from_file(tf.path)
|
178
|
-
|
179
|
-
# apply any change from the opts parameter and validate the modified configuration
|
180
|
-
opts.each do |k,v|
|
181
|
-
conf.send(k, v)
|
182
|
-
end
|
183
|
-
conf.validate
|
184
|
-
|
185
|
-
# pass the configuration object to the block
|
186
|
-
yield conf
|
187
|
-
ensure
|
188
|
-
# delete temporary file
|
189
|
-
tf.delete
|
190
|
-
end
|
191
|
-
end
|