Skip to content

Instantly share code, notes, and snippets.

@mleinart
mleinart / write_random.py
Created August 20, 2013 16:41
Script to fill a Graphite Whisper data file with random data for testing purposes
#!/usr/bin/env python
import os
import time
import whisper
import sys
from optparse import OptionParser
from random import Random
SPARSE_SPACING = 5
@mleinart
mleinart / graphite-0.9.11.md
Last active December 21, 2015 08:29
Graphite 0.9.11 Release Notes

Changes

graphite-web

Bugs

  • broken nPercentile() and related functions
  • Python 2.4 compatibility in browser endpoint (dcarley)
  • Missing URL parameters in composer load
  • Fix to multiplySeries to return the expected type (nleskiw)
  • Don't blow up when empty series passed to cactiStyle (mattus)
  • Trailing commas in js breaking ie (nleskiw, davecoutts)
  • Remove extra and unnecessary rendering while loading saved graphs (hostedgraphite)
diff --git a/webapp/graphite/render/glyph.py b/webapp/graphite/render/glyph.py
index 15ceb0d..23482a7 100644
--- a/webapp/graphite/render/glyph.py
+++ b/webapp/graphite/render/glyph.py
@@ -751,10 +751,22 @@ class LineGraph(Graph):
'bevel' : cairo.LINE_JOIN_BEVEL,
}[linejoin])
+ # check whether there is an stacked metric
+ singleStacked = False
diff --git a/webapp/graphite/render/glyph.py b/webapp/graphite/render/glyph.py
index 15ceb0d..dadf411 100644
--- a/webapp/graphite/render/glyph.py
+++ b/webapp/graphite/render/glyph.py
@@ -755,6 +755,8 @@ class LineGraph(Graph):
if self.areaMode == 'stacked' and not self.secondYAxis: #TODO Allow stacked area mode with secondYAxis
total = []
for series in self.data:
+ if 'drawAsInfinite' in series.options:
+ continue
#!/usr/bin/env python
"""Launchpad to github bug migration script.
There's a ton of code from Hydrazine copied here:
https://launchpad.net/hydrazine
WARNING: this code was written for the Github issues v2 API, and has *not* been ported to v3. If anyone finds it useful and ports it, please drop me a pull request.
Usage
-----
@mleinart
mleinart / carbon-0_9_10-logrotation.patch
Created February 4, 2013 14:44
Patch to Carbon 0.9.10 to support external log rotation
diff --git a/conf/carbon.conf.example b/conf/carbon.conf.example
index 53708a8..7f35e8e 100644
--- a/conf/carbon.conf.example
+++ b/conf/carbon.conf.example
@@ -30,6 +30,9 @@
#
#LOCAL_DATA_DIR = /opt/graphite/storage/whisper/
+# Enable daily log rotation. If disabled, a kill -HUP can be used after a manual rotate
+ENABLE_LOGROTATION = True
#!/usr/bin/env python
import os
import time
import whisper
import sys
from optparse import OptionParser
from random import Random
SPARSE_SPACING = 5
@mleinart
mleinart / walk_with_links.py
Created October 15, 2012 21:33
os.walk with followlinks=true on python 2.4
@mleinart
mleinart / gist:3895245
Created October 15, 2012 20:33
Walking with symlinks
def do_some_walkin(start_path, matches=None):
if matches == None:
matches = []
for root, dirs, files in os.walk(start_path, followlinks=True):
for dir in dirs:
if os.path.islink(os.path.join(root,dir)):
do_some_walkin(os.path.join(root,dir), matches)
root = root.replace(settings.RRD_DIR, '')
for basename in files:
if fnmatch.fnmatch(basename, '*.rrd'):
@mleinart
mleinart / run
Created June 22, 2012 20:35
Runit run file for carbon-cache under virtualenv with twistd
!/bin/sh
exec 2>&1
source /opt/graphite/.venv/bin/activate
exec chpst -e env -u graphite -l /opt/graphite/storage/carbon-cache.lock -- twistd --nodaemon --umask=0022 carbon-cache -c /opt/graphite/conf/carbon.conf start