Class: GraphQL::Metrics::TimedResult
- Inherits:
-
Object
- Object
- GraphQL::Metrics::TimedResult
- Defined in:
- lib/graphql/metrics.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
readonly
NOTE: ‘time_since_offset` is used to produce start times timed phases of execution (validation, field resolution).
-
#result ⇒ Object
readonly
NOTE: ‘time_since_offset` is used to produce start times timed phases of execution (validation, field resolution).
-
#start_time ⇒ Object
readonly
NOTE: ‘time_since_offset` is used to produce start times timed phases of execution (validation, field resolution).
-
#time_since_offset ⇒ Object
readonly
NOTE: ‘time_since_offset` is used to produce start times timed phases of execution (validation, field resolution).
Instance Method Summary collapse
-
#initialize(start_time, duration, time_since_offset, result) ⇒ TimedResult
constructor
A new instance of TimedResult.
Constructor Details
#initialize(start_time, duration, time_since_offset, result) ⇒ TimedResult
Returns a new instance of TimedResult.
82 83 84 85 86 87 |
# File 'lib/graphql/metrics.rb', line 82 def initialize(start_time, duration, time_since_offset, result) @start_time = start_time @duration = duration @time_since_offset = time_since_offset @result = result end |
Instance Attribute Details
#duration ⇒ Object (readonly)
NOTE: ‘time_since_offset` is used to produce start times timed phases of execution (validation, field resolution). These start times are relative to the executed operation’s start time, which is captured at the outset of document parsing.
The times produced are intentionally similar to: github.com/apollographql/apollo-tracing#response-format
Taking a field resolver start offset example:
< start offset > |——————|———-|———> OS (t=0) FS (t=1) FE (t=2)
OS = Operation start time FS = Field resolver start time FE = Field resolver end time
80 81 82 |
# File 'lib/graphql/metrics.rb', line 80 def duration @duration end |
#result ⇒ Object (readonly)
NOTE: ‘time_since_offset` is used to produce start times timed phases of execution (validation, field resolution). These start times are relative to the executed operation’s start time, which is captured at the outset of document parsing.
The times produced are intentionally similar to: github.com/apollographql/apollo-tracing#response-format
Taking a field resolver start offset example:
< start offset > |——————|———-|———> OS (t=0) FS (t=1) FE (t=2)
OS = Operation start time FS = Field resolver start time FE = Field resolver end time
80 81 82 |
# File 'lib/graphql/metrics.rb', line 80 def result @result end |
#start_time ⇒ Object (readonly)
NOTE: ‘time_since_offset` is used to produce start times timed phases of execution (validation, field resolution). These start times are relative to the executed operation’s start time, which is captured at the outset of document parsing.
The times produced are intentionally similar to: github.com/apollographql/apollo-tracing#response-format
Taking a field resolver start offset example:
< start offset > |——————|———-|———> OS (t=0) FS (t=1) FE (t=2)
OS = Operation start time FS = Field resolver start time FE = Field resolver end time
80 81 82 |
# File 'lib/graphql/metrics.rb', line 80 def start_time @start_time end |
#time_since_offset ⇒ Object (readonly)
NOTE: ‘time_since_offset` is used to produce start times timed phases of execution (validation, field resolution). These start times are relative to the executed operation’s start time, which is captured at the outset of document parsing.
The times produced are intentionally similar to: github.com/apollographql/apollo-tracing#response-format
Taking a field resolver start offset example:
< start offset > |——————|———-|———> OS (t=0) FS (t=1) FE (t=2)
OS = Operation start time FS = Field resolver start time FE = Field resolver end time
80 81 82 |
# File 'lib/graphql/metrics.rb', line 80 def time_since_offset @time_since_offset end |