newrelic_ia 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.2.2 2010-04-14
2
+
3
+ * Minor bug fixes
4
+ * Change options for install
5
+
1
6
  == 0.2.1 2010-04-14
2
7
 
3
8
  * Bug in --install, didn't work for REE
@@ -99,10 +99,10 @@ Liquid template for NewRelic custom dashboard:
99
99
 
100
100
  <div>
101
101
  <div style="float: left; width: 50%;">
102
- {% line_chart value:average_value title:'Cache Miss Ratio' metric:'System/Memcached/Miss Ratio' simple_tooltip:true label:segment_3 value_suffix:'%' %}
102
+ {% line_chart value:average_value title:'Cache Miss Ratio' metric:'System/Memcached/all/miss_ratio' simple_tooltip:true label:segment_3 value_suffix:'%' %}
103
103
  </div>
104
104
  <div style="float: left; width: 50%;">
105
- {% line_chart value:average_value title:'Cache Memory' regexp:'System/Memcached/(Bytes|Free Bytes|Limit Maxbytes)' simple_tooltip:true label:segment_3 %}
105
+ {% line_chart value:average_value title:'Cache Memory' regexp:'System/Memcached/all/(bytes|free_bytes|limit_maxbytes)' simple_tooltip:true label:segment_3 %}
106
106
  </div>
107
107
  <br style="clear: both" />
108
108
  </div>
@@ -111,10 +111,10 @@ Liquid template for NewRelic custom dashboard:
111
111
 
112
112
  <div>
113
113
  <div style="float: left; width: 50%;">
114
- {% line_chart value:average_value title:'Cache Gets & Sets' regexp:'System/Memcached/(Gpm|Spm)' simple_tooltip:true label:segment_3 %}
114
+ {% line_chart value:average_value title:'Cache Gets & Sets' regexp:'System/Memcached/all/(gpm|spm)' simple_tooltip:true label:segment_3 %}
115
115
  </div>
116
116
  <div style="float: left; width: 50%;">
117
- {% line_chart value:average_value title:'Cache Misses, Flushes, & Evictions' regexp:'System/Memcached/(Mpm|Epm|Fpm)' simple_tooltip:true label:segment_3 %}
117
+ {% line_chart value:average_value title:'Cache Misses, Flushes, & Evictions' regexp:'System/Memcached/all/(mpm|epm|fpm)' simple_tooltip:true label:segment_3 %}
118
118
  </div>
119
119
  <br style="clear: both" />
120
120
  </div>
@@ -123,10 +123,10 @@ Liquid template for NewRelic custom dashboard:
123
123
 
124
124
  <div>
125
125
  <div style="float: left; width: 50%;">
126
- {% line_chart value:average_value title:'Active Connections' metric:'System/Memcached/Curr Connections' simple_tooltip:true hide_legend:true %}
126
+ {% line_chart value:average_value title:'Active Connections' metric:'System/Memcached/all/curr_connections' simple_tooltip:true hide_legend:true %}
127
127
  </div>
128
128
  <div style="float: left; width: 50%;">
129
- {% line_chart value:average_value title:'Cache Objects' metric:'System/Memcached/Curr Items' simple_tooltip:true hide_legend:true %}
129
+ {% line_chart value:average_value title:'Cache Objects' metric:'System/Memcached/all/curr_items' simple_tooltip:true hide_legend:true %}
130
130
  </div>
131
131
  <br style="clear: both" />
132
132
  </div>
@@ -23,6 +23,7 @@ module NewRelic::IA
23
23
  # Run the command line args. Return nil if running
24
24
  # or an exit status if not.
25
25
  def execute(stdout, arguments=[])
26
+ log.level = Logger::INFO
26
27
  @aspects = []
27
28
  parser = OptionParser.new do |opts|
28
29
  opts.banner = <<-BANNER.gsub(/^ */,'')
@@ -42,8 +43,8 @@ module NewRelic::IA
42
43
  "quiet output") { NewRelic::IA::CLI.log.level = Logger::ERROR }
43
44
  opts.on("-e", "--environment=ENV",
44
45
  "use ENV section in newrelic.yml") { |e| @env = e }
45
- opts.on("--install",
46
- "create a default newrelic.yml") { |e| return self.install(stdout) }
46
+ opts.on("--install license_key",
47
+ "create a default newrelic.yml") { |key| return self.install(key, stdout) }
47
48
 
48
49
  opts.on("-h", "--help",
49
50
  "Show this help message.") { stdout.puts "#{opts}\n"; return 0 }
@@ -128,7 +129,7 @@ module NewRelic::IA
128
129
  end
129
130
  end
130
131
 
131
- def self.install stdout
132
+ def self.install license_key, stdout
132
133
  require_newrelic_rpm
133
134
  if NewRelic::VersionNumber.new(NewRelic::VERSION::STRING) < '2.12'
134
135
  if File.exists? "newrelic.yml"
@@ -145,7 +146,9 @@ module NewRelic::IA
145
146
  require 'new_relic/command'
146
147
  cmd = NewRelic::Command::Install.new \
147
148
  :src_file => File.join(File.dirname(__FILE__), "newrelic.yml"),
148
- :generated_for_user => "Generated on #{Time.now.strftime('%b %d, %Y')}, from version #{NewRelic::IA::VERSION}"
149
+ :generated_for_user => "Generated on #{Time.now.strftime('%b %d, %Y')}, from version #{NewRelic::IA::VERSION}",
150
+ :app_name => 'System Monitor',
151
+ :license_key => license_key
149
152
  cmd.run
150
153
  0 # normal
151
154
  rescue NewRelic::Command::CommandFailure => e
@@ -1,5 +1,5 @@
1
1
  module NewRelic
2
2
  module IA
3
- VERSION = '0.2.1'
3
+ VERSION = '0.2.2'
4
4
  end
5
5
  end
@@ -3,9 +3,11 @@ require 'new_relic/ia/cli'
3
3
  require 'new_relic/ia/iostat_reader'
4
4
  require 'new_relic/ia/disk_sampler'
5
5
  require 'new_relic/ia/memcached_sampler'
6
+
6
7
  describe NewRelic::IA::CLI, "execute" do
7
8
  before(:each) do
8
9
  @stdout_io = StringIO.new
10
+ NewRelic::Agent::Agent.any_instance.stubs(:connected?).returns(true)
9
11
  end
10
12
  it "should print help" do
11
13
  NewRelic::IA::CLI.execute(@stdout_io, [ "-h"])
@@ -30,6 +32,7 @@ describe NewRelic::IA::CLI, "execute" do
30
32
  end
31
33
  it "should start memcached" do
32
34
  NewRelic::Agent::StatsEngine.any_instance.expects(:add_harvest_sampler)
35
+ NewRelic::IA::MemcachedSampler.any_instance.stubs(:check)
33
36
  stat = NewRelic::IA::CLI.execute(@stdout_io, [ "memcached"])
34
37
  stat.should == nil
35
38
  end
@@ -38,4 +41,7 @@ describe NewRelic::IA::CLI, "execute" do
38
41
  stat.should == nil
39
42
  NewRelic::Control.instance.env.should == "production"
40
43
  end
41
- end
44
+ it "should install a newrelic.yml" do
45
+ NewRelic::IA::CLI.execute(@stdout_io, ["--install", "01234567"])
46
+ end
47
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- version: 0.2.1
8
+ - 2
9
+ version: 0.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Bill Kayser
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-12 00:00:00 -07:00
17
+ date: 2010-04-14 00:00:00 -07:00
18
18
  default_executable: newrelic_ia
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency