def _test_optional_metrics(self, optional_metrics, at_least):

        before = len(filter(lambda m: m[3].get('tested'), self.metrics))

        for mname in optional_metrics:
            self.assertMetric(mname, tags=self.METRIC_TAGS, at_least=0)

        # Compute match rate
        after = len(filter(lambda m: m[3].get('tested'), self.metrics))

        self.assertTrue(after - before > at_least)
Uses v1 system to add users, i.e. saving to system.users.
dataset/ETHPy150Open serverdensity/sd-agent/tests/checks/integration/test_mysql.py/TestMySql._test_optional_metrics--crossover with--dataset/ETHPy150Open mongodb/mongo-python-driver/pymongo/database.py/Database._legacy_add_user