instrumental_tools 0.5.3 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.5.4 [March 19th, 2013]
2
+ * Reduce polling frequency of instrument_server to every minute
3
+ * Remove gitstrumental
4
+
1
5
  ### 0.5.3 [November 5th, 2012]
2
6
  * Upgraded instrumental_agent gem to the latest version
3
7
 
data/README.md CHANGED
@@ -67,15 +67,6 @@ namespaces[:instrumental].tasks[:restart_instrument_server].options[:roles] = [:
67
67
 
68
68
  Mac OS users: Due to a bug in Ruby, instrument_server can occasionally deadlock ([bug report](http://bugs.ruby-lang.org/issues/5811)).
69
69
 
70
- ## gitstrumental
71
-
72
- Collect commit counts from git repositories:
73
-
74
- ```sh
75
- cd project_directory
76
- gitstrumental <API_KEY>
77
- ```
78
-
79
70
  ## Troubleshooting & Help
80
71
 
81
72
  We are here to help. Email us at [support@instrumentalapp.com](mailto:support@instrumentalapp.com), or visit the [Instrumental Support](https://fastestforward.campfirenow.com/6b934) Campfire room.
@@ -350,7 +350,9 @@ class ServerController < Pidly::Control
350
350
  agent = Instrumental::Agent.new(options[:api_key], :collector => [options[:collector], options[:port]].compact.join(':'))
351
351
  puts "Collecting stats under the hostname: #{options[:hostname]}"
352
352
  loop do
353
- sleep 10
353
+ t = Time.now.to_i
354
+ next_minute = (t - t % 60) + 60
355
+ sleep [next_minute - t, 0].max
354
356
  inspector = SystemInspector.new
355
357
  inspector.load_all
356
358
  inspector.gauges.each do |stat, value|
@@ -1,5 +1,5 @@
1
1
  module Instrumental
2
2
  module Tools
3
- VERSION = '0.5.3'
3
+ VERSION = '0.5.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instrumental_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2012-11-05 00:00:00.000000000 Z
15
+ date: 2013-03-19 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: json
@@ -83,7 +83,6 @@ description: A collection of scripts useful for monitoring servers and services
83
83
  email:
84
84
  - support@instrumentalapp.com
85
85
  executables:
86
- - gitstrumental
87
86
  - instrument_server
88
87
  extensions: []
89
88
  extra_rdoc_files: []
@@ -94,7 +93,6 @@ files:
94
93
  - LICENSE
95
94
  - README.md
96
95
  - Rakefile
97
- - bin/gitstrumental
98
96
  - bin/instrument_server
99
97
  - instrumental_tools.gemspec
100
98
  - lib/instrumental_tools/capistrano.rb
@@ -113,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
111
  version: '0'
114
112
  segments:
115
113
  - 0
116
- hash: 2651139794055813555
114
+ hash: -1025724807193847442
117
115
  required_rubygems_version: !ruby/object:Gem::Requirement
118
116
  none: false
119
117
  requirements:
@@ -122,10 +120,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
120
  version: '0'
123
121
  segments:
124
122
  - 0
125
- hash: 2651139794055813555
123
+ hash: -1025724807193847442
126
124
  requirements: []
127
125
  rubyforge_project:
128
- rubygems_version: 1.8.24
126
+ rubygems_version: 1.8.23
129
127
  signing_key:
130
128
  specification_version: 3
131
129
  summary: Command line tools for Instrumental
data/bin/gitstrumental DELETED
@@ -1,50 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'rubygems'
3
- gem 'instrumental_agent'
4
- require 'instrumental_agent'
5
-
6
- token = ENV["INSTRUMENTAL_TOKEN"] || ARGV[0]
7
-
8
- if !token
9
- puts 'Usage: gitstrumental API_KEY'
10
- exit 1
11
- end
12
-
13
- lines = `git log --format="REC %at %h '%cn'" --numstat`.chomp.split(/\n+/).reject(&:empty?)
14
- branch = File.basename(`git symbolic-ref HEAD`.chomp).gsub(/[^a-z0-9]/i, "_")
15
- if fetch_url = `git remote show origin`.chomp.split(/\n+/).grep(/Fetch URL:/).first
16
- repo = File.basename(fetch_url.split("/").last, ".git")
17
- else
18
- repo = File.basename(Dir.pwd, ".git")
19
- end
20
- prolog = [repo, branch].join(".")
21
- I = Instrumental::Agent.new(token)
22
- curstat = {}
23
- lines.each do |line|
24
- if line =~ /^REC/
25
- if !curstat.empty?
26
- name, ts, changes = curstat[:name], curstat[:timestamp], curstat[:changes]
27
- I.increment("git.#{prolog}.commits.#{name}", 1, ts)
28
-
29
- adds, deletes = changes.reduce do |prev, pair|
30
- [prev[0] + pair[0], prev[1] + pair[1]]
31
- end
32
- I.increment("git.#{prolog}.commits.#{name}.add", adds, ts)
33
- I.increment("git.#{prolog}.commits.#{name}.delete", deletes, ts)
34
- I.increment("git.#{prolog}.num_commits", 1, ts)
35
- end
36
- rec, ts, hash, *name_parts = line.split(" ")
37
- name = name_parts.join(" ").gsub(/^'([^']+)'$/, "\\1").gsub(/[^a-z0-9]/i, "_")
38
- curstat = {
39
- :name => name,
40
- :timestamp => ts.to_i,
41
- :hash => hash,
42
- :changes => []
43
- }
44
- else
45
- adds, deletes, file = line.split(/\s+/)
46
- curstat[:changes] << [
47
- adds.to_i, deletes.to_i
48
- ]
49
- end
50
- end