Skip to content

Instantly share code, notes, and snippets.

View alexdean's full-sized avatar
🍩

Alex Dean alexdean

🍩
View GitHub Profile
These are some user stories I scraped together to help guide the rewrite of ganglia's web application.
Overview
========
Most of the time, I want to just quickly have a look at the overall status of our systems, and verify that everything is
running smoothly. I tend to browse around the app, not necessarily looking for anything specific. I just want to be able
to see that everything looks 'normal'. If we receive a problem report (usually something vague like 'the web site is slow'),
ganglia is often the first place I look for any sign of trouble.
Here, I find the most value in being able to visualize lots of data at once, and in being able to quickly navigate from
{
"view_name": "routers",
"items": [
{
"vertical_label": "Percent",
"title": "Routers CPU",
"metric_regex": [
{
"regex": "cpu_(system|user)"
}
// https://github.com/ganglia/ganglia-web/blob/master/templates/default/header.tpl#L129
function setStartAndEnd(startTime, endTime) {
// we're getting local start/end times.
console.log('start', new Date(startTime*1000), 'end', new Date(endTime*1000));
var local_offset = new Date().getTimezoneOffset() * 60;
console.log('local_offset', local_offset);
console.log('server_utc_offset', server_utc_offset);
var delta = -server_utc_offset - local_offset;
@alexdean
alexdean / gist:1810911
Created February 12, 2012 21:26
trouble setting up graphite
# python manage.py syncdb
Traceback (most recent call last):
File "manage.py", line 11, in ?
execute_manager(settings)
File "/usr/lib/python2.4/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/usr/lib/python2.4/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.4/site-packages/django/core/management/__init__.py", line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
@alexdean
alexdean / gist:3699374
Created September 11, 2012 14:54
which god?
$ which god
/bin/god
@alexdean
alexdean / graphite_gunicorn_nginx.conf
Created November 7, 2012 03:14 — forked from bhang/graphite_gunicorn_nginx.conf
nginx Configuration for gunicorn + graphite
worker_processes 1;
user nobody nogroup;
pid /var/run/nginx.pid;
error_log /var/log/nginx/error.log;
events {
worker_connections 64;
}
@alexdean
alexdean / gist:4674639
Last active December 11, 2015 23:09
generalized batch mode for logstash outputs
# TOTALLY UNTESTED. Just a sketch.
module BatchAccumulator
def batch_initialize(options={})
if ! self.class.method_defined?(:flush)
raise ArgumentError, "Any class including BatchAccumulator must define a flush() method."
end
@batch_events ||= 50
@alexdean
alexdean / gist:5247258
Created March 26, 2013 17:17
split a mysqldump sql file into 1 file per table
require 'optparse'
$verbose = false
options = {
:file => nil,
:dir => '.'
}
optparse = OptionParser.new do|opts|
opts.banner = <<-EOF
@alexdean
alexdean / talk_pile.rb
Last active December 15, 2015 21:48
ruby-processing and fisica
require 'ruby-processing'
# ruby port of http://www.ricardmarxer.com/fisica/examples/ContactResize/applet/ContactResize.pde
class TalkPileApp < Processing::App
load_libraries :fisica
java_import "fisica.Fisica"
java_import "fisica.FWorld"
java_import "fisica.FDrawable"
@alexdean
alexdean / output.txt
Last active December 15, 2015 22:39
ruby-processing regression between jruby 1.7.2 and 1.7.3?
$ rvm use system
$ rp5 run test_sketch.rb
RUBY_VERSION: 1.9.3
RUBY_PLATFORM: java
JRUBY_VERSION: 1.7.3
JRUBY_REVISION: dac429b
FDrawable stroke methods ==========
[]