
                             S r SSKJr  SSKJr  SSKJr  SSKrSSKJr  SSKJr  Sr	S	r
S
rSrSrSrSrSrSrSrSrS
rSrSrSrS rS rg)zCUtil for dynamically setting the best performing app configuration.    )absolute_import)division)unicode_literalsN)log)
properties5MiT      
      50Mi10Mi   c                     [        [        R                  R                  U 5      nUR	                  5       c  UR                  U5        gg)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                 ,   U (       a  [        S[        5        [        S[        5        [        R                  " 5       S:  aG  [
        R                  " S5        [        S[        5        [        S[        5        [        S[        5        g[
        R                  " S5        [        S[        5        [        S[        5        [        S[        5        g[        S[        5        [        S[        5        [        R                  " 5       S	:  aG  [
        R                  " S
5        [        S[        5        [        S[        5        [        S[         5        g[
        R                  " S5        [        S["        5        [        S[        5        [        S[$        5        g)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   