perfsim.placement#
Module contents#
Submodules#
perfsim.placement.first_fit module#
- class perfsim.placement.first_fit.FirstFit(name, options)[source]#
Bases:
PlacementAlgorithm
- Parameters:
name (
str
)options (
Dict
[str
,Any
])
- place(placement_matrix, replicas, hosts_dict)[source]#
Place the nodes in the simulation.
- Returns:
None
- Parameters:
placement_matrix (
DataFrame
)replicas (
Set
[MicroserviceReplica
])hosts_dict (
Dict
[str
,Host
])
- static first_fit(placement_matrix, replicas, hosts_dict=None)[source]#
- Parameters:
placement_matrix (
DataFrame
)replicas (
Set
[MicroserviceReplica
])hosts_dict (
Dict
[str
,Host
])
- Return type:
None
perfsim.placement.first_fit_decreasing module#
- class perfsim.placement.first_fit_decreasing.FirstFitDecreasing(name, options)[source]#
Bases:
FirstFit
- Parameters:
name (
str
)options (
Dict
[str
,Any
])
- place(placement_matrix, replicas, hosts_dict)[source]#
Place the nodes in the simulation.
- Returns:
None
- Parameters:
placement_matrix (
DataFrame
)replicas (
Set
[MicroserviceReplica
])hosts_dict (
Dict
[str
,Host
])
- first_fit_decreasing(placement_matrix, replicas, hosts_dict=None)[source]#
- Parameters:
placement_matrix (
DataFrame
)replicas (
Set
[MicroserviceReplica
])hosts_dict (
Dict
[str
,Host
])
- Return type:
None
perfsim.placement.least_fit module#
- class perfsim.placement.least_fit.LeastFitOptions[source]#
Bases:
TypedDict
-
w_cpu:
float
#
-
w_mem:
float
#
-
w_ingress:
float
#
-
w_egress:
float
#
-
w_blkio:
float
#
-
w_cpu:
- class perfsim.placement.least_fit.LeastFit(name, options)[source]#
Bases:
PlacementAlgorithm
- Parameters:
name (
str
)options (
LeastFitOptions
)
- place(placement_matrix, replicas, hosts_dict)[source]#
Place the nodes in the simulation.
- Returns:
None
- Parameters:
placement_matrix (
DataFrame
)replicas (
Set
[MicroserviceReplica
])hosts_dict (
Dict
[str
,Host
])
- static least_fit_score(available, capacity, requested, weight)[source]#
- Parameters:
available (
float
)capacity (
float
)requested (
float
)weight (
float
)
- reschedule(placement_matrix, replicas, hosts_dict)[source]#
- Parameters:
placement_matrix (
DataFrame
)replicas (
Set
[MicroserviceReplica
])hosts_dict (
Dict
[str
,Host
])
- Return type:
None
perfsim.placement.placement_algorithm module#
- class perfsim.placement.placement_algorithm.PlacementAlgorithm(name, options)[source]#
Bases:
ABC
- Parameters:
name (
str
)options (
Dict
[str
,Any
])
-
name:
str
# Name of the placement algorithm instance (including options)
-
options:
Dict
[str
,Any
]# Options for the placement algorithm
- abstract place(placement_matrix, replicas, hosts_dict)[source]#
Place the nodes in the simulation.
- Returns:
None
- Parameters:
placement_matrix (
DataFrame
)replicas (
Set
[MicroserviceReplica
])hosts_dict (
Dict
[str
,Host
])
- property algorithm_name#
- static copy_to_dict(placement_algorithms)[source]#
- Parameters:
placement_algorithms (
Union
[List
[PlacementAlgorithm
],Dict
[str
,PlacementAlgorithm
]])- Return type:
Dict
[str
,PlacementAlgorithm
]
- static from_config(conf)[source]#
- Parameters:
conf (
dict
)- Return type:
dict
[str
,PlacementAlgorithm
]