(version, jvm_rate=False)
return metrics
Get the proper set of stats metrics for the specified ES version
Get the proper set of stats metrics for the specified ES version
Get the proper set of stats metrics for the specified ES version
def stats_for_version(version, jvm_rate=False):
    """
    Get the proper set of stats metrics for the specified ES version
    """
    metrics = dict(STATS_METRICS)

    # JVM additional metrics
    if version >= [0, 90, 10]:
        metrics.update(JVM_METRICS_POST_0_90_10)
        if jvm_rate:
            metrics.update(JVM_METRICS_RATE)
    else:
        metrics.update(JVM_METRICS_PRE_0_90_10)

    # Additional Stats metrics
    if version >= [0, 90, 5]:
        metrics.update(ADDITIONAL_METRICS_POST_0_90_5)
    else:
        metrics.update(ADDITIONAL_METRICS_PRE_0_90_5)

    if version >= [1, 0, 0]:
        metrics.update(ADDITIONAL_METRICS_POST_1_0_0)

    if version < [2, 0, 0]:
        metrics.update(ADDITIONAL_METRICS_PRE_2_0)
        if version >= [0, 90, 5]:
            metrics.update(ADDITIONAL_METRICS_POST_0_90_5_PRE_2_0)
        if version >= [1, 0, 0]:
            metrics.update(ADDITIONAL_METRICS_1_x)

    if version >= [1, 3, 0]:
        metrics.update(ADDITIONAL_METRICS_POST_1_3_0)

    if version >= [1, 4, 0]:
        metrics.update(ADDITIONAL_METRICS_POST_1_4_0)

    if version >= [1, 5, 0]:
        metrics.update(ADDITIONAL_METRICS_POST_1_5_0)

    if version >= [1, 6, 0]:
        metrics.update(ADDITIONAL_METRICS_POST_1_6_0)

    if version >= [2, 0, 0]:
        metrics.update(ADDITIONAL_METRICS_POST_2_0)

    if version >= [2, 1, 0]:
        metrics.update(ADDITIONAL_METRICS_POST_2_1)

    if version >= [5, 0, 0]:
        metrics.update(ADDITIONAL_METRICS_5_x)

    if version < [5, 0, 0]:
        metrics.update(ADDITIONAL_METRICS_PRE_5_0_0)

    if version >= [6, 3, 0]:
        metrics.update(ADDITIONAL_METRICS_POST_6_3)
    else:
        metrics.update(ADDITIONAL_METRICS_PRE_6_3)

    if version < [7, 0, 0]:
        metrics.update(ADDITIONAL_METRICS_PRE_7_0_0)

    if version >= [7, 2, 0]:
        metrics.update(ADDITIONAL_METRICS_POST_7_2_0)

    return metrics
def stats_for_version ( version , jvm_rate = False ) : metrics = dict ( STATS_METRICS ) # JVM additional metrics if version >= [ 0 , 90 , 10 ] : metrics . update ( JVM_METRICS_POST_0_90_10 ) if jvm_rate : metrics . update ( JVM_METRICS_RATE ) else : metrics . update ( JVM_METRICS_PRE_0_90_10 ) # Additional Stats metrics if version >= [ 0 , 90 , 5 ] : metrics . update ( ADDITIONAL_METRICS_POST_0_90_5 ) else : metrics . update ( ADDITIONAL_METRICS_PRE_0_90_5 ) if version >= [ 1 , 0 , 0 ] : metrics . update ( ADDITIONAL_METRICS_POST_1_0_0 ) if version < [ 2 , 0 , 0 ] : metrics . update ( ADDITIONAL_METRICS_PRE_2_0 ) if version >= [ 0 , 90 , 5 ] : metrics . update ( ADDITIONAL_METRICS_POST_0_90_5_PRE_2_0 ) if version >= [ 1 , 0 , 0 ] : metrics . update ( ADDITIONAL_METRICS_1_x ) if version >= [ 1 , 3 , 0 ] : metrics . update ( ADDITIONAL_METRICS_POST_1_3_0 ) if version >= [ 1 , 4 , 0 ] : metrics . update ( ADDITIONAL_METRICS_POST_1_4_0 ) if version >= [ 1 , 5 , 0 ] : metrics . update ( ADDITIONAL_METRICS_POST_1_5_0 ) if version >= [ 1 , 6 , 0 ] : metrics . update ( ADDITIONAL_METRICS_POST_1_6_0 ) if version >= [ 2 , 0 , 0 ] : metrics . update ( ADDITIONAL_METRICS_POST_2_0 ) if version >= [ 2 , 1 , 0 ] : metrics . update ( ADDITIONAL_METRICS_POST_2_1 ) if version >= [ 5 , 0 , 0 ] : metrics . update ( ADDITIONAL_METRICS_5_x ) if version < [ 5 , 0 , 0 ] : metrics . update ( ADDITIONAL_METRICS_PRE_5_0_0 ) if version >= [ 6 , 3 , 0 ] : metrics . update ( ADDITIONAL_METRICS_POST_6_3 ) else : metrics . update ( ADDITIONAL_METRICS_PRE_6_3 ) if version < [ 7 , 0 , 0 ] : metrics . update ( ADDITIONAL_METRICS_PRE_7_0_0 ) if version >= [ 7 , 2 , 0 ] : metrics . update ( ADDITIONAL_METRICS_POST_7_2_0 ) return metrics