You can apply functions to metric queries in the graph editor, as long as you use the JSON editor.
The general format is:
function(metric{scope} [by {filter}])
In case of binary operators (+, -, /, *), the format is:
gem 'dogstatsd-ruby' |
require 'rubygems' | |
require 'dogapi' | |
# Create a simple client | |
# You typically want to do: | |
# Dogapi::Client.new(your_actual_api_key_as_a_string, ...) | |
dog = Dogapi::Client.new(YOUR_API_KEY_HERE) | |
# Emit a list of points in one go as a list of (timestamp, value) | |
# here we pretend to send a point a minute for the past hour |
alerts_by_day <- read.csv(‘by_day.csv’) | |
ggplot(alerts_by_day, aes(day_of_year, daily, color=factor(notifying))) + geom_line() | |
+ xlab("Day of year") | |
+ ylab("Service Alerts") | |
+ ggtitle("Notifying v. silent alerts per day") | |
+ geom_smooth() |
occurrence_doy | notifying | daily | |
---|---|---|---|
1 | 1 | 12 | |
1 | 0 | 426 | |
2 | 0 | 1158 | |
2 | 1 | 2 | |
3 | 0 | 630 | |
3 | 1 | 48 | |
4 | 0 | 1398 | |
4 | 1 | 76 | |
5 | 1 | 8 |
#!/bin/bash -e | |
# Check python 2.6 or greater | |
python -V 2>&1 | awk '$2 !~ /^2.[67]|^3/ {exit 1}' | |
# Download virtualenv | |
curl https://raw.github.com/pypa/virtualenv/master/virtualenv.py > virtualenv.py | |
python virtualenv.py $HOME/datadog | |
source $HOME/datadog/bin/activate | |
# Install dogapi | |
pip install dogapi | |
# Set up the dog alias |
root@arcee:/var/log# curl http://localhost/server-status?auto | |
BusyWorkers: 1 | |
IdleWorkers: 9 | |
Scoreboard: _W.________..................................................................................................................................................................................................................................................... | |
VS. | |
mlambie@blitzwing:~$ curl http://localhost/server-status?auto | |
Total Accesses: 557 | |
Total kBytes: 17924 |
2012-05-31 15:17:40,719 - root - INFO - Logging to /tmp/dd-agent.log | |
2012-05-31 15:17:40,719 - root - WARNING - Pid file: /tmp/dd-agent.pid | |
2012-05-31 15:17:40,719 - root - INFO - Running in foreground | |
2012-05-31 15:17:40,719 - agent - DEBUG - Collecting basic system stats | |
2012-05-31 15:17:40,738 - agent - DEBUG - System: {'nixV': ('Ubuntu', '10.04', 'lucid'), 'cpuCores': 2, 'machine': 'x86_64', 'platform': 'linux2', 'pythonV': '2.6.5', 'processor': ''} | |
2012-05-31 15:17:40,738 - agent - DEBUG - Creating checks instance | |
2012-05-31 15:17:40,785 - agent - INFO - Running on EC2, instanceId: i-fdf2929e | |
2012-05-31 15:17:40,786 - checks - INFO - Dogstream parsers: [] | |
2012-05-31 15:17:40,788 - checks - INFO - Starting checks | |
2012-05-31 15:17:40,788 - checks - DEBUG - SIZE: <function getApacheStatus at 0x2ca5a28> wrote 5 bytes uncompressed |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
BEGIN { | |
skipped = 0; | |
processed = 0; | |
} | |
/Skipped/ { | |
skipped++; | |
} | |
/Saving/ { |