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
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
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 | |
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. | |
# |
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
# Copyright 2008 Orbitz WorldWide | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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
### Keybase proof | |
I hereby claim: | |
* I am deniszh on github. | |
* I am deniszh (https://keybase.io/deniszh) on keybase. | |
* I have a public key whose fingerprint is A477 D65F 62A7 59DD 1333 16A9 841F F4A7 BEF1 7C12 | |
To claim this, I am signing this object: |
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 |