Skip to content
This repository was archived by the owner on Apr 11, 2019. It is now read-only.

Overall compatibility update #1

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
*.swp
/Manifest
/newrelic.yml
log/
doc/
docs
html/

*~
Gemfile.lock
.DS_Store
newrelic_ia.log

Expand All @@ -17,5 +17,3 @@ newrelic_ia.log

# other scm
.svn


9 changes: 0 additions & 9 deletions .loadpath

This file was deleted.

17 changes: 0 additions & 17 deletions .project

This file was deleted.

3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'http://rubygems.org'

gemspec
4 changes: 0 additions & 4 deletions PostInstall.txt

This file was deleted.

40 changes: 20 additions & 20 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ to your RPM console which can be viewed with custom dashboards.

== Synopsis

newrelic_ia [ options ] aspect, aspect..
newrelic_ia [ options ] aspect, aspect..

aspect: one or more of 'iostat' or 'disk' or 'memcached' (more to come)

-a, --all use all available aspects
-v, --verbose debug output
-q, --quiet quiet output
-e, --environment=ENV use ENV section in newrelic.yml
--install create a default newrelic.yml
--install KEY create a default newrelic.yml
-h, --help Show this help message.

== Requirements
Expand All @@ -29,15 +29,15 @@ to your RPM console which can be viewed with custom dashboards.

sudo gem install newrelic_ia

Once installed, run from the home directory of your Rails
Once installed, run from the home directory of your Rails
application, or create a separate working directory and run

newrelic_ia --install
newrelic_ia --install KEY

to create a template newrelic.yml file you can use. Edit this file
and substitute your license key and app_name value.

specify memcached nodes in memcached-nodes.txt.
specify memcached nodes in memcached-nodes.txt.

== Credits

Expand All @@ -58,24 +58,24 @@ Memcached stats are reported for each node and also sample reports aggregated st

uptime Number of seconds this server has been running
curr_items Current number of items stored by the server
total_items Total number of items stored by this server
total_items Total number of items stored by this server
ever since it started
bytes Current number of bytes used by this server to store items
curr_connections Number of open connections
total_connections Total number of connections opened since
total_connections Total number of connections opened since
the server started running
connection_structures Number of connection structures allocated by the server
cmd_get Cumulative number of retrieval requests
cmd_set Cumulative number of storage requests
get_hits Number of keys that have been requested and found present
get_misses Number of items that have been requested and not found
evictions Number of valid items removed from cache to free
evictions Number of valid items removed from cache to free
memory for new items
bytes_read Total number of bytes read by this server from network
bytes_written Total number of bytes sent by this server to network
limit_maxbytes Number of bytes this server is allowed to use for storage
threads Number of worker threads requested

Derived Stats (computed stats):

free_maxbytes Number of free bytes this server has available for storage
Expand All @@ -84,7 +84,7 @@ Stats Derivatives (time derivatives of stats):

hit_ratio Percent of keys that have been requested and found present
miss_ratio Percent of keys that have been requested and found missing
rpm Requests per minutes
rpm Requests per minutes
gpm Gets per minutes
hpm Hits per minutes
mpm Misses per minutes
Expand All @@ -99,34 +99,34 @@ Liquid template for NewRelic custom dashboard:

<div>
<div style="float: left; width: 50%;">
{% line_chart value:average_value title:'Cache Miss Ratio' metric:'System/Memcached/Miss Ratio' simple_tooltip:true label:segment_3 value_suffix:'%' %}
{% line_chart value:average_value title:'Cache Miss Ratio' metric:'System/Memcached/all/miss_ratio' simple_tooltip:true label:segment_3 value_suffix:'%' %}
</div>
<div style="float: left; width: 50%;">
{% line_chart value:average_value title:'Cache Memory' regexp:'System/Memcached/(Bytes|Free Bytes|Limit Maxbytes)' simple_tooltip:true label:segment_3 %}
{% line_chart value:average_value title:'Cache Memory' regexp:'System/Memcached/all/(bytes|free_bytes|limit_maxbytes)' simple_tooltip:true label:segment_3 %}
</div>
<br style="clear: both" />
</div>

<div style="padding-top: 20px">&nbsp;</div>

<div>
<div style="float: left; width: 50%;">
{% line_chart value:average_value title:'Cache Gets & Sets' regexp:'System/Memcached/(Gpm|Spm)' simple_tooltip:true label:segment_3 %}
{% line_chart value:average_value title:'Cache Gets & Sets' regexp:'System/Memcached/all/(gpm|spm)' simple_tooltip:true label:segment_3 %}
</div>
<div style="float: left; width: 50%;">
{% line_chart value:average_value title:'Cache Misses, Flushes, & Evictions' regexp:'System/Memcached/(Mpm|Epm|Fpm)' simple_tooltip:true label:segment_3 %}
{% line_chart value:average_value title:'Cache Misses, Flushes, & Evictions' regexp:'System/Memcached/all/(mpm|epm|fpm)' simple_tooltip:true label:segment_3 %}
</div>
<br style="clear: both" />
</div>

<div style="padding-top: 20px">&nbsp;</div>

<div>
<div style="float: left; width: 50%;">
{% line_chart value:average_value title:'Active Connections' metric:'System/Memcached/Curr Connections' simple_tooltip:true hide_legend:true %}
{% line_chart value:average_value title:'Active Connections' metric:'System/Memcached/all/curr_connections' simple_tooltip:true hide_legend:true %}
</div>
<div style="float: left; width: 50%;">
{% line_chart value:average_value title:'Cache Objects' metric:'System/Memcached/Curr Items' simple_tooltip:true hide_legend:true %}
{% line_chart value:average_value title:'Cache Objects' metric:'System/Memcached/all/curr_items' simple_tooltip:true hide_legend:true %}
</div>
<br style="clear: both" />
</div>
Expand Down
89 changes: 6 additions & 83 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,87 +1,10 @@
require 'rubygems'
require 'rake'
require File.dirname(__FILE__) + '/lib/new_relic/ia/version.rb'
require 'rake/testtask'

GEM_NAME = "newrelic_ia"
GEM_VERSION = NewRelic::IA::VERSION
AUTHOR = "Bill Kayser"
EMAIL = "[email protected]"
HOMEPAGE = "http://www.newrelic.com"
SUMMARY = "New Relic Gem for gathering system metrics"
DESCRIPTION = <<EOF
The New Relic Infrastructure Agent (IA) collects system metrics and transmits
them to the RPM server where they can be viewed with custom dashboards.
EOF

# See http://www.rubygems.org/read/chapter/20
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = GEM_NAME
gem.summary = SUMMARY
gem.description = DESCRIPTION
gem.email = EMAIL
gem.homepage = HOMEPAGE
gem.author = AUTHOR
gem.version = GEM_VERSION
gem.files = FileList['Rakefile', 'README*', 'CHANGELOG', 'spec/**/*','tasks/*', 'lib/**/*'].to_a
gem.test_files = FileList['spec/**/*.rb']
gem.rdoc_options <<
"--line-numbers" <<
"--inline-source" <<
"--title" << SUMMARY <<
"-m" << "README.rdoc"

gem.files.reject! { |fn| fn =~ /PostInstall.txt|pkg\/|rdoc\// }
gem.extra_rdoc_files = %w[CHANGELOG LICENSE README.rdoc bin/newrelic_ia]
gem.add_dependency 'newrelic_rpm', '>=2.10.6'
gem.post_install_message = File.read 'PostInstall.txt'
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
#!/usr/bin/env rake
require "bundler/gem_tasks"
require "rspec"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new("spec") do |spec|
spec.pattern = "spec/*_spec.rb"
end

load "#{File.dirname(__FILE__)}/tasks/rspec.rake"

task :manifest do
puts "Manifest task is no longer used since switching to jeweler."
end

begin
require 'rcov/rcovtask'
Rcov::RcovTask.new do |test|
test.libs << 'test'
test.pattern = 'spec/**/*.rb'
test.verbose = true
end
rescue LoadError
task :rcov do
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
end
end

require 'spec/rake/spectask'
Spec::Rake::SpecTask.new(:spec) do |spec|
spec.libs << 'lib' << 'spec'
spec.spec_files = FileList['spec/**/*_spec.rb']
end

task :spec => :check_dependencies

task :default => :spec

require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
rdoc.title = SUMMARY
rdoc.main = "README.rdoc"
rdoc.rdoc_files << 'LICENSE' << 'README*' << 'CHANGELOG' << 'lib/**/*.rb' << 'bin/**/*'
rdoc.inline_source = true
end

begin
require 'sdoc_helpers'
rescue LoadError
puts "sdoc support not enabled. Please gem install sdoc-helpers."
end
35 changes: 35 additions & 0 deletions config/newrelic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# This is a configuration file for the RPM Agent, tailored
# for use as a system monitor.
#
# Generated on Oct 12, 2011, from version 0.2.2
#
common: &default_settings
log_level: info
license_key: 'test'

app_name: System Monitor
ssl: false

# Set the array of nodes for the memcache monitor
memcached_nodes:
- localhost:11211
# - localhost:11212
# - localhost:11213

# These settings ensure we don't end up actually monitoring
# the IA agent itself--we aren't really interested in that.
# Don't change these.
disable_samplers: true
capture_params: false
transaction_tracer:
enabled: false

# NOTE if your application has other named environments, you should
# provide newrelic conifguration settings for these enviromnents here.
production:
<<: *default_settings

development:
<<: *default_settings

Loading