active-profiling 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile +8 -0
- data/README.rdoc +13 -8
- data/Rakefile +1 -12
- data/active-profiling.gemspec +0 -2
- data/lib/active-profiling/log_subscriber.rb +2 -1
- data/lib/active-profiling/ruby_profiler.rb +2 -1
- data/lib/active-profiling/version.rb +1 -1
- metadata +7 -39
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
@@ -90,19 +90,24 @@ ignore it with your SCM.
|
|
90
90
|
In +application_local.rb+, you can set up additional application settings
|
91
91
|
like so:
|
92
92
|
|
93
|
+
# You can now flip this line on and off to enable or disable
|
94
|
+
# ActiveProfiling.
|
93
95
|
Bundler.require(:profiling, Rails.env) if defined?(Bundler)
|
94
96
|
|
95
97
|
module FooBarApp
|
96
98
|
class Application < Rails::Application
|
97
99
|
# config.log_level = :debug
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
100
|
+
|
101
|
+
if defined?(ActiveProfiling)
|
102
|
+
config.active_profiling.profiler.enabled = false
|
103
|
+
config.active_profiling.profiler.output = :file
|
104
|
+
config.active_profiling.profiler.printer = :graph_html
|
105
|
+
config.active_profiling.profiler.printer_options = {
|
106
|
+
:min_percent => 1,
|
107
|
+
:print_file => true
|
108
|
+
}
|
109
|
+
config.active_profiling.gc_statistics.enabled = true
|
110
|
+
end
|
106
111
|
|
107
112
|
# etc...
|
108
113
|
end
|
data/Rakefile
CHANGED
@@ -2,23 +2,12 @@
|
|
2
2
|
# -*- ruby -*-
|
3
3
|
|
4
4
|
require 'rubygems'
|
5
|
-
|
6
|
-
gem 'rdoc', '~> 3.12'
|
7
|
-
|
8
5
|
require 'rubygems/package_task'
|
9
6
|
require 'rake/testtask'
|
10
7
|
require 'rdoc/task'
|
11
8
|
require 'bundler/gem_tasks'
|
12
9
|
|
13
|
-
|
14
|
-
begin
|
15
|
-
gem 'psych'
|
16
|
-
rescue Exception => e
|
17
|
-
# it's okay, fall back on the bundled psych
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
$:.push 'lib'
|
10
|
+
$:.push File.expand_path(File.dirname(__FILE__), 'lib')
|
22
11
|
|
23
12
|
version = ActiveProfiling::VERSION
|
24
13
|
|
data/active-profiling.gemspec
CHANGED
@@ -6,10 +6,11 @@ module ActiveProfiling
|
|
6
6
|
logger.send("#{config.profiler.log_level}?")
|
7
7
|
|
8
8
|
report = self.indent(event.payload[:profiler_output])
|
9
|
+
title = event.payload[:title]
|
9
10
|
|
10
11
|
logger.send(
|
11
12
|
config.profiler.log_level,
|
12
|
-
"#{color("Profiler Output", YELLOW, true)}\n#{report}"
|
13
|
+
"#{color("Profiler Output: #{title}", YELLOW, true)}\n#{report}"
|
13
14
|
)
|
14
15
|
end
|
15
16
|
|
@@ -49,7 +49,8 @@ module ActiveProfiling
|
|
49
49
|
str.rewind
|
50
50
|
|
51
51
|
ActiveSupport::Notifications.instrument('profiler_output.active_profiling', {
|
52
|
-
:profiler_output => str.read
|
52
|
+
:profiler_output => str.read,
|
53
|
+
:title => options[:title] || args.first
|
53
54
|
})
|
54
55
|
when :file
|
55
56
|
path, file_name = if args.first
|
metadata
CHANGED
@@ -1,64 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-profiling
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1
|
5
4
|
prerelease:
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- J Smith
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name: rails
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '3.0'
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
15
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
16
|
requirements:
|
27
17
|
- - ! '>='
|
28
18
|
- !ruby/object:Gem::Version
|
29
19
|
version: '3.0'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: rdoc
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
20
|
none: false
|
34
|
-
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
21
|
+
name: rails
|
38
22
|
type: :runtime
|
39
23
|
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: rake
|
48
24
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
25
|
requirements:
|
51
|
-
- -
|
26
|
+
- - ! '>='
|
52
27
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0
|
54
|
-
type: :runtime
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
version: '3.0'
|
57
29
|
none: false
|
58
|
-
requirements:
|
59
|
-
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0.9'
|
62
30
|
description: A Rails profiling suite.
|
63
31
|
email: dark.panda@gmail.com
|
64
32
|
executables: []
|
@@ -86,17 +54,17 @@ rdoc_options: []
|
|
86
54
|
require_paths:
|
87
55
|
- lib
|
88
56
|
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
57
|
requirements:
|
91
58
|
- - ! '>='
|
92
59
|
- !ruby/object:Gem::Version
|
93
60
|
version: '0'
|
94
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
61
|
none: false
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
63
|
requirements:
|
97
64
|
- - ! '>='
|
98
65
|
- !ruby/object:Gem::Version
|
99
66
|
version: '0'
|
67
|
+
none: false
|
100
68
|
requirements: []
|
101
69
|
rubyforge_project:
|
102
70
|
rubygems_version: 1.8.23
|