Created
April 7, 2011 17:46
-
-
Save cardinalblue/908290 to your computer and use it in GitHub Desktop.
custom widget for geckoboard
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
<?xml version="1.0" encoding="UTF-8"?> | |
<% epm = @newrelic_data["Errors"][0..-5].to_i %> | |
<% rpm = @newrelic_data["Throughput"][0..-5].to_i %> | |
<% response_time = @newrelic_data["Response Time"][0..-4].to_i %> | |
<% db = @newrelic_data["DB"][0..-2].to_f %> | |
<% cpu = @newrelic_data["CPU"][0..-2].to_f %> | |
<% db_time = db.to_f/100*response_time.to_f %> | |
<% cpu_time = cpu.to_f/100*response_time.to_f %> | |
<% other_time = response_time.to_f - db_time - cpu_time %> | |
<root> | |
<item> | |
<value><%= response_time %></value> | |
<text>Response time (ms)</text> | |
</item> | |
<item> | |
<value><%= epm.to_i %></value> | |
<text>Errors per minute (<%= @newrelic_data["Error Rate"] %>)</text> | |
</item> | |
<item> | |
<value><%= rpm.to_i %></value> | |
<text>Requests per minute</text> | |
</item> | |
</root> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment