
                             d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlmZ dZ	d	Z
d
ZdZdZdZdZdZdZdZdZd
ZdZdZdZd Zd Zy)zCUtil for dynamically setting the best performing app configuration.    )absolute_import)division)unicode_literalsN)log)
properties5MiT      
      50Mi10Mi   c                     t        t        j                  j                  |       }|j	                         |j                  |       yy)z@Sets property to opitmized value if user did not set custom one.N)getattrr   VALUESstorageGetSet)property_namevaluestorage_propertys      Blib/googlecloudsdk/command_lib/storage/optimize_parameters_util.py_set_if_not_user_setr   .   s=    Z..66F# $    c                    | rt        dt               t        dt               t        j                         dk  rFt        j                  d       t        dt               t        dt               t        dt               yt        j                  d       t        dt               t        dt               t        dt               yt        dt               t        dt               t        j                         d	k  rFt        j                  d
       t        dt               t        dt               t        dt                yt        j                  d       t        dt"               t        dt               t        dt$               y)z8Determines best app config based on system and workload.%sliced_object_download_component_size%sliced_object_download_max_componentsr   z0Using low CPU count, multi-file workload config.process_countthread_count sliced_object_download_thresholdz1Using high CPU count, multi-file workload config.r   z1Using low CPU count, single-file workload config.z2Using high CPU count, single-file workload config.N)r   COMPONENT_SIZE0MULTI_FILE_SLICED_OBJECT_DOWNLOAD_MAX_COMPONENTSmultiprocessing	cpu_countr   info MULTI_FILE_LOW_CPU_PROCESS_COUNTMULTI_FILE_LOW_CPU_THREAD_COUNT3MULTI_FILE_LOW_CPU_SLICED_OBJECT_DOWNLOAD_THRESHOLD!MULTI_FILE_HIGH_CPU_PROCESS_COUNT MULTI_FILE_HIGH_CPU_THREAD_COUNT4MULTI_FILE_HIGH_CPU_SLICED_OBJECT_DOWNLOAD_THRESHOLD,SINGLE_FILE_SLICED_OBJECT_DOWNLOAD_THRESHOLD!SINGLE_FILE_LOW_CPU_PROCESS_COUNTSINGLE_FILE_THREAD_COUNT9SINGLE_FILE_LOW_CPU_SLICED_OBJECT_DOWNLOAD_MAX_COMPONENTS"SINGLE_FILE_HIGH_CPU_PROCESS_COUNT:SINGLE_FILE_HIGH_CPU_SLICED_OBJECT_DOWNLOAD_MAX_COMPONENTS) is_estimated_multi_file_workloads    r   detect_and_set_best_configr4   5   s/   %@')@IK  "Q&	hhAB?,LM>+JK=NP 
hhBC?,MN>+KL
,
>@ ;EG@')  "Q&	hhBC?,MN>+CD
1
CE 
hhCD?,NO>+CD
1
DFr   )__doc__
__future__r   r   r   r$   googlecloudsdk.corer   r   r"   DEFAULT_TO_PARALLELISMr'   r*   r(   r+   r)   r,   r#   r.   r1   r/   r-   r0   r2   r   r4    r   r   <module>r:      s    J &  '  # * #$  $& !"$ #$  6< 37= 435 0$% !%& " /5 ,<= 9=? : &Fr   