(self, cfg_inst, table, base_name=None, user_type=None, sql_type=None, column=None)
return cls(cfg_inst, base_name, metric_type, column, self.log)
Create the appropriate BaseSqlServerMetric object, each implementing its method to
        fetch the metrics properly.
        If a `type` was specified in the config, it is used to report the value
        directly fetched from SQLServer. Otherwise, it is decided based on the
        sql_type, according to microsoft's documentation.
Create the appropriate BaseSqlServerMetric object, each implementing its method to
        fetch the metrics properly.
        If a `type` was specified in the config, it is used to report the value
        directly fetched from SQLServer. Otherwise, it is decided based on the
        sql_type, according to microsoft's documentation.
Create the appropriate BaseSqlServerMetric object each implementing its method to fetch the metrics properly . If a type was specified in the config it is used to report the value directly fetched from SQLServer . Otherwise it is decided based on the sql_type according to microsoft s documentation .
def typed_metric(self, cfg_inst, table, base_name=None, user_type=None, sql_type=None, column=None):
        """
        Create the appropriate BaseSqlServerMetric object, each implementing its method to
        fetch the metrics properly.
        If a `type` was specified in the config, it is used to report the value
        directly fetched from SQLServer. Otherwise, it is decided based on the
        sql_type, according to microsoft's documentation.
        """
        if table == DEFAULT_PERFORMANCE_TABLE:
            metric_type_mapping = {
                PERF_COUNTER_BULK_COUNT: (self.rate, metrics.SqlSimpleMetric),
                PERF_COUNTER_LARGE_RAWCOUNT: (self.gauge, metrics.SqlSimpleMetric),
                PERF_LARGE_RAW_BASE: (self.gauge, metrics.SqlSimpleMetric),
                PERF_RAW_LARGE_FRACTION: (self.gauge, metrics.SqlFractionMetric),
                PERF_AVERAGE_BULK: (self.gauge, metrics.SqlIncrFractionMetric),
            }
            if user_type is not None:
                # user type overrides any other value
                metric_type = getattr(self, user_type)
                cls = metrics.SqlSimpleMetric

            else:
                metric_type, cls = metric_type_mapping[sql_type]
        else:
            # Lookup metrics classes by their associated table
            metric_type_str, cls = metrics.TABLE_MAPPING[table]
            metric_type = getattr(self, metric_type_str)

        return cls(cfg_inst, base_name, metric_type, column, self.log)
def typed_metric ( self , cfg_inst , table , base_name = None , user_type = None , sql_type = None , column = None ) : if table == DEFAULT_PERFORMANCE_TABLE : metric_type_mapping = { PERF_COUNTER_BULK_COUNT : ( self . rate , metrics . SqlSimpleMetric ) , PERF_COUNTER_LARGE_RAWCOUNT : ( self . gauge , metrics . SqlSimpleMetric ) , PERF_LARGE_RAW_BASE : ( self . gauge , metrics . SqlSimpleMetric ) , PERF_RAW_LARGE_FRACTION : ( self . gauge , metrics . SqlFractionMetric ) , PERF_AVERAGE_BULK : ( self . gauge , metrics . SqlIncrFractionMetric ) , } if user_type is not None : # user type overrides any other value metric_type = getattr ( self , user_type ) cls = metrics . SqlSimpleMetric else : metric_type , cls = metric_type_mapping [ sql_type ] else : # Lookup metrics classes by their associated table metric_type_str , cls = metrics . TABLE_MAPPING [ table ] metric_type = getattr ( self , metric_type_str ) return cls ( cfg_inst , base_name , metric_type , column , self . log )