metrix 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/metrix/cli.rb CHANGED
@@ -38,9 +38,11 @@ module Metrix
38
38
  if File.exists?(pid_path)
39
39
  logger.debug "#{pid_path} exists"
40
40
  puts "STATUS: running with pid #{File.read(pid_path).strip}"
41
+ exit 0
41
42
  else
42
43
  logger.debug "#{pid_path} does not exist"
43
44
  puts "STATUS: not running"
45
+ exit 1
44
46
  end
45
47
  when "stop"
46
48
  abort "not running!" if !running?
@@ -111,7 +113,7 @@ module Metrix
111
113
 
112
114
  if processes?
113
115
  fetch_metrix :processes do
114
- Metrix::Process.all.each do |m|
116
+ Metrix::ProcessMetric.all.each do |m|
115
117
  reporter << m
116
118
  end
117
119
  end
@@ -1,7 +1,7 @@
1
1
  require "metrix/base"
2
2
 
3
3
  module Metrix
4
- class Process < Base
4
+ class ProcessMetric < Base
5
5
  attr_reader :time
6
6
 
7
7
  class << self
@@ -9,7 +9,7 @@ module Metrix
9
9
  Dir.glob("/proc/*").select do |path|
10
10
  File.directory?(path) && File.basename(path)[/^\d+$/]
11
11
  end.map do |path|
12
- Metrix::Process.new(File.read(path + "/stat"))
12
+ Metrix::ProcessMetric.new(File.read(path + "/stat"))
13
13
  end
14
14
  end
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module Metrix
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -3,7 +3,7 @@ require "metrix/graphite"
3
3
 
4
4
  describe "Metrix::Graphite" do
5
5
  let(:data) { FIXTURES_PATH.join("proc.26928.txt").read }
6
- let(:metric) { Metrix::Process.new(data, Time.at(1370091027)) }
6
+ let(:metric) { Metrix::ProcessMetric.new(data, Time.at(1370091027)) }
7
7
  subject(:client) { Metrix::Graphite.new("128.0.0.1") }
8
8
 
9
9
  it { should_not be_nil }
@@ -4,7 +4,7 @@ require "metrix/opentsdb"
4
4
  describe "Metrix::OpenTSDB" do
5
5
  let(:data) { FIXTURES_PATH.join("proc.26928.txt").read }
6
6
  subject(:client) { Metrix::OpenTSDB.new("127.0.0.1", 1234) }
7
- let(:metric) { Metrix::Process.new(data) }
7
+ let(:metric) { Metrix::ProcessMetric.new(data) }
8
8
 
9
9
  it { should_not be_nil }
10
10
 
@@ -1,9 +1,9 @@
1
1
  require "spec_helper"
2
2
  require "metrix/process"
3
3
 
4
- describe "Metrix::Process" do
4
+ describe "Metrix::ProcessMetric" do
5
5
  let(:data) { FIXTURES_PATH.join("proc.26928.txt").read }
6
- subject(:process) { Metrix::Process.new(data) }
6
+ subject(:process) { Metrix::ProcessMetric.new(data) }
7
7
 
8
8
  it { should_not be_nil }
9
9
  it { subject.time.should be_kind_of(Time) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metrix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: