How to use the carbonate.aggregation.setAggregation 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 / carbonate / cli.py View on Github external
if args.metrics_file and args.metrics_file[0] != '-':
        fi = args.metrics_file
        metrics = map(lambda s: s.strip(), fileinput.input(fi))
    else:
        metrics = map(lambda s: s.strip(), fileinput.input([]))

    metrics_count = 0

    for metric in metrics:
        name, t = metric.strip().split('|')

        mode = AGGREGATION[t]
        if mode is not None:
            cname = name.replace('.', '/')
            path = os.path.join(args.storage_dir, cname + '.wsp')
            metrics_count = metrics_count + setAggregation(path, mode)

    logging.info('Successfully set aggregation mode for ' +
                 '%d of %d metrics' % (metrics_count, len(metrics)))
github graphite-project / carbonate / carbonate / cli.py View on Github external
if args.metrics_file and args.metrics_file[0] != '-':
        fi = args.metrics_file
        metrics = map(lambda s: s.strip(), fileinput.input(fi))
    else:
        metrics = map(lambda s: s.strip(), fileinput.input([]))

    metrics_count = 0

    for metric in metrics:
        name, t = metric.strip().split('|')

        mode = AGGREGATION[t]
        if mode is not None:
            cname = name.replace('.', '/')
            path = os.path.join(args.storage_dir, cname + '.wsp')
            metrics_count = metrics_count + setAggregation(path, mode)

    logging.info('Successfully set aggregation mode for ' +
                 '%d of %d metrics' % (metrics_count, len(metrics)))