instrumental_agent 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +3 -0
- data/README.md +10 -30
- data/instrumental_agent.gemspec +0 -1
- data/lib/instrumental/agent.rb +20 -4
- data/lib/instrumental/version.rb +1 -1
- metadata +20 -22
- data/ext/mkrf_conf.rb +0 -20
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -10,17 +10,13 @@ Add the gem to your Gemfile.
|
|
10
10
|
gem 'instrumental_agent'
|
11
11
|
```
|
12
12
|
|
13
|
-
Visit [instrumentalapp.com](instrumentalapp.com) and create an account,
|
14
|
-
then initialize the agent with your API key, found in the Docs section.
|
13
|
+
Visit [instrumentalapp.com](instrumentalapp.com) and create an account, then initialize the agent with your API key, found in the Docs section.
|
15
14
|
|
16
15
|
```sh
|
17
16
|
I = Instrumental::Agent.new('YOUR_API_KEY', :enabled => Rails.env.production?)
|
18
17
|
```
|
19
18
|
|
20
|
-
You'll probably want something like the above, only enabling the agent
|
21
|
-
in production mode so you don't have development and produciton data
|
22
|
-
writing to the same value. Or you can setup two projects, so that you
|
23
|
-
can verify stats in one, and release them to production in another.
|
19
|
+
You'll probably want something like the above, only enabling the agent in production mode so you don't have development and produciton data writing to the same value. Or you can setup two projects, so that you can verify stats in one, and release them to production in another.
|
24
20
|
|
25
21
|
Now you can begin to use Instrumental to track your application.
|
26
22
|
|
@@ -37,13 +33,9 @@ I.time_ms('query_time_in_ms') do # prefer milliseconds?
|
|
37
33
|
end
|
38
34
|
```
|
39
35
|
|
40
|
-
**Note**: For your app's safety, the agent is meant to isolate your app
|
41
|
-
from any problems our service might suffer. If it is unable to connect
|
42
|
-
to the service, it will discard data after reaching a low memory
|
43
|
-
threshold.
|
36
|
+
**Note**: For your app's safety, the agent is meant to isolate your app from any problems our service might suffer. If it is unable to connect to the service, it will discard data after reaching a low memory threshold.
|
44
37
|
|
45
|
-
Want to track an event (like an application deploy, or downtime)? You can capture events that
|
46
|
-
are instantaneous, or events that happen over a period of time.
|
38
|
+
Want to track an event (like an application deploy, or downtime)? You can capture events that are instantaneous, or events that happen over a period of time.
|
47
39
|
|
48
40
|
```sh
|
49
41
|
I.notice('Jeffy deployed rev ef3d6a') # instantaneous event
|
@@ -52,18 +44,11 @@ I.notice('Testing socket buffer increase', 3.days.ago, 20.minutes) # an event wi
|
|
52
44
|
|
53
45
|
## Backfilling
|
54
46
|
|
55
|
-
Streaming data is better with a little historical context. Instrumental
|
56
|
-
lets you backfill data, allowing you to see deep into your project's
|
57
|
-
past.
|
47
|
+
Streaming data is better with a little historical context. Instrumental lets you backfill data, allowing you to see deep into your project's past.
|
58
48
|
|
59
|
-
When backfilling, you may send tens of thousands of metrics per
|
60
|
-
second, and the command buffer may start discarding data it isn't able
|
61
|
-
to send fast enough. We provide a synchronous mode that will ensure
|
62
|
-
every stat makes it to Instrumental before continuing on to the next.
|
49
|
+
When backfilling, you may send tens of thousands of metrics per second, and the command buffer may start discarding data it isn't able to send fast enough. We provide a synchronous mode that will ensure every stat makes it to Instrumental before continuing on to the next.
|
63
50
|
|
64
|
-
**Warning**: You should only enable synchronous mode for backfilling
|
65
|
-
data as any issues with the Instrumental service issues will cause this
|
66
|
-
code to halt until it can reconnect.
|
51
|
+
**Warning**: You should only enable synchronous mode for backfilling data as any issues with the Instrumental service issues will cause this code to halt until it can reconnect.
|
67
52
|
|
68
53
|
```sh
|
69
54
|
I.synchronous = true # every command sends immediately
|
@@ -74,9 +59,7 @@ end
|
|
74
59
|
|
75
60
|
## Server Stats
|
76
61
|
|
77
|
-
Want some general server stats (load, memory, etc.)? Check out the
|
78
|
-
[instrumental_tools](https://github.com/fastestforward/instrumental_tools)
|
79
|
-
gem.
|
62
|
+
Want some general server stats (load, memory, etc.)? Check out the [instrumental_tools](https://github.com/fastestforward/instrumental_tools) gem.
|
80
63
|
|
81
64
|
```sh
|
82
65
|
gem install instrumental_tools
|
@@ -85,15 +68,12 @@ instrument_server
|
|
85
68
|
|
86
69
|
## Agent Control
|
87
70
|
|
88
|
-
Need to quickly disable the agent? set :enabled to false on
|
89
|
-
initialization and you don't need to change any application code.
|
71
|
+
Need to quickly disable the agent? set :enabled to false on initialization and you don't need to change any application code.
|
90
72
|
|
91
73
|
|
92
74
|
## Capistrano Integration
|
93
75
|
|
94
|
-
Add `require "instrumental/capistrano"` to your capistrano configuration
|
95
|
-
and your deploys will be tracked by Instrumental. Add the API token for
|
96
|
-
the project you want to track to by setting the following Capistrano var:
|
76
|
+
Add `require "instrumental/capistrano"` to your capistrano configuration and your deploys will be tracked by Instrumental. Add the API token for the project you want to track to by setting the following Capistrano var:
|
97
77
|
|
98
78
|
```ruby
|
99
79
|
set :instrumental_key, "MY_API_KEY"
|
data/instrumental_agent.gemspec
CHANGED
@@ -14,7 +14,6 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
15
15
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
16
16
|
s.require_paths = ["lib"]
|
17
|
-
s.extensions = 'ext/mkrf_conf.rb'
|
18
17
|
s.add_development_dependency(%q<rake>, [">= 0"])
|
19
18
|
s.add_development_dependency(%q<rspec>, ["~> 2.0"])
|
20
19
|
s.add_development_dependency(%q<fuubar>, [">= 0"])
|
data/lib/instrumental/agent.rb
CHANGED
@@ -3,10 +3,27 @@ require 'instrumental/version'
|
|
3
3
|
require 'logger'
|
4
4
|
require 'thread'
|
5
5
|
require 'socket'
|
6
|
-
if RUBY_VERSION < "1.9"
|
7
|
-
|
6
|
+
if RUBY_VERSION < "1.9" && RUBY_PLATFORM != "java"
|
7
|
+
begin
|
8
|
+
gem 'system_timer'
|
9
|
+
require 'system_timer'
|
10
|
+
InstrumentalTimeout = SystemTimer
|
11
|
+
rescue Exception => e
|
12
|
+
puts <<-EOMSG
|
13
|
+
WARNING:: You do not currently have system_timer installed.
|
14
|
+
It is strongly advised that you install this gem when using
|
15
|
+
instrumental_agent with Ruby 1.8.x. You can install it in
|
16
|
+
your Gemfile via:
|
17
|
+
gem 'system_timer'
|
18
|
+
or manually via:
|
19
|
+
gem install system_timer
|
20
|
+
EOMSG
|
21
|
+
require 'timeout'
|
22
|
+
InstrumentalTimeout = Timeout
|
23
|
+
end
|
8
24
|
else
|
9
25
|
require 'timeout'
|
26
|
+
InstrumentalTimeout = Timeout
|
10
27
|
end
|
11
28
|
|
12
29
|
|
@@ -190,8 +207,7 @@ module Instrumental
|
|
190
207
|
private
|
191
208
|
|
192
209
|
def with_timeout(time, &block)
|
193
|
-
|
194
|
-
tmr_klass.timeout(time) { yield }
|
210
|
+
InstrumentalTimeout.timeout(time) { yield }
|
195
211
|
end
|
196
212
|
|
197
213
|
def valid_note?(note)
|
data/lib/instrumental/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: instrumental_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,11 +12,11 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2012-
|
15
|
+
date: 2012-03-06 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rake
|
19
|
-
requirement: &
|
19
|
+
requirement: &70101951414580 !ruby/object:Gem::Requirement
|
20
20
|
none: false
|
21
21
|
requirements:
|
22
22
|
- - ! '>='
|
@@ -24,10 +24,10 @@ dependencies:
|
|
24
24
|
version: '0'
|
25
25
|
type: :development
|
26
26
|
prerelease: false
|
27
|
-
version_requirements: *
|
27
|
+
version_requirements: *70101951414580
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rspec
|
30
|
-
requirement: &
|
30
|
+
requirement: &70101951413720 !ruby/object:Gem::Requirement
|
31
31
|
none: false
|
32
32
|
requirements:
|
33
33
|
- - ~>
|
@@ -35,10 +35,10 @@ dependencies:
|
|
35
35
|
version: '2.0'
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
|
-
version_requirements: *
|
38
|
+
version_requirements: *70101951413720
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: fuubar
|
41
|
-
requirement: &
|
41
|
+
requirement: &70101951429080 !ruby/object:Gem::Requirement
|
42
42
|
none: false
|
43
43
|
requirements:
|
44
44
|
- - ! '>='
|
@@ -46,10 +46,10 @@ dependencies:
|
|
46
46
|
version: '0'
|
47
47
|
type: :development
|
48
48
|
prerelease: false
|
49
|
-
version_requirements: *
|
49
|
+
version_requirements: *70101951429080
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: guard
|
52
|
-
requirement: &
|
52
|
+
requirement: &70101951428440 !ruby/object:Gem::Requirement
|
53
53
|
none: false
|
54
54
|
requirements:
|
55
55
|
- - ! '>='
|
@@ -57,10 +57,10 @@ dependencies:
|
|
57
57
|
version: '0'
|
58
58
|
type: :development
|
59
59
|
prerelease: false
|
60
|
-
version_requirements: *
|
60
|
+
version_requirements: *70101951428440
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: guard-rspec
|
63
|
-
requirement: &
|
63
|
+
requirement: &70101951427760 !ruby/object:Gem::Requirement
|
64
64
|
none: false
|
65
65
|
requirements:
|
66
66
|
- - ! '>='
|
@@ -68,10 +68,10 @@ dependencies:
|
|
68
68
|
version: '0'
|
69
69
|
type: :development
|
70
70
|
prerelease: false
|
71
|
-
version_requirements: *
|
71
|
+
version_requirements: *70101951427760
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
73
|
name: growl
|
74
|
-
requirement: &
|
74
|
+
requirement: &70101951424880 !ruby/object:Gem::Requirement
|
75
75
|
none: false
|
76
76
|
requirements:
|
77
77
|
- - ! '>='
|
@@ -79,10 +79,10 @@ dependencies:
|
|
79
79
|
version: '0'
|
80
80
|
type: :development
|
81
81
|
prerelease: false
|
82
|
-
version_requirements: *
|
82
|
+
version_requirements: *70101951424880
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rb-fsevent
|
85
|
-
requirement: &
|
85
|
+
requirement: &70101951423500 !ruby/object:Gem::Requirement
|
86
86
|
none: false
|
87
87
|
requirements:
|
88
88
|
- - ! '>='
|
@@ -90,13 +90,12 @@ dependencies:
|
|
90
90
|
version: '0'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
|
-
version_requirements: *
|
93
|
+
version_requirements: *70101951423500
|
94
94
|
description: Track anything.
|
95
95
|
email:
|
96
96
|
- support@instrumentalapp.com
|
97
97
|
executables: []
|
98
|
-
extensions:
|
99
|
-
- ext/mkrf_conf.rb
|
98
|
+
extensions: []
|
100
99
|
extra_rdoc_files: []
|
101
100
|
files:
|
102
101
|
- .gitignore
|
@@ -106,7 +105,6 @@ files:
|
|
106
105
|
- Guardfile
|
107
106
|
- README.md
|
108
107
|
- Rakefile
|
109
|
-
- ext/mkrf_conf.rb
|
110
108
|
- instrumental_agent.gemspec
|
111
109
|
- lib/instrumental/agent.rb
|
112
110
|
- lib/instrumental/capistrano.rb
|
@@ -130,7 +128,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
130
128
|
version: '0'
|
131
129
|
segments:
|
132
130
|
- 0
|
133
|
-
hash: -
|
131
|
+
hash: -1711513508284611167
|
134
132
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
133
|
none: false
|
136
134
|
requirements:
|
@@ -139,10 +137,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
137
|
version: '0'
|
140
138
|
segments:
|
141
139
|
- 0
|
142
|
-
hash: -
|
140
|
+
hash: -1711513508284611167
|
143
141
|
requirements: []
|
144
142
|
rubyforge_project:
|
145
|
-
rubygems_version: 1.8.
|
143
|
+
rubygems_version: 1.8.10
|
146
144
|
signing_key:
|
147
145
|
specification_version: 3
|
148
146
|
summary: Agent for reporting data to instrumentalapp.com
|
data/ext/mkrf_conf.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rubygems/command.rb'
|
3
|
-
require 'rubygems/dependency_installer.rb'
|
4
|
-
begin
|
5
|
-
Gem::Command.build_args = ARGV
|
6
|
-
rescue NoMethodError
|
7
|
-
end
|
8
|
-
inst = Gem::DependencyInstaller.new
|
9
|
-
begin
|
10
|
-
if RUBY_VERSION < "1.9"
|
11
|
-
inst.install "system_timer", "~> 1.2"
|
12
|
-
end
|
13
|
-
rescue
|
14
|
-
puts "Couldn't install system_timer gem, required on Ruby < 1.9"
|
15
|
-
exit(1)
|
16
|
-
end
|
17
|
-
|
18
|
-
f = File.open(File.join(File.dirname(__FILE__), "Rakefile"), "w") # create dummy rakefile to indicate success
|
19
|
-
f.write("task :default\n")
|
20
|
-
f.close
|