perfsim#
Subpackages#
- perfsim.drivers
- Module contents
- Submodules
- perfsim.drivers.file_storage_driver module
FileStorageDriver
FileStorageDriver.base_dir
FileStorageDriver.save_all()
FileStorageDriver.save_simulation_scenario_results()
FileStorageDriver.save_cluster_topology_graph()
FileStorageDriver.save_service_chains_original_graph()
FileStorageDriver.save_service_chains_alternative_graph()
FileStorageDriver.save_service_chain_result_graph()
FileStorageDriver.save_timeline_graph()
FileStorageDriver.save_hosts_cores_heatmap()
- perfsim.drivers.neptune_storage_driver module
NeptuneStorageDriver
NeptuneStorageDriver.handler
NeptuneStorageDriver.init_neptune()
NeptuneStorageDriver.save_simulation_scenario_results()
NeptuneStorageDriver.save_cluster_topology_graph()
NeptuneStorageDriver.save_service_chains_original_graph()
NeptuneStorageDriver.save_service_chains_alternative_graph()
NeptuneStorageDriver.save_service_chain_result_graph()
NeptuneStorageDriver.save_timeline_graph()
NeptuneStorageDriver.save_hosts_cores_heatmap()
- perfsim.drivers.results_storage_driver module
ResultsStorageDriver
ResultsStorageDriver.results_with_graphs
ResultsStorageDriver.name
ResultsStorageDriver.save_service_chains_original_graph()
ResultsStorageDriver.save_service_chains_alternative_graph()
ResultsStorageDriver.save_cluster_topology_graph()
ResultsStorageDriver.save_service_chain_result_graph()
ResultsStorageDriver.save_timeline_graph()
ResultsStorageDriver.save_simulation_scenario_results()
ResultsStorageDriver.save_hosts_cores_heatmap()
ResultsStorageDriver.save_all()
ResultsStorageDriver.from_config()
- perfsim.environment
- Module contents
- Submodules
- perfsim.environment.perfsim_server module
PerfSimServer
PerfSimServer.perf_logs
PerfSimServer.app
PerfSimServer.server
PerfSimServer.sm
PerfSimServer.run()
PerfSimServer.create_scenario_manager()
PerfSimServer.run_scenario()
PerfSimServer.save_all()
PerfSimServer.configure_routes()
PerfSimServer.make_error_response()
PerfSimServer.make_function_response()
PerfSimServer.host
PerfSimServer.port
- perfsim.environment.settings module
- perfsim.equipments
- Module contents
- Submodules
- perfsim.equipments.core module
- perfsim.equipments.cost_dict module
- perfsim.equipments.cost_events_dict module
- perfsim.equipments.cpu module
CPU
CPU.sched_domain_hierarchy
CPU.cores
CPU.host
CPU.threads_sorted
CPU.pairs_sorted
CPU.idle_core_pair_ids
CPU.idle_pair_ids
CPU.idle_core_ids
CPU.pairs_load
CPU.reinit()
CPU.register_events()
CPU.get_available()
CPU.capacity
CPU.is_there_enough_resources_to_reserve()
CPU.reserve()
CPU.release()
CPU.get_idle_core_in_sd()
CPU.get_the_other_core_in_pair()
CPU.get_core_pairs()
CPU.get_sched_domains()
CPU.get_busiest_core_in_pair_by_core_id()
CPU.get_busiest_core_in_pair()
CPU.get_busiest_core_in_busiest_pair()
CPU.load_balance_threads_among_runqueues()
CPU.emergency_load_balance_idle_cores()
CPU.recalculate_cpu_requests_shares()
CPU.kill_zombie_threads()
CPU.plot()
CPU.load_balance()
CPU.add_to_pairs_sorted()
CPU.add_to_threads_sorted()
CPU.remove_from_pairs_sorted()
CPU.remove_from_threads_sorted()
CPU.update_idle_pairs()
CPU.clock_rate
CPU.clock_rate_in_nanohertz
- perfsim.equipments.equipment module
- perfsim.equipments.host module
- perfsim.equipments.nic module
Nic
Nic.name
Nic.equipment
Nic.bandwidth
Nic.transmissions
Nic.bandwidth_requests_total
Nic.reserve_transmission_for_request()
Nic.release_transmission_for_request()
Nic.reserve_transmission_in_nic()
Nic.release_transmission_in_nic()
Nic.calculate_transmission_time()
Nic.dismiss_bw()
Nic.request_bw()
Nic.get_available()
- perfsim.equipments.ram_set module
- perfsim.equipments.resource module
- perfsim.equipments.router module
- perfsim.equipments.run_queue module
RunQueue
RunQueue.rq
RunQueue.lightest_threads_in_rq
RunQueue.core
RunQueue.active_threads
RunQueue.best_effort_active_threads
RunQueue.guaranteed_active_threads
RunQueue.burstable_active_threads
RunQueue.burstable_unlimited_active_threads
RunQueue.burstable_limited_active_threads
RunQueue.thread_set_dict
RunQueue.reinit()
RunQueue.requeue_task()
RunQueue.recalculate_cpu_requests_shares()
RunQueue.run_idle()
RunQueue.assign_cpu_requests_share()
RunQueue.categorize_thread_into_sets()
RunQueue.decategorize_thread_from_sets()
RunQueue.enqueue_task()
RunQueue.enqueue_tasks()
RunQueue.remove_from_lightest_threads_in_rq()
RunQueue.add_to_lightest_threads_in_rq()
RunQueue.dequeue_task_by_thread()
RunQueue.dequeue_task_by_thread_index()
RunQueue.load
- perfsim.equipments.storage module
- perfsim.equipments.topology module
- perfsim.equipments.topology_link module
- perfsim.exceptions
- perfsim.helpers
- Module contents
- Submodules
- perfsim.helpers.cost_calculator module
CostCalculator
CostCalculator.ALWAYS_ALLOC_CPU_PRICE_PER_VCPU_SEC
CostCalculator.ALWAYS_ALLOC_CPU_FREE_TIER_VPU_SEC_PER_MONTH
CostCalculator.ALWAYS_ALLOC_MEM_PRICE_PER_GB_SEC
CostCalculator.ALWAYS_ALLOC_MEM_FREE_TIER_GB_SEC_PER_MONTH
CostCalculator.ONLY_ALLOC_DURING_REQ_CPU_PRICE_PER_VCPU_SEC
CostCalculator.ONLY_ALLOC_DURING_REQ_CPU_PRICE_PER_VCPU_SEC_IDLE
CostCalculator.ONLY_ALLOC_DURING_REQ_FREE_TIER_VPU_SEC_PER_MONTH
CostCalculator.ONLY_ALLOC_DURING_REQ_MEM_PRICE_PER_GB_SEC
CostCalculator.ONLY_ALLOC_DURING_REQ_MEM_PRICE_PER_GB_SEC_IDLE
CostCalculator.ONLY_ALLOC_DURING_REQ_MEM_FREE_TIER_GB_SEC_PER_MONTH
CostCalculator.ONLY_ALLOC_DURING_REQ_PRICE
CostCalculator.ONLY_ALLOC_DURING_REQ_REQ_FREE_TIER_COUNT
CostCalculator.concurrent_requests_per_container
CostCalculator.requests
CostCalculator.request_execution_time
CostCalculator.cost_for_always_allocated_instance()
CostCalculator.cost_for_only_allocated_during_request_instance()
- perfsim.helpers.debug_dict module
- perfsim.helpers.logger module
Logger
Logger.lb_timer
Logger.tick_timer
Logger.core_sorting_timer
Logger.sim
Logger.print_traffic_details()
Logger.print_hosts_info()
Logger.print_microservices_info()
Logger.print_cluster_info()
Logger.print_subchains()
Logger.print_all()
Logger.log()
Logger.print_latencies()
Logger.get_latencies_summary()
- perfsim.helpers.plotter module
- perfsim.helpers.utils module
- perfsim.observers
- Module contents
- Submodules
- perfsim.observers.cluster_log_observer module
ClusterLogObserver
ClusterLogObserver.after_finish_running_threads_on_a_host
ClusterLogObserver.after_finish_running_a_thread
ClusterLogObserver.before_transmitting_requests_in_network
ClusterLogObserver.in_transmitting_an_active_transmission
ClusterLogObserver.after_transmitting_an_active_transmission
ClusterLogObserver.before_load_balancing_a_host
ClusterLogObserver.before_calling_is_there_a_thread_that_ends_sooner_function
ClusterLogObserver.before_checking_a_thread_ends_sooner
ClusterLogObserver.after_calling_is_there_a_thread_that_ends_sooner_function
- perfsim.observers.core_log_observer module
- perfsim.observers.cpu_log_observer module
- perfsim.observers.event module
- perfsim.observers.event_observer module
- perfsim.observers.load_generator_log_observer module
LoadGeneratorLogObserver
LoadGeneratorLogObserver.before_traffic_start
LoadGeneratorLogObserver.before_requests_start
LoadGeneratorLogObserver.before_generate_threads
LoadGeneratorLogObserver.before_exec_time_estimation
LoadGeneratorLogObserver.before_executing_threads
LoadGeneratorLogObserver.after_completing_load_generation
LoadGeneratorLogObserver.after_next_batch_arrival_time_calculation
LoadGeneratorLogObserver.before_generate_request_threads
LoadGeneratorLogObserver.after_generate_request_threads
LoadGeneratorLogObserver.after_estimating_time_of_next_event
LoadGeneratorLogObserver.before_transmit_requests_in_network
LoadGeneratorLogObserver.after_transmit_requests_in_network_and_load_balancing_threads
LoadGeneratorLogObserver.before_request_created
LoadGeneratorLogObserver.after_requests_start
- perfsim.observers.log_observer module
- perfsim.observers.observable module
- perfsim.observers.replica_thread_log_observer module
- perfsim.observers.replica_thread_timeline_observer module
- perfsim.observers.request_log_observer module
RequestLogObserver
RequestLogObserver.before_init_next_microservices
RequestLogObserver.print_current_and_next_nodes_and_replicas()
RequestLogObserver.after_init_next_microservices
RequestLogObserver.before_finalizing_subchain
RequestLogObserver.before_concluding_request
RequestLogObserver.before_init_transmission
RequestLogObserver.on_init_transmission
RequestLogObserver.after_init_transmission
RequestLogObserver.before_finish_transmission
RequestLogObserver.after_finish_transmission
- perfsim.observers.results_observer module
- perfsim.observers.topology_log_ovserver module
- perfsim.observers.transmission_log_observer module
- perfsim.placement
- perfsim.prototypes
- Module contents
- Submodules
- perfsim.prototypes.affinity_prototype module
- perfsim.prototypes.base_prototype module
- perfsim.prototypes.cluster_prototype module
ClusterPrototype
ClusterPrototype.placement_scenario
ClusterPrototype.traffic_prototypes_dict
ClusterPrototype.scms_dict
ClusterPrototype.scenario_name
ClusterPrototype.service_chains_dict
ClusterPrototype.topology
ClusterPrototype.resource_allocation_scenarios_dict
ClusterPrototype.affinity_prototypes_dict
ClusterPrototype.simulation_scenario
- perfsim.prototypes.host_prototype module
- perfsim.prototypes.microservice_endpoint_function_prototype module
- perfsim.prototypes.microservice_endpoint_function_prototype_dtype module
- perfsim.prototypes.microservice_prototype module
- perfsim.prototypes.router_prototype module
- perfsim.prototypes.service_chain_link_prototype module
- perfsim.prototypes.topology_link_prototype module
- perfsim.prototypes.topology_prototype module
TopologyPrototype
TopologyPrototype.before_recalculate_transmissions_bw_on_all_links
TopologyPrototype.egress_err
TopologyPrototype.ingress_err
TopologyPrototype.hosts_dict
TopologyPrototype.routers_dict
TopologyPrototype.topology_links_dict
TopologyPrototype.active_transmissions
TopologyPrototype.add_equipments()
TopologyPrototype.add_edges_from()
TopologyPrototype.add_edge()
TopologyPrototype.reinitiate_topology()
TopologyPrototype.draw()
TopologyPrototype.recalculate_transmissions_times()
TopologyPrototype.copy_to_dict()
TopologyPrototype.from_config()
- perfsim.prototypes.traffic_prototype module
TrafficPrototype
TrafficPrototype.arrival_table
TrafficPrototype.start_at
TrafficPrototype.arrival_interval_ns
TrafficPrototype.duration
TrafficPrototype.parallel_user
TrafficPrototype.iterations_count
TrafficPrototype.requests_count
TrafficPrototype.recalc_iterations_count()
TrafficPrototype.recalc_requests_count()
TrafficPrototype.recalc_arrival_table()
TrafficPrototype.recalc_all_properties()
TrafficPrototype.copy_to_dict()
TrafficPrototype.from_config()
- perfsim.scenario
- Module contents
- Submodules
- perfsim.scenario.affinity_scenario module
- perfsim.scenario.placement_scenario module
- perfsim.scenario.resource_allocation_scenario module
- perfsim.scenario.results_storage_driver_dict module
- perfsim.scenario.scaling_scenario module
- perfsim.scenario.simulation_scenario module
- perfsim.scenario.simulation_scenario_manager module
TopologyEquipmentSet
SimulationScenarioManager
SimulationScenarioManager.microservice_prototypes_dict
SimulationScenarioManager.host_prototypes_dict
SimulationScenarioManager.router_prototypes_dict
SimulationScenarioManager.link_prototypes_dict
SimulationScenarioManager.topology_equipments_dict
SimulationScenarioManager.placement_scenarios_dict
SimulationScenarioManager.from_config_file()
SimulationScenarioManager.get_obj()
SimulationScenarioManager.from_config()
SimulationScenarioManager.res_alloc_scenarios_dict
SimulationScenarioManager.affinity_prototypes_dict
SimulationScenarioManager.service_chains_dict
SimulationScenarioManager.microservices_dict
SimulationScenarioManager.topologies_prototype_dict
SimulationScenarioManager.placement_algorithms_dict
SimulationScenarioManager.traffic_prototypes_dict
SimulationScenarioManager.simulation_scenarios_dict
SimulationScenarioManager.results_storage_driver
SimulationScenarioManager.simulations_dict
SimulationScenarioManager.validate_simulation_scenarios()
SimulationScenarioManager.validate_traffic_prototype()
SimulationScenarioManager.validate_service_chain()
SimulationScenarioManager.validate_scaling_scenarios()
SimulationScenarioManager.validate_affinity_scenarios()
SimulationScenarioManager.validate_placement_algorithms()
SimulationScenarioManager.validate_topology()
SimulationScenarioManager.get_all_latencies()
SimulationScenarioManager.save_all()
- perfsim.scenario.simulation_scenario_manager_result_dict module
- perfsim.scenario.simulation_scenario_result_dict module
- perfsim.scenario.traffic_scenario module
- perfsim.service_chain
- Module contents
- Submodules
- perfsim.service_chain.load_balancer module
- perfsim.service_chain.microservice module
Microservice
Microservice.name
Microservice.endpoint_functions
Microservice.memory_requests
Microservice.ingress_bw
Microservice.egress_bw
Microservice.ingress_latency
Microservice.egress_latency
Microservice.blkio_capacity
Microservice.resource_allocation_scenario
Microservice.load_balancer
Microservice.from_prototype()
Microservice.is_best_effort()
Microservice.is_guaranteed()
Microservice.is_burstable()
Microservice.is_unlimited_burstable()
Microservice.is_limited_burstable()
Microservice.next_replica()
Microservice.add_microservice_affinity_with()
Microservice.add_host_affinity_with()
Microservice.delete_microservice_affinity_with()
Microservice.delete_host_affinity_with()
Microservice.add_microservice_anti_affinity_with()
Microservice.add_host_anti_affinity_with()
Microservice.delete_microservice_anti_affinity_with()
Microservice.delete_host_anti_affinity_with()
Microservice.ms_affinity_rules
Microservice.ms_antiaffinity_rules
Microservice.host_affinity_rules
Microservice.host_antiaffinity_rules
Microservice.replicas
Microservice.hosts
Microservice.replica_count
Microservice.cpu_requests
Microservice.cpu_limits
- perfsim.service_chain.microservice_endpoint_function module
- perfsim.service_chain.microservice_endpoint_function_dtype module
- perfsim.service_chain.microservice_replica module
MicroserviceReplica
MicroserviceReplica.reinit()
MicroserviceReplica.host
MicroserviceReplica.microservice
MicroserviceReplica.remove_host_without_eviction()
MicroserviceReplica.reserve_egress_bw()
MicroserviceReplica.release_egress_bw()
MicroserviceReplica.reserve_ingress_bw()
MicroserviceReplica.release_ingress_bw()
MicroserviceReplica.generate_threads()
- perfsim.service_chain.process module
- perfsim.service_chain.replica_thread module
ReplicaThread
ReplicaThread.before_killing_thread
ReplicaThread.before_executing_thread
ReplicaThread.after_executing_thread
ReplicaThread.replica
ReplicaThread.replica_identifier_in_subchain
ReplicaThread.node_in_alt_graph
ReplicaThread.thread_id_in_node
ReplicaThread.set_node_in_alt_graph()
ReplicaThread.register_events()
ReplicaThread.kill()
ReplicaThread.is_runnable()
ReplicaThread.exec()
ReplicaThread.get_best_effort_cpu_requests_share()
ReplicaThread.get_relative_guaranteed_cpu_requests_share()
ReplicaThread.get_exec_time_on_rq()
ReplicaThread.instructions
ReplicaThread.process
ReplicaThread.on_rq
ReplicaThread.core
ReplicaThread.vruntime
ReplicaThread.load
ReplicaThread.cpu_requests_share
ReplicaThread.cpu_limits
- perfsim.service_chain.service_chain module
- perfsim.service_chain.service_chain_link module
- perfsim.service_chain.service_chain_manager module
ServiceChainManager
ServiceChainManager.alternative_graph
ServiceChainManager.name
ServiceChainManager.subchains
ServiceChainManager.node_subchain_id_map
ServiceChainManager.root
ServiceChainManager.generate_alternative_graph()
ServiceChainManager.extract_subchains()
ServiceChainManager.draw_service_chain()
ServiceChainManager.draw_alternative_graph()
ServiceChainManager.get_copy()
- perfsim.service_chain.service_chain_result_dict module
ServiceChainResultDict
ServiceChainResultDict.simulation_name
ServiceChainResultDict.estimated_cost
ServiceChainResultDict.total_requests
ServiceChainResultDict.successful_requests
ServiceChainResultDict.timeout_requests
ServiceChainResultDict.avg_latency
ServiceChainResultDict.throughput
ServiceChainResultDict.arrival_times
ServiceChainResultDict.latencies
ServiceChainResultDict.completion_times
ServiceChainResultDict.traffic_types
- perfsim.service_chain.service_chain_result_iteration_dict module
- perfsim.service_chain.thread_set module
- perfsim.traffic
- Module contents
- Submodules
- perfsim.traffic.load_generator module
LoadGenerator
LoadGenerator.threads_dict
LoadGenerator.arrivals
LoadGenerator.before_traffic_start
LoadGenerator.before_generate_threads
LoadGenerator.before_requests_start
LoadGenerator.after_requests_start
LoadGenerator.before_exec_time_estimation
LoadGenerator.before_executing_threads
LoadGenerator.after_completing_load_generation
LoadGenerator.after_next_batch_arrival_time_calculation
LoadGenerator.before_generate_request_threads
LoadGenerator.after_generate_request_threads
LoadGenerator.after_transmission_estimation
LoadGenerator.after_estimating_time_of_next_event
LoadGenerator.before_transmit_requests_in_network
LoadGenerator.after_transmit_requests_in_network_and_load_balancing_threads
LoadGenerator.before_request_created
LoadGenerator.name
LoadGenerator.sim
LoadGenerator.requests
LoadGenerator.threads
LoadGenerator.latencies
LoadGenerator.total_requests_count
LoadGenerator.merged_arrival_table
LoadGenerator.register_events()
LoadGenerator.execute_traffic()
LoadGenerator.completed_requests
LoadGenerator.get_latencies_grouped_by_sfc()
LoadGenerator.plot_latencies()
LoadGenerator.last_transmission_id
LoadGenerator.next_trans_completion_times
LoadGenerator.requests_ready_for_thread_generation
LoadGenerator.next_batch_arrival_time
LoadGenerator.merge_arrival_tables()
- perfsim.traffic.request module
Request
Request.before_init_next_microservices
Request.after_init_next_microservices
Request.before_finalizing_subchain
Request.before_concluding_request
Request.before_init_transmission
Request.after_init_transmission
Request.on_init_transmission
Request.before_finish_transmission
Request.after_finish_transmission
Request.load_generator
Request.traffic_prototype
Request.scm
Request.latency
Request.id
Request.iteration_id
Request.id_in_iteration
Request.status
Request.register_events()
Request.finalize_subchain()
Request.set_next_nodes_and_replicas()
Request.init_transmission()
Request.finish_transmission_by_subchain_id()
Request.finish_transmission()
Request.init_next_microservices()
Request.get_node_names()
Request.get_next_nodes_names()
Request.get_current_replicas_names()
Request.get_next_replicas_names()
Request.get_current_replicas_host_names()
Request.get_next_replicas_host_names()
Request.conclude()
Request.compute_times
Request.trans_times
Request.trans_exact_times
Request.trans_init_times
Request.current_nodes
Request.current_replicas_in_nodes
Request.subchains_status
Request.next_replicas_in_nodes
Request.next_nodes
Request.trans_deltatimes
- perfsim.traffic.transmission module
Transmission
Transmission.register_events()
Transmission.get_link_data()
Transmission.recalc_bw_considering_err()
Transmission.calculate_requested_bw()
Transmission.transmit()
Transmission.links
Transmission.calculate_transmission_time()
Transmission.finish()
Transmission.get_bandwidth_on_link()
Transmission.source_nic
Transmission.dest_nic
Transmission.current_bw
Transmission.set_current_bw()
Module contents#
PerfSim package is a discrete event simulator that simulates the behaviour of microservices in a Kubernetes cluster.
Submodules#
perfsim.cluster module#
- class perfsim.cluster.Cluster(name, simulation, topology, service_chains_dict=None, scm_dict=None, network_timeout=inf)[source]#
Bases:
Observable
A Cluster is imitating a real heterogeneous cluster with a configurable NetworkTopology, PlacementScenario and a set of ServiceChainManager instances.
- Param:
name: Name of the cluster
- Param:
service_chain_managers: A dict of all service chains running on the cluster
- Param:
placement_algorithm: The hosts and routers’ placement scenario on the cluster
- Param:
topology: The network topology of the cluster
- Param:
network_timeout: The network timeout
- Parameters:
name (
str
)simulation (
Simulation
)topology (
Topology
)service_chains_dict (
Dict
[str
,ServiceChain
])scm_dict (
Dict
[str
,ServiceChainManager
])network_timeout (
float
)
- name: str#
Name of the cluster
- sim: Simulation#
The parent Simulation instance
- topology: Topology#
The network topology of the cluster
- network_timeout: float#
The timeout threshold for network transmissions
- cluster_scheduler: ClusterScheduler#
The ClusterScheduler of this cluster responsible for scheduling replicas on the given topology
- count_total_service_edges()[source]#
Counts the total number of edges in the service topology that is being deployed in this cluster.
- Returns:
The total number of edges in the service topology
- set_service_chains_dict(service_chains_dict)[source]#
Set the service chains of the cluster
- Parameters:
service_chains_dict (
Dict
[str
,ServiceChain
]) – The service chains to set- Returns:
None
- set_scm_dict(scm_dict)[source]#
Set the service chain managers of the cluster. This method is used to set the service chain managers of the cluster when the cluster is created from a dictionary of service chain managers.
- Parameters:
scm_dict (
Dict
[str
,ServiceChainManager
])- Returns:
- property scm_dict: Dict[str, ServiceChainManager]#
List of all ServiceChainManager references running on this cluster
- Returns:
The list of all ServiceChainManager references running on this cluster
- is_there_a_thread_that_ends_sooner(time_of_next_event)[source]#
Check all active threads to see if there is one that ends sooner that
time_of_next_event
- Parameters:
time_of_next_event (
int
)- Return type:
Tuple
[float
,float
,bool
]
- run_threads_on_hosts(duration)[source]#
Run all threads on all active hosts for
duration
nanoseconds- Parameters:
duration (
float
) – Duration of threads execution in nanoseconds- Return type:
int
- run_active_threads(duration)[source]#
Transmit all requests in network for
duration
nanoseconds- Parameters:
duration (
Union
[int
,float
]) – Duration of threads execution in nanoseconds- Return type:
int
- transmit_requests_in_network(duration)[source]#
Transmit all requests in network for duration nanoseconds
- Param:
duration: Duration of network transmissions in nanoseconds
- Returns:
None
- Parameters:
duration (
Union
[int
,float
])
- run_idle(until)[source]#
Running threads idle for
until
-core.runqueue.time
nanoseconds- Parameters:
until (
int
) – The time when running idle stops.- Return type:
None
- property microservices_dict#
List of all Microservice references running on this cluster
- Returns:
The list of all Microservice references running on this cluster
- draw_all_service_chains(save_dir=None, show=True)[source]#
Draw all service chains of the cluster
- Parameters:
save_dir (
str
)show (
bool
)
- Returns:
- calculate_average_latency_in_seconds()[source]#
Calculate the average latency in seconds
- Returns:
The average latency in seconds
perfsim.cluster_scheduler module#
- class perfsim.cluster_scheduler.ClusterScheduler(cluster)[source]#
Bases:
object
This class is responsible for scheduling the cluster.
- Parameters:
cluster (
Cluster
)
-
replicas:
Set
[MicroserviceReplica
]#
-
active_hosts:
Set
[Host
]# The set of active hosts in the cluster that are actually having a thread running on them.
-
hosts_need_load_balancing:
Set
[Host
]# The set of hosts in the cluster that require CPU load balancing.
-
zombie_threads:
Set
[ReplicaThread
]# The set of zombie threads in the cluster that needs to be killed
-
active_threads:
Set
[ReplicaThread
]# The set of active threads in the cluster that are actually running on a host.
- property placement_matrix: DataFrame#
Get the placement matrix.
- Returns:
perfsim.simulation module#
- class perfsim.simulation.Simulation(name, simulation_scenario, service_chains_dict, topology_prototype, placement_algorithm, resource_allocation_scenarios_dict, affinity_prototypes_dict, traffic_prototypes_dict, storage_driver, validate=False, copy=True)[source]#
Bases:
object
This class represents a simulation. It contains all the necessary information to run a simulation.
- Parameters:
name (
str
)simulation_scenario (
SimulationScenario
)service_chains_dict (
Dict
[str
,ServiceChain
])topology_prototype (
TopologyPrototype
)placement_algorithm (
PlacementAlgorithm
)resource_allocation_scenarios_dict (
Dict
[str
,ResourceAllocationScenario
])affinity_prototypes_dict (
Dict
[str
,AffinityPrototype
])traffic_prototypes_dict (
Dict
[str
,TrafficPrototype
])storage_driver (
ResultsStorageDriver
)validate (
bool
)copy (
bool
)
- DEFAULT_DEBUG_LEVEL = 0#
- DEFAULT_DEBUG_FILE_LOCATION = False#
- DEFAULT_LOG_CPU_EVENTS = False#
- DEFAULT_LOG_TIMELINE = False#
-
name:
str
# The name of the simulation
-
scenario:
SimulationScenario
# scenario is the simulation scenario
-
service_chains_dict:
Dict
[str
,ServiceChain
]# service_chains_dict is a dictionary of service chains
-
microservices_dict:
Dict
[str
,Microservice
]# microservices_dict is a dictionary of microservices
-
resource_allocation_scenarios_dict:
Dict
[str
,ResourceAllocationScenario
]# resource_allocation_scenarios_dict is a dictionary of resource allocation scenarios
-
affinity_prototypes_dict:
Dict
[str
,AffinityPrototype
]# placement_algorithm is the algorithm used to place the microservices
-
traffic_prototypes_dict:
Dict
[str
,TrafficPrototype
]# traffic_prototypes_dict is a dictionary of traffic prototypes
-
storage_driver:
ResultsStorageDriver
# storage_driver is the storage driver of the simulation
-
load_generator:
LoadGenerator
# load_generator is the load generator of the simulation
- static set_object(obj, copy)[source]#
Set an object with or without copy
- Parameters:
obj (
Any
)copy (
bool
)
- Returns:
- validate_simulation_scenario(sim_scenario)[source]#
Validate the simulation scenario to make sure all the microservices are in the simulation scenario It raises an exception if a microservice is not found in the simulation scenario
- Parameters:
sim_scenario (
dict
) – The simulation scenario- Returns:
None
- static copy_sim_scenarios_to_dict(sim_scenarios)[source]#
Copy simulation scenarios to a dictionary
- Parameters:
sim_scenarios (
Union
[List
[SimulationScenario
],Dict
[str
,SimulationScenario
]])- Return type:
Dict
[str
,SimulationScenario
]- Returns:
- set_debug_properties(level=None, file_path=None, log_cpu_events=None, log_timeline=None)[source]#
Set debug properties
- Parameters:
level (
Union
[bool
,int
])file_path (
str
)log_cpu_events (
bool
)log_timeline (
bool
)
- Returns:
- property log_timeline#
Log timeline
- Returns:
- property debug#
Status of debug mode (automatically configured based on _debug_level)
- Returns:
- property debug_level#
Level of debug verbosity (1-5)
- Returns:
Return debug level
- property debug_file_location#
Return log file location :return: Log file path - None if empty (then log will print out in console) :rtype: str
- property log_cpu_events#
Status of logging CPU events (used for drawing task load balancing heatmaps) :return: bool
- property time: int#
Simulation time :return: Simulation time :rtype: float
- static from_scenarios_manager(sm)[source]#
Create simulations from scenarios manager
- Parameters:
- Return type:
dict
[str
,Simulation
]- Returns: