Class: StaticTracing::Tracepoints
- Inherits:
-
Object
- Object
- StaticTracing::Tracepoints
show all
- Defined in:
- lib/ruby-static-tracing/tracepoints.rb
Overview
FIXME: - why do we need this class? We should store tracepoints on providers, and get the list of all tracepoints from the list of providers
Defined Under Namespace
Classes: ProviderMissingError, TracepointMissingError
Class Method Summary
collapse
Class Method Details
.add(provider, name, data_types) ⇒ Object
11
12
13
14
15
|
# File 'lib/ruby-static-tracing/tracepoints.rb', line 11
def add(provider, name, data_types)
tracepoints[provider][name.to_s] ||= begin
StaticTracing::Tracepoint.new(provider, name.to_s, *data_types)
end
end
|
.clean ⇒ Object
23
24
25
|
# File 'lib/ruby-static-tracing/tracepoints.rb', line 23
def clean
@tracepoints ||= Hash.new { |hash, key| hash[key] = {} }
end
|
.get(provider, name) ⇒ Object
17
18
19
20
21
|
# File 'lib/ruby-static-tracing/tracepoints.rb', line 17
def get(provider, name)
tracepoints
.fetch(provider) { raise_error(ProviderMissingError) }
.fetch(name) { raise_error(TracepointMissingError) }
end
|