Permalink
Browse files

Merge remote-tracking branch 'upstream/master'

  • Loading branch information...
captsens committed Mar 2, 2013
2 parents c5333b9 + b9f8389 commit 68722ddf426a566c8451e7a65c6cd536fdaf26fa
View
@@ -10,31 +10,33 @@
print "You are using python %s, but version 2.4 or greater is required" % py_version
raise SystemExit(1)
-fatal = 0
-warning = 0
+required = 0
+optional = 0
# Test for whisper
try:
import whisper
except:
- print "[FATAL] Unable to import the 'whisper' module, please download this package from the Graphite project page and install it.\n"
- fatal += 1
+ # No? test for ceres
+ try:
+ import ceres
+
+ # We imported ceres, but not whisper so it's an optional dependency
+ print "[OPTIONAL] Unable to import the 'whisper' module. Without it the webapp will be unable to read .wsp files"
+ optional +=1
+ except:
+ print "[REQUIRED] Unable to import the 'whisper' or 'ceres' modules, please download this package from the Graphite project page and install it.\n"
+ required += 1
-# Test for ceres
-try:
- import ceres
-except:
- print "[FATAL] Unable to import the 'ceres' module, please download this package from the Graphite project page and install it.\n"
- fatal += 1
# Test for pycairo
try:
import cairo
except:
- print "[FATAL] Unable to import the 'cairo' module, do you have pycairo installed for python %s?\n" % py_version
+ print "[REQUIRED] Unable to import the 'cairo' module, do you have pycairo installed for python %s?\n" % py_version
cairo = None
- fatal += 1
+ required += 1
# Test that pycairo has the PNG backend
@@ -43,8 +45,8 @@
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 10, 10)
del surface
except:
- print "[FATAL] Failed to create an ImageSurface with cairo, you probably need to recompile cairo with PNG support\n"
- fatal += 1
+ print "[REQUIRED] Failed to create an ImageSurface with cairo, you probably need to recompile cairo with PNG support\n"
+ required += 1
# Test that cairo can find fonts
try:
@@ -54,42 +56,46 @@
context.font_extents()
del surface, context
except:
- print "[FATAL] Failed to create text with cairo, this probably means cairo cant find any fonts. Install some system fonts and try again\n"
+ print "[REQUIRED] Failed to create text with cairo, this probably means cairo cant find any fonts. Install some system fonts and try again\n"
+
# Test for django
try:
import django
except:
- print "[FATAL] Unable to import the 'django' module, do you have Django installed for python %s?\n" % py_version
+ print "[REQUIRED] Unable to import the 'django' module, do you have Django installed for python %s?\n" % py_version
django = None
- fatal += 1
+ required += 1
+
# Test for pytz
try:
import pytz
except:
- print "[FATAL] Unable to import the 'pytz' module, do you have pytz module installed for python %s?\n" % py_version
- fatal += 1
+ print "[REQUIRED] Unable to import the 'pytz' module, do you have pytz module installed for python %s?\n" % py_version
+ required += 1
+
# Test for pyparsing
try:
import pyparsing
except:
- print "[FATAL] Unable to import the 'pyparsing' module, do you have pyparsing module installed for python %s?\n" % py_version
- fatal += 1
+ print "[REQUIRED] Unable to import the 'pyparsing' module, do you have pyparsing module installed for python %s?\n" % py_version
+ required += 1
+
# Test for django-tagging
try:
import tagging
except:
- print "[FATAL] Unable to import the 'tagging' module, do you have django-tagging installed for python %s?\n" % py_version
- fatal += 1
+ print "[REQUIRED] Unable to import the 'tagging' module, do you have django-tagging installed for python %s?\n" % py_version
+ required += 1
# Verify django version
if django and django.VERSION[:2] < (1,1):
- print "[FATAL] You have django version %s installed, but version 1.1 or greater is required\n" % django.get_version()
- fatal += 1
+ print "[REQUIRED] You have django version %s installed, but version 1.1 or greater is required\n" % django.get_version()
+ required += 1
# Test for a json module
@@ -99,24 +105,24 @@
try:
import simplejson
except ImportError:
- print "[FATAL] Unable to import either the 'json' or 'simplejson' module, at least one is required.\n"
- fatal += 1
+ print "[REQUIRED] Unable to import either the 'json' or 'simplejson' module, at least one is required.\n"
+ required += 1
# Test for zope.interface
try:
from zope.interface import Interface
except ImportError:
- print "[WARNING] Unable to import Interface from zope.interface. Without it, you will be unable to run carbon on this server.\n"
- warning +=1
+ print "[OPTIONAL] Unable to import Interface from zope.interface. Without it, you will be unable to run carbon on this server.\n"
+ optional +=1
# Test for python-memcached
try:
import memcache
except:
- print "[WARNING] Unable to import the 'memcache' module, do you have python-memcached installed for python %s? This feature is not required but greatly improves performance.\n" % py_version
- warning += 1
+ print "[OPTIONAL] Unable to import the 'memcache' module, do you have python-memcached installed for python %s? This feature is not required but greatly improves performance.\n" % py_version
+ optional += 1
# Test for sqlite
@@ -126,47 +132,55 @@
except:
from pysqlite2 import dbapi2 #python 2.4
except:
- print "[WARNING] Unable to import the sqlite module, do you have python-sqlite2 installed for python %s? If you plan on using another database backend that Django supports (such as mysql or postgres) then don't worry about this. However if you do not want to setup the database yourself, you will need to install sqlite2 and python-sqlite2.\n" % py_version
- warning += 1
+ print "[OPTIONAL] Unable to import the sqlite module, do you have python-sqlite2 installed for python %s? If you plan on using another database backend that Django supports (such as mysql or postgres) then don't worry about this. However if you do not want to setup the database yourself, you will need to install sqlite2 and python-sqlite2.\n" % py_version
+ optional += 1
# Test for python-ldap
try:
import ldap
except:
- print "[WARNING] Unable to import the 'ldap' module, do you have python-ldap installed for python %s? Without python-ldap, you will not be able to use LDAP authentication in the graphite webapp.\n" % py_version
- warning += 1
+ print "[OPTIONAL] Unable to import the 'ldap' module, do you have python-ldap installed for python %s? Without python-ldap, you will not be able to use LDAP authentication in the graphite webapp.\n" % py_version
+ optional += 1
# Test for Twisted python
try:
import twisted
except:
- print "[WARNING] Unable to import the 'twisted' package, do you have Twisted installed for python %s? Without Twisted, you cannot run carbon on this server.\n" % py_version
- warning += 1
+ print "[OPTIONAL] Unable to import the 'twisted' package, do you have Twisted installed for python %s? Without Twisted, you cannot run carbon on this server.\n" % py_version
+ optional += 1
else:
tv = []
tv = twisted.__version__.split('.')
if int(tv[0]) < 8 or (int(tv[0]) == 8 and int(tv[1]) < 2):
- print "[WARNING] Your version of Twisted is too old to run carbon. You will not be able to run carbon on this server until you upgrade Twisted >= 8.2.\n"
- warning += 1
+ print "[OPTIONAL] Your version of Twisted is too old to run carbon. You will not be able to run carbon on this server until you upgrade Twisted >= 8.2.\n"
+ optional += 1
+
# Test for txamqp
try:
import txamqp
except:
- print "[WARNING] Unable to import the 'txamqp' module, this is required if you want to use AMQP. Note that txamqp requires python 2.5 or greater.\n"
- warning += 1
+ print "[OPTIONAL] Unable to import the 'txamqp' module, this is required if you want to use AMQP as an input to Carbon. Note that txamqp requires python 2.5 or greater.\n"
+ optional += 1
+
+
+# Test for python-rrdtool
+try:
+ import rrdtool
+except:
+ print "[OPTIONAL] Unable to import the 'python-rrdtool' module, this is required for reading RRD.\n"
-if fatal:
- print "%d necessary dependencies not met. Graphite will not function until these dependencies are fulfilled." % fatal
+if required:
+ print "%d necessary dependencies not met. Graphite will not function until these dependencies are fulfilled." % required
else:
print "All necessary dependencies are met."
-if warning:
- print "%d optional dependencies not met. Please consider the warning messages before proceeding." % warning
+if optional:
+ print "%d optional dependencies not met. Please consider the optional items before proceeding." % optional
else:
print "All optional dependencies are met."
View
@@ -68,6 +68,25 @@ GDash
`Gdash`_ is a simple Graphite dashboard built using Twitters Bootstrap driven by a small DSL.
+Giraffe
+--------
+`Giraffe`_ is a Graphite real-time dashboard based on `Rickshaw`_ and requires no server backend.
+Inspired by `Gdash`_, `Tasseo`_ and `Graphene`_ it mixes features from all three into a slightly
+different animal.
+
+Graphitus
+---------
+`graphitus`_ is a client side dashboard for graphite built using bootstrap and underscore.js.
+
+
+Graph-Explorer
+--------------
+`Graph-Explorer`_ is a graphite dashboard which uses plugins to add tags and metadata
+to metrics and a query language with lets you filter through them and
+compose/manipulate graphs on the fly. Also aims for high interactivity using
+`TimeseriesWidget`_ and minimal hassle to set up and get running.
+
+
Graphene
--------
`Graphene`_ is a Graphite dashboard toolkit based on `D3.js`_ and `Backbone.js`_ which was
@@ -201,10 +220,17 @@ Therry
------
`Therry`_ ia s simple web service that caches Graphite metrics and exposes an endpoint for dumping or searching against them by substring.
+TimeseriesWidget
+----------
+`TimeseriesWidget`_ adds timeseries graphs to your webpages/dashboards using a simple api,
+focuses on high interactivity and modern features (realtime zooming, datapoint inspection,
+annotated events, etc). Supports Graphite, flot, rickshaw and anthracite.
+
.. _Diamond: http://opensource.brightcove.com/project/Diamond/
.. _jmxtrans: http://code.google.com/p/jmxtrans/
.. _statsd: https://github.com/etsy/statsd
.. _Ganglia: http://ganglia.info/
+.. _graphitius: https://github.com/erezmazor/graphitus
.. _Backbone.js: http://documentcloud.github.com/backbone/
.. _collectd: http://collectd.org/
.. _collectd-to-graphite: https://github.com/loggly/collectd-to-graphite
@@ -225,6 +251,7 @@ Therry
.. _Graphiti: https://github.com/paperlesspost/graphiti
.. _Graphios: https://github.com/shawn-sterling/graphios
.. _Charcoal: https://github.com/cebailey59/charcoal
+.. _Graph-Explorer: https://github.com/Dieterbe/graph-explorer
.. _Graphitejs: https://github.com/prestontimmons/graphitejs
.. _Grockets: https://github.com/disqus/grockets
.. _Host sFlow: http://host-sflow.sourceforge.net/
@@ -239,4 +266,7 @@ Therry
.. _Seyren: https://github.com/scobal/seyren
.. _write-graphite: http://collectd.org/wiki/index.php/Plugin:Write_Graphite
.. _Therry: https://github.com/obfuscurity/therry
+.. _TimeseriesWidget: https://github.com/Dieterbe/timeserieswidget
.. _Graphsky: https://github.com/hyves-org/graphsky
+.. _Giraffe: http://kenhub.github.com/giraffe/
+.. _Rickshaw: http://code.shutterstock.com/rickshaw/
@@ -941,8 +941,8 @@ function createFunctionsMenu() {
menu: [
{text: 'Remove Above Value', handler: applyFuncToEachWithInput('removeAboveValue', 'Set any values above ___ to None')},
{text: 'Remove Above Percentile', handler: applyFuncToEachWithInput('removeAbovePercentile', 'Set any values above the ___th percentile to None')},
- {text: 'Remove Below Value', handler: applyFuncToEachWithInput('removeAboveValue', 'Set any values above ___ to None')},
- {text: 'Remove Below Percentile', handler: applyFuncToEachWithInput('removeAbovePercentile', 'Set any values above the ___th percentile to None')}
+ {text: 'Remove Below Value', handler: applyFuncToEachWithInput('removeBelowValue', 'Set any values below ___ to None')},
+ {text: 'Remove Below Percentile', handler: applyFuncToEachWithInput('removeBelowPercentile', 'Set any values below the ___th percentile to None')}
]
},
{text: 'Most Deviant', handler: applyFuncToEachWithInput('mostDeviant', 'Draw the ___ metrics with the highest standard deviation')},
@@ -990,7 +990,7 @@ function createFunctionsMenu() {
{text: 'Draw non-zero As Infinite', handler: applyFuncToEach('drawAsInfinite')},
{text: 'Line Width', handler: applyFuncToEachWithInput('lineWidth', 'Please enter a line width for this graph target')},
{text: 'Dashed Line', handler: applyFuncToEach('dashed')},
- {text: 'Keep Last Value', handler: applyFuncToEach('keepLastValue')},
+ {text: 'Keep Last Value', handler: applyFuncToEachWithInput('keepLastValue', 'Please enter the maximum number of "None" datapoints to overwrite, or leave empty for no limit. (default: empty)', {allowBlank: true})},
{text: 'Transform Nulls', handler: applyFuncToEachWithInput('transformNull', 'Please enter the value to transform null values to')},
{text: 'Substring', handler: applyFuncToEachWithInput('substr', 'Enter a starting position')},
{text: 'Group', handler: applyFuncToAll('group')},
@@ -1049,7 +1049,7 @@ function createOptionsMenu() {
var yAxisLeftMenu = new Ext.menu.Menu({
items: [
- menuInputItem("Left Y Label", "vtitle"),
+ menuInputItem("Left Y Label", "vtitle", "Left Y Label", /^$/),
menuInputItem("Left Y Minimum", "yMinLeft"),
menuInputItem("Left Y Maximum", "yMaxLeft"),
menuInputItem("Left Y Limit", "yLimitLeft"),
@@ -1062,7 +1062,7 @@ function createOptionsMenu() {
});
var yAxisRightMenu = new Ext.menu.Menu({
items: [
- menuInputItem("Right Y Label", "vtitleRight"),
+ menuInputItem("Right Y Label", "vtitleRight", "Right Y Label", /^$/),
menuInputItem("Right Y Minimum", "yMinRight"),
menuInputItem("Right Y Maximum", "yMaxRight"),
menuInputItem("Right Y Limit", "yLimitRight"),
@@ -1083,7 +1083,7 @@ function createOptionsMenu() {
var yAxisMenu = new Ext.menu.Menu({
items: [
- menuInputItem("Label", "vtitle"),
+ menuInputItem("Label", "vtitle", "Y-Axis Label", /^$/),
menuInputItem("Minimum", "yMin"),
menuInputItem("Maximum", "yMax"),
menuInputItem("Minor Lines", "minorY", "Enter the number of minor lines to draw", /^[a-zA-Z]/),
@@ -1119,6 +1119,7 @@ function createOptionsMenu() {
menuRadioItem("line", "Slope Line (default)", "lineMode", ""),
menuRadioItem("line", "Staircase Line", "lineMode", "staircase"),
menuRadioItem("line", "Connected Line", "lineMode", "connected"),
+ menuInputItem("Connected Line Limit", "connectedLimit", "The number of consecutive None values to jump over when in connected line mode. (default: no limit, leave empty)"),
menuCheckItem("Draw Null as Zero", "drawNullAsZero")
]
});
@@ -1237,7 +1238,7 @@ function menuHelpItem(name, message) {
function paramPrompt(question, param, regexp) {
if(regexp == null) {
- regexp = /[^A-Za-z0-9_.]/;
+ regexp = /[^A-Za-z0-9_.\-]/;
}
return function (menuItem, e) {
@@ -60,8 +60,16 @@ def post_event(request):
return HttpResponse(status=405)
def get_data(request):
- return HttpResponse(json.dumps(fetch(request), cls=EventEncoder),
- mimetype="application/json")
+ if 'jsonp' in request.REQUEST:
+ response = HttpResponse(
+ "%s(%s)" % (request.REQUEST.get('jsonp'),
+ json.dumps(fetch(request), cls=EventEncoder)),
+ mimetype='text/javascript')
+ else:
+ response = HttpResponse(
+ json.dumps(fetch(request), cls=EventEncoder),
+ mimetype="application/json")
+ return response
def fetch(request):
if request.GET.get("from", None) is not None:
@@ -39,6 +39,12 @@ def index_json(request):
if fnmatch.fnmatch(basename, '*.wsp'):
matches.append(os.path.join(root, basename))
+ for root, dirs, files in os.walk(settings.CERES_DIR):
+ root = root.replace(settings.CERES_DIR, '')
+ for filename in files:
+ if filename == '.ceres-node':
+ matches.append(root)
+
matches = [ m.replace('.wsp','').replace('/', '.') for m in sorted(matches) ]
if jsonp:
return HttpResponse("%s(%s)" % (jsonp, json.dumps(matches)), mimetype='text/javascript')
@@ -21,9 +21,7 @@
months = ['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec']
weekdays = ['sun','mon','tue','wed','thu','fri','sat']
-tzinfo = pytz.timezone(settings.TIME_ZONE)
-
-def parseATTime(s):
+def parseATTime(s, tzinfo=None):
s = s.strip().lower().replace('_','').replace(',','').replace(' ','')
if s.isdigit():
if len(s) == 8 and int(s[:4]) > 1900 and int(s[4:6]) < 13 and int(s[6:]) < 32:
@@ -31,9 +31,10 @@ def evaluateTokens(requestContext, tokens):
elif tokens.number:
if tokens.number.integer:
return int(tokens.number.integer)
-
elif tokens.number.float:
return float(tokens.number.float)
+ elif tokens.number.scientific:
+ return float(tokens.number.scientific[0])
elif tokens.string:
return str(tokens.string)[1:-1]
Oops, something went wrong.

0 comments on commit 68722dd

Please sign in to comment.