How to use the carbonate.sieve function in carbonate

To help you get started, we’ve selected a few carbonate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github graphite-project / carbonate / tests / test_sieve.py View on Github external
node_long = '1.1.1.1:2003:0'
        output = ['metric.101',
                  'metric.102',
                  'metric.103',
                  'metric.105',
                  'metric.107',
                  'metric.108']

        node2 = '2.2.2.2'
        node2_long = '2.2.2.2:2003:0'
        output2 = ['metric.100',
                  'metric.104',
                  'metric.106',
                  'metric.109']

        f = list(carbonate.sieve.filterMetrics(inputs, node, self.cluster))
        self.assertEqual(f, output)
        f = list(carbonate.sieve.filterMetrics(inputs, node_long, self.cluster))
        self.assertEqual(f, output)

        f = list(carbonate.sieve.filterMetrics(inputs, node2, self.cluster))
        self.assertEqual(f, output2)
        f = list(carbonate.sieve.filterMetrics(inputs, node2_long, self.cluster))
        self.assertEqual(f, output2)

        f = list(carbonate.sieve.filterMetrics(inputs, node, self.cluster, True))
        self.assertEqual(f, output2)

        f = list(carbonate.sieve.filterMetrics(inputs, node2, self.cluster, True))
        self.assertEqual(f, output)
github graphite-project / carbonate / tests / test_sieve.py View on Github external
'metric.109']

        f = list(carbonate.sieve.filterMetrics(inputs, node, self.cluster))
        self.assertEqual(f, output)
        f = list(carbonate.sieve.filterMetrics(inputs, node_long, self.cluster))
        self.assertEqual(f, output)

        f = list(carbonate.sieve.filterMetrics(inputs, node2, self.cluster))
        self.assertEqual(f, output2)
        f = list(carbonate.sieve.filterMetrics(inputs, node2_long, self.cluster))
        self.assertEqual(f, output2)

        f = list(carbonate.sieve.filterMetrics(inputs, node, self.cluster, True))
        self.assertEqual(f, output2)

        f = list(carbonate.sieve.filterMetrics(inputs, node2, self.cluster, True))
        self.assertEqual(f, output)