Class: Crawlscope::ServerTiming
- Inherits:
-
Object
- Object
- Crawlscope::ServerTiming
show all
- Includes:
- Enumerable
- Defined in:
- lib/crawlscope/server_timing.rb,
lib/crawlscope/server_timing/summary.rb,
lib/crawlscope/server_timing/reporter.rb
Defined Under Namespace
Classes: Metric, Reporter, Summary
Constant Summary
collapse
- TOKEN =
/\A[!#$%&'*+\-.^_`|~0-9A-Za-z]+\z/
- NUMBER =
/\A-?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:[eE][+-]?\d+)?\z/
- QUOTED_STRING =
/\A"(?:[^"\\\x00-\x1F]|\\[\t\x20-\x7E])*"\z/
- EMPTY_LIST_MEMBER =
/\A[ \t]*\z/
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ServerTiming.
20
21
22
23
24
|
# File 'lib/crawlscope/server_timing.rb', line 20
def initialize()
@header =
@invalid_count = 0
@metrics = parse.freeze
end
|
Instance Attribute Details
#invalid_count ⇒ Object
Returns the value of attribute invalid_count.
18
19
20
|
# File 'lib/crawlscope/server_timing.rb', line 18
def invalid_count
@invalid_count
end
|
Instance Method Details
#each(&block) ⇒ Object
26
27
28
|
# File 'lib/crawlscope/server_timing.rb', line 26
def each(&block)
@metrics.each(&block)
end
|
#empty? ⇒ Boolean
30
31
32
|
# File 'lib/crawlscope/server_timing.rb', line 30
def empty?
@metrics.empty?
end
|
#present? ⇒ Boolean
34
35
36
|
# File 'lib/crawlscope/server_timing.rb', line 34
def present?
!@header.nil?
end
|
#size ⇒ Object
38
39
40
|
# File 'lib/crawlscope/server_timing.rb', line 38
def size
@metrics.size
end
|