Module: SpeedGun
- Defined in:
- lib/speed_gun.rb,
lib/speed_gun/version.rb
Defined Under Namespace
Modules: Store
Classes: App, Browser, Config, Hook, Middleware, Profiler, Railtie, Template
Constant Summary
collapse
- VERSION =
'0.0.4'
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.config ⇒ Object
16
17
18
|
# File 'lib/speed_gun.rb', line 16
def self.config
@config ||= SpeedGun::Config.new
end
|
Class Method Details
.activate! ⇒ Object
24
25
26
|
# File 'lib/speed_gun.rb', line 24
def self.activate!
current && current.activate!
end
|
.active? ⇒ Boolean
20
21
22
|
# File 'lib/speed_gun.rb', line 20
def self.active?
current && current.active?
end
|
.current ⇒ Object
8
9
10
|
# File 'lib/speed_gun.rb', line 8
def self.current
Thread.current[:speed_gun_current]
end
|
.current=(profiler) ⇒ Object
12
13
14
|
# File 'lib/speed_gun.rb', line 12
def self.current=(profiler)
Thread.current[:speed_gun_current] = profiler
end
|
.deactivate! ⇒ Object
28
29
30
|
# File 'lib/speed_gun.rb', line 28
def self.deactivate!
current && current.deactivate!
end
|
.enable? ⇒ Boolean
32
33
34
|
# File 'lib/speed_gun.rb', line 32
def self.enable?
config.enable?
end
|
.profile(title, *args, &block) ⇒ Object
40
41
42
43
44
45
46
|
# File 'lib/speed_gun.rb', line 40
def self.profile(title, *args, &block)
if title.kind_of?(String)
current && current.profile(:manual, title, &block)
else
current && current.profile(title, *args, &block)
end
end
|
.store ⇒ Object
36
37
38
|
# File 'lib/speed_gun.rb', line 36
def self.store
config.store
end
|