How to use the carbonate.list.listMetrics 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_list.py View on Github external
def test_list(self):
        res = list(listMetrics(self.rootdir))
        self.assertEqual(res, self.expected_metrics)
github graphite-project / carbonate / tests / test_list.py View on Github external
def test_list_with_trailing_slash(self):
        res = list(listMetrics(self.rootdir + '/'))
        self.assertEqual(res, self.expected_metrics)
github graphite-project / carbonate / carbonate / cli.py View on Github external
def carbon_list():
    parser = common_parser('List the metrics this carbon node contains')

    parser.add_argument(
        '-d', '--storage-dir',
        default='/opt/graphite/storage/whisper',
        help='Storage dir')

    args = parser.parse_args()

    try:
        for m in listMetrics(args.storage_dir):
            print m
    except IOError as e:
        if e.errno == errno.EPIPE:
            pass  # we got killed, lol
        else:
            raise SystemExit(e)
    except KeyboardInterrupt:
        sys.exit(1)
github graphite-project / carbonate / carbonate / cli.py View on Github external
def carbon_list():
    parser = common_parser('List the metrics this carbon node contains')

    parser.add_argument(
        '-d', '--storage-dir',
        default='/opt/graphite/storage/whisper',
        help='Storage dir')

    args = parser.parse_args()

    try:
        for m in listMetrics(args.storage_dir):
            print m
    except IOError as e:
        if e.errno == errno.EPIPE:
            pass  # we got killed, lol
        else:
            raise SystemExit(e)
    except KeyboardInterrupt:
        sys.exit(1)