How to use the carbonate.util.metric_path 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 / delete.py View on Github external
def deleteMetric(metric,
                 storage_dir='/opt/graphite/storage/whisper',
                 trash_dir="/opt/graphite/storage/whisper/trash"):
    oldMetric = metric_path(metric, storage_dir)
    newMetric = metric_path(metric, trash_dir)

    if os.path.isfile(oldMetric):
        try:
            os.makedirs(os.path.dirname(newMetric))
        except os.error:
            pass

        startFrom = time()
        try:
            fill_archives(oldMetric, newMetric, startFrom)
            os.unlink(oldMetric)
        except OSError, e:
            if e.errno != errno.ENOENT:
                raise
github graphite-project / carbonate / carbonate / delete.py View on Github external
def deleteMetric(metric,
                 storage_dir='/opt/graphite/storage/whisper',
                 trash_dir="/opt/graphite/storage/whisper/trash"):
    oldMetric = metric_path(metric, storage_dir)
    newMetric = metric_path(metric, trash_dir)

    if os.path.isfile(oldMetric):
        try:
            os.makedirs(os.path.dirname(newMetric))
        except os.error:
            pass

        startFrom = time()
        try:
            fill_archives(oldMetric, newMetric, startFrom)
            os.unlink(oldMetric)
        except OSError, e:
            if e.errno != errno.ENOENT:
                raise