<s> """<STR_LIT>""" <EOL> import logging <EOL> from perfkitbenchmarker import configs <EOL> from perfkitbenchmarker import vm_util <EOL> from perfkitbenchmarker import sample <EOL> BENCHMARK_NAME = '<STR_LIT>' <EOL> BENCHMARK_CONFIG = """<STR_LIT>""" <EOL> def GetConfig ( user_config ) : <EOL> return configs . LoadConfig ( BENCHMARK_CONFIG , user_config , BENCHMARK_NAME ) <EOL> def Prepare ( unused_benchmark_spec ) : <EOL> pass <EOL> def _GetTimeToBoot ( vms , vm_index ) : <EOL> """<STR_LIT>""" <EOL> vm = vms [ vm_index ] <EOL> metadata = { '<STR_LIT>' : vm . num_cpus , '<STR_LIT>' : vm_index , <EOL> '<STR_LIT>' : len ( vms ) , '<STR_LIT>' : vm . OS_TYPE } <EOL> metadata . update ( vm . GetMachineTypeDict ( ) ) <EOL> assert vm . bootable_time <EOL> assert vm . create_start_time <EOL> assert vm . bootable_time >= vm . create_start_time <EOL> value = vm . bootable_time - vm . create_start_time <EOL> return sample . Sample ( '<STR_LIT>' , value , '<STR_LIT>' , metadata ) <EOL> def Run ( benchmark_spec ) : <EOL> """<STR_LIT>""" <EOL> logging . info ( '<STR_LIT>' ) <EOL> vms = benchmark_spec . vms <EOL> params = [ ( ( vms , i ) , { } ) for i in xrange ( len ( vms ) ) ] <EOL> samples = vm_util . RunThreaded ( _GetTimeToBoot , params ) <EOL> logging . info ( samples ) <EOL> assert len ( samples ) == len ( vms ) <EOL> return samples <EOL> def Cleanup ( unused_benchmark_spec ) : <EOL> pass </s>
