Create the appropriate SqlServerMetric 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, instance, cfg_inst, table, base_name, user_type, sql_type, column):
        '''
        Create the appropriate SqlServerMetric 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, SqlSimpleMetric),
                PERF_COUNTER_LARGE_RAWCOUNT: (self.gauge, SqlSimpleMetric),
                PERF_LARGE_RAW_BASE: (self.gauge, SqlSimpleMetric),
                PERF_RAW_LARGE_FRACTION: (self.gauge, SqlFractionMetric),
                PERF_AVERAGE_BULK: (self.gauge, SqlIncrFractionMetric),
            }
            if user_type is not None:
                # user type overrides any other value
                metric_type = getattr(self, user_type)
                cls = SqlSimpleMetric

            else:
                metric_type, cls = metric_type_mapping[sql_type]
        else:
            table_type_mapping = {
                DM_OS_WAIT_STATS_TABLE: (self.gauge, SqlOsWaitStat),
                DM_OS_MEMORY_CLERKS_TABLE: (self.gauge, SqlOsMemoryClerksStat),
                DM_OS_VIRTUAL_FILE_STATS: (self.gauge, SqlIoVirtualFileStat),
            }
            metric_type, cls = table_type_mapping[table]

        return cls(self._get_connector(instance), cfg_inst, base_name, metric_type, column, self.log)