This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
counter processes_oom_killed_total | |
counter processes_oom_killed_by_name by label | |
/Killed process (\d+) \((\S+)\) total-vm:\d+kB, anon-rss:\d+kB, file-rss:\d+kB$/ { | |
processes_oom_killed_total++ | |
processes_oom_killed_by_name[$2]++ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#define _FILE_OFFSET_BITS 64 | |
#include <stdio.h> | |
#include <time.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/resource.h> | |
#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \ | |
} while (0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import time | |
import traceback | |
import urllib.parse | |
import requests | |
from structlog import get_logger | |
from graphite_api.intervals import IntervalSet, Interval | |
from graphite_api.node import LeafNode, BranchNode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -u -r graphite_old/render/datalib.py graphite/render/datalib.py | |
--- graphite_old/render/datalib.py 2016-10-19 18:22:37.000000000 +0200 | |
+++ graphite/render/datalib.py 2016-10-19 18:12:00.000000000 +0200 | |
@@ -106,7 +106,7 @@ | |
self.hosts = [ (server, instance) for (server, port, instance) in hosts ] | |
self.ports = dict( ((server, instance), port) for (server, port, instance) in hosts ) | |
self.timeout = float(timeout) | |
- self.hash_ring = ConsistentHashRing(self.hosts) | |
+ self.hash_ring = ConsistentHashRing(self.hosts, hash_type=settings.CARBONLINK_HASHING_TYPE) | |
self.connections = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
sys.path.append('/opt/graphite/webapp') | |
try: | |
from importlib import import_module | |
except ImportError: | |
from django.utils.importlib import import_module | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'graphite.settings') # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mport os | |
import sys | |
sys.path.append('/opt/graphite/webapp') | |
try: | |
from importlib import import_module | |
except ImportError: | |
from django.utils.importlib import import_module | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'graphite.settings') # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
import re | |
EXPAND_BRACES_RE = re.compile(r'.*(\{.+?[^\\]\})') | |
def expand_braces_new(s): | |
res = list() | |
m = EXPAND_BRACES_RE.search(s) | |
if m is not None: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
try: | |
# Django versions >= 1.9 | |
from django.utils.module_loading import import_module | |
except ImportError: | |
# Django versions < 1.9 | |
from django.utils.importlib import import_module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+--------------------------------+ | |
| | | |
+----+ | 10.0.0.2:2004 | | |
| +------> | | |
| | | | | |
| | +--------------------------------+ | |
| r1 | | |
+--------+ | | +--------------------------------+ | |
| | | rf=1 | | | |
| | | +------> 10.0.0.3:2004 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding=utf-8 | |
# | |
# collectd-iostat-python | |
# ====================== | |
# | |
# Collectd-iostat-python is an iostat plugin for collectd that allows you to | |
# graph Linux iostat metrics in Graphite or other output formats that are | |
# supported by collectd. | |
# |