Class: AppProfiler::Backend::BaseBackend
- Inherits:
-
Object
- Object
- AppProfiler::Backend::BaseBackend
show all
- Defined in:
- lib/app_profiler/backend/base_backend.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.name ⇒ Object
50
51
52
|
# File 'lib/app_profiler/backend/base_backend.rb', line 50
def name
raise NotImplementedError
end
|
.run_lock ⇒ Object
46
47
48
|
# File 'lib/app_profiler/backend/base_backend.rb', line 46
def run_lock
@run_lock ||= Mutex.new
end
|
Instance Method Details
#results ⇒ Object
37
38
39
|
# File 'lib/app_profiler/backend/base_backend.rb', line 37
def results
raise NotImplementedError
end
|
#run(params = {}) ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/app_profiler/backend/base_backend.rb', line 6
def run(params = {})
started = start(params)
start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
yield
return unless started
duration = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start_time
stop
results_data = results
if results_data
results_data.metadata[:duration] = duration
end
results_data
ensure
stop if started
end
|
#running? ⇒ Boolean
41
42
43
|
# File 'lib/app_profiler/backend/base_backend.rb', line 41
def running?
raise NotImplementedError
end
|
#start(params = {}) ⇒ Object
29
30
31
|
# File 'lib/app_profiler/backend/base_backend.rb', line 29
def start(params = {})
raise NotImplementedError
end
|
#stop ⇒ Object
33
34
35
|
# File 'lib/app_profiler/backend/base_backend.rb', line 33
def stop
raise NotImplementedError
end
|