perfsim#
Subpackages#
- perfsim.drivers
- Module contents
- Submodules
- perfsim.drivers.file_storage_driver module
FileStorageDriverFileStorageDriver.base_dirFileStorageDriver.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
NeptuneStorageDriverNeptuneStorageDriver.handlerNeptuneStorageDriver.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
ResultsStorageDriverResultsStorageDriver.results_with_graphsResultsStorageDriver.nameResultsStorageDriver.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
PerfSimServerPerfSimServer.perf_logsPerfSimServer.appPerfSimServer.serverPerfSimServer.smPerfSimServer.run()PerfSimServer.create_scenario_manager()PerfSimServer.run_scenario()PerfSimServer.save_all()PerfSimServer.configure_routes()PerfSimServer.make_error_response()PerfSimServer.make_function_response()PerfSimServer.hostPerfSimServer.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
CPUCPU.sched_domain_hierarchyCPU.coresCPU.hostCPU.threads_sortedCPU.pairs_sortedCPU.idle_core_pair_idsCPU.idle_pair_idsCPU.idle_core_idsCPU.pairs_loadCPU.reinit()CPU.register_events()CPU.get_available()CPU.capacityCPU.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_rateCPU.clock_rate_in_nanohertz
- perfsim.equipments.equipment module
- perfsim.equipments.host module
- perfsim.equipments.nic module
NicNic.nameNic.equipmentNic.bandwidthNic.transmissionsNic.bandwidth_requests_totalNic.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
RunQueueRunQueue.rqRunQueue.lightest_threads_in_rqRunQueue.coreRunQueue.active_threadsRunQueue.best_effort_active_threadsRunQueue.guaranteed_active_threadsRunQueue.burstable_active_threadsRunQueue.burstable_unlimited_active_threadsRunQueue.burstable_limited_active_threadsRunQueue.thread_set_dictRunQueue.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
CostCalculatorCostCalculator.ALWAYS_ALLOC_CPU_PRICE_PER_VCPU_SECCostCalculator.ALWAYS_ALLOC_CPU_FREE_TIER_VPU_SEC_PER_MONTHCostCalculator.ALWAYS_ALLOC_MEM_PRICE_PER_GB_SECCostCalculator.ALWAYS_ALLOC_MEM_FREE_TIER_GB_SEC_PER_MONTHCostCalculator.ONLY_ALLOC_DURING_REQ_CPU_PRICE_PER_VCPU_SECCostCalculator.ONLY_ALLOC_DURING_REQ_CPU_PRICE_PER_VCPU_SEC_IDLECostCalculator.ONLY_ALLOC_DURING_REQ_FREE_TIER_VPU_SEC_PER_MONTHCostCalculator.ONLY_ALLOC_DURING_REQ_MEM_PRICE_PER_GB_SECCostCalculator.ONLY_ALLOC_DURING_REQ_MEM_PRICE_PER_GB_SEC_IDLECostCalculator.ONLY_ALLOC_DURING_REQ_MEM_FREE_TIER_GB_SEC_PER_MONTHCostCalculator.ONLY_ALLOC_DURING_REQ_PRICECostCalculator.ONLY_ALLOC_DURING_REQ_REQ_FREE_TIER_COUNTCostCalculator.concurrent_requests_per_containerCostCalculator.requestsCostCalculator.request_execution_timeCostCalculator.cost_for_always_allocated_instance()CostCalculator.cost_for_only_allocated_during_request_instance()
- perfsim.helpers.debug_dict module
- perfsim.helpers.logger module
LoggerLogger.lb_timerLogger.tick_timerLogger.core_sorting_timerLogger.simLogger.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
ClusterLogObserverClusterLogObserver.after_finish_running_threads_on_a_hostClusterLogObserver.after_finish_running_a_threadClusterLogObserver.before_transmitting_requests_in_networkClusterLogObserver.in_transmitting_an_active_transmissionClusterLogObserver.after_transmitting_an_active_transmissionClusterLogObserver.before_load_balancing_a_hostClusterLogObserver.before_calling_is_there_a_thread_that_ends_sooner_functionClusterLogObserver.before_checking_a_thread_ends_soonerClusterLogObserver.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
LoadGeneratorLogObserverLoadGeneratorLogObserver.before_traffic_startLoadGeneratorLogObserver.before_requests_startLoadGeneratorLogObserver.before_generate_threadsLoadGeneratorLogObserver.before_exec_time_estimationLoadGeneratorLogObserver.before_executing_threadsLoadGeneratorLogObserver.after_completing_load_generationLoadGeneratorLogObserver.after_next_batch_arrival_time_calculationLoadGeneratorLogObserver.before_generate_request_threadsLoadGeneratorLogObserver.after_generate_request_threadsLoadGeneratorLogObserver.after_estimating_time_of_next_eventLoadGeneratorLogObserver.before_transmit_requests_in_networkLoadGeneratorLogObserver.after_transmit_requests_in_network_and_load_balancing_threadsLoadGeneratorLogObserver.before_request_createdLoadGeneratorLogObserver.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
RequestLogObserverRequestLogObserver.before_init_next_microservicesRequestLogObserver.print_current_and_next_nodes_and_replicas()RequestLogObserver.after_init_next_microservicesRequestLogObserver.before_finalizing_subchainRequestLogObserver.before_concluding_requestRequestLogObserver.before_init_transmissionRequestLogObserver.on_init_transmissionRequestLogObserver.after_init_transmissionRequestLogObserver.before_finish_transmissionRequestLogObserver.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
ClusterPrototypeClusterPrototype.placement_scenarioClusterPrototype.traffic_prototypes_dictClusterPrototype.scms_dictClusterPrototype.scenario_nameClusterPrototype.service_chains_dictClusterPrototype.topologyClusterPrototype.resource_allocation_scenarios_dictClusterPrototype.affinity_prototypes_dictClusterPrototype.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
TopologyPrototypeTopologyPrototype.before_recalculate_transmissions_bw_on_all_linksTopologyPrototype.egress_errTopologyPrototype.ingress_errTopologyPrototype.hosts_dictTopologyPrototype.routers_dictTopologyPrototype.topology_links_dictTopologyPrototype.active_transmissionsTopologyPrototype.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
TrafficPrototypeTrafficPrototype.arrival_tableTrafficPrototype.start_atTrafficPrototype.arrival_interval_nsTrafficPrototype.durationTrafficPrototype.parallel_userTrafficPrototype.iterations_countTrafficPrototype.requests_countTrafficPrototype.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
TopologyEquipmentSetSimulationScenarioManagerSimulationScenarioManager.microservice_prototypes_dictSimulationScenarioManager.host_prototypes_dictSimulationScenarioManager.router_prototypes_dictSimulationScenarioManager.link_prototypes_dictSimulationScenarioManager.topology_equipments_dictSimulationScenarioManager.placement_scenarios_dictSimulationScenarioManager.from_config_file()SimulationScenarioManager.get_obj()SimulationScenarioManager.from_config()SimulationScenarioManager.res_alloc_scenarios_dictSimulationScenarioManager.affinity_prototypes_dictSimulationScenarioManager.service_chains_dictSimulationScenarioManager.microservices_dictSimulationScenarioManager.topologies_prototype_dictSimulationScenarioManager.placement_algorithms_dictSimulationScenarioManager.traffic_prototypes_dictSimulationScenarioManager.simulation_scenarios_dictSimulationScenarioManager.results_storage_driverSimulationScenarioManager.simulations_dictSimulationScenarioManager.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
MicroserviceMicroservice.nameMicroservice.endpoint_functionsMicroservice.memory_requestsMicroservice.ingress_bwMicroservice.egress_bwMicroservice.ingress_latencyMicroservice.egress_latencyMicroservice.blkio_capacityMicroservice.resource_allocation_scenarioMicroservice.load_balancerMicroservice.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_rulesMicroservice.ms_antiaffinity_rulesMicroservice.host_affinity_rulesMicroservice.host_antiaffinity_rulesMicroservice.replicasMicroservice.hostsMicroservice.replica_countMicroservice.cpu_requestsMicroservice.cpu_limits
- perfsim.service_chain.microservice_endpoint_function module
- perfsim.service_chain.microservice_endpoint_function_dtype module
- perfsim.service_chain.microservice_replica module
MicroserviceReplicaMicroserviceReplica.reinit()MicroserviceReplica.hostMicroserviceReplica.microserviceMicroserviceReplica.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
ReplicaThreadReplicaThread.before_killing_threadReplicaThread.before_executing_threadReplicaThread.after_executing_threadReplicaThread.replicaReplicaThread.replica_identifier_in_subchainReplicaThread.node_in_alt_graphReplicaThread.thread_id_in_nodeReplicaThread.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.instructionsReplicaThread.processReplicaThread.on_rqReplicaThread.coreReplicaThread.vruntimeReplicaThread.loadReplicaThread.cpu_requests_shareReplicaThread.cpu_limits
- perfsim.service_chain.service_chain module
- perfsim.service_chain.service_chain_link module
- perfsim.service_chain.service_chain_manager module
ServiceChainManagerServiceChainManager.alternative_graphServiceChainManager.nameServiceChainManager.subchainsServiceChainManager.node_subchain_id_mapServiceChainManager.rootServiceChainManager.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
ServiceChainResultDictServiceChainResultDict.simulation_nameServiceChainResultDict.estimated_costServiceChainResultDict.total_requestsServiceChainResultDict.successful_requestsServiceChainResultDict.timeout_requestsServiceChainResultDict.avg_latencyServiceChainResultDict.throughputServiceChainResultDict.arrival_timesServiceChainResultDict.latenciesServiceChainResultDict.completion_timesServiceChainResultDict.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
LoadGeneratorLoadGenerator.threads_dictLoadGenerator.arrivalsLoadGenerator.before_traffic_startLoadGenerator.before_generate_threadsLoadGenerator.before_requests_startLoadGenerator.after_requests_startLoadGenerator.before_exec_time_estimationLoadGenerator.before_executing_threadsLoadGenerator.after_completing_load_generationLoadGenerator.after_next_batch_arrival_time_calculationLoadGenerator.before_generate_request_threadsLoadGenerator.after_generate_request_threadsLoadGenerator.after_transmission_estimationLoadGenerator.after_estimating_time_of_next_eventLoadGenerator.before_transmit_requests_in_networkLoadGenerator.after_transmit_requests_in_network_and_load_balancing_threadsLoadGenerator.before_request_createdLoadGenerator.nameLoadGenerator.simLoadGenerator.requestsLoadGenerator.threadsLoadGenerator.latenciesLoadGenerator.total_requests_countLoadGenerator.merged_arrival_tableLoadGenerator.register_events()LoadGenerator.execute_traffic()LoadGenerator.completed_requestsLoadGenerator.get_latencies_grouped_by_sfc()LoadGenerator.plot_latencies()LoadGenerator.last_transmission_idLoadGenerator.next_trans_completion_timesLoadGenerator.requests_ready_for_thread_generationLoadGenerator.next_batch_arrival_timeLoadGenerator.merge_arrival_tables()
- perfsim.traffic.request module
RequestRequest.before_init_next_microservicesRequest.after_init_next_microservicesRequest.before_finalizing_subchainRequest.before_concluding_requestRequest.before_init_transmissionRequest.after_init_transmissionRequest.on_init_transmissionRequest.before_finish_transmissionRequest.after_finish_transmissionRequest.load_generatorRequest.traffic_prototypeRequest.scmRequest.latencyRequest.idRequest.iteration_idRequest.id_in_iterationRequest.statusRequest.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_timesRequest.trans_timesRequest.trans_exact_timesRequest.trans_init_timesRequest.current_nodesRequest.current_replicas_in_nodesRequest.subchains_statusRequest.next_replicas_in_nodesRequest.next_nodesRequest.trans_deltatimes
- perfsim.traffic.transmission module
TransmissionTransmission.register_events()Transmission.get_link_data()Transmission.recalc_bw_considering_err()Transmission.calculate_requested_bw()Transmission.transmit()Transmission.linksTransmission.calculate_transmission_time()Transmission.finish()Transmission.get_bandwidth_on_link()Transmission.source_nicTransmission.dest_nicTransmission.current_bwTransmission.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:
ObservableA 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
durationnanoseconds- Parameters:
duration (
float) – Duration of threads execution in nanoseconds- Return type:
int
- run_active_threads(duration)[source]#
Transmit all requests in network for
durationnanoseconds- 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.timenanoseconds- 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:
objectThis 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:
objectThis 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: