Class: Google::Cloud::Firestore::AggregateQueryExplainResult
- Inherits:
-
Object
- Object
- Google::Cloud::Firestore::AggregateQueryExplainResult
- Defined in:
- lib/google/cloud/firestore/aggregate_query_explain_result.rb
Overview
AggregateQueryExplainResult
Represents the result of a Firestore aggregate query explanation.
This class provides access to the
V1::ExplainMetrics, which contain details
about the query plan and execution statistics. If the explanation was
run with analyze: true, it also provides access to the
AggregateQuerySnapshot.
The metrics and snapshot (if applicable) are fetched and cached upon the first call to either #explain_metrics or #snapshot.
Instance Attribute Summary collapse
-
#metrics_fetched ⇒ Boolean
(also: #metrics_fetched?)
readonly
Indicates whether the metrics and snapshot (if applicable) have been fetched from the server response and cached.
Instance Method Summary collapse
-
#explain_metrics ⇒ Google::Cloud::Firestore::V1::ExplainMetrics?
The metrics from planning and potentially execution stages of the aggregate query.
-
#snapshot ⇒ AggregateQuerySnapshot?
The AggregateQuerySnapshot containing the aggregation results.
Instance Attribute Details
#metrics_fetched ⇒ Boolean (readonly) Also known as: metrics_fetched?
Indicates whether the metrics and snapshot (if applicable) have been
fetched from the server response and cached.
This becomes true after the first call to #explain_metrics or
#snapshot.
75 76 77 |
# File 'lib/google/cloud/firestore/aggregate_query_explain_result.rb', line 75 def metrics_fetched @metrics_fetched end |
Instance Method Details
#explain_metrics ⇒ Google::Cloud::Firestore::V1::ExplainMetrics?
The metrics from planning and potentially execution stages of the aggregate query.
Calling this method for the first time will process the server
responses to extract and cache the metrics (and snapshot if
analyze: true was used). Subsequent calls return the cached metrics.
103 104 105 106 |
# File 'lib/google/cloud/firestore/aggregate_query_explain_result.rb', line 103 def explain_metrics ensure_fetched! @explain_metrics end |
#snapshot ⇒ AggregateQuerySnapshot?
The Google::Cloud::Firestore::AggregateQuerySnapshot containing the aggregation results.
This is only available if the explanation was run with analyze: true.
If analyze: false was used, or if the query yielded no results
even with analyze: true, this method returns nil.
Calling this method for the first time will process the server responses to extract and cache the snapshot (and metrics). Subsequent calls return the cached snapshot.
122 123 124 125 |
# File 'lib/google/cloud/firestore/aggregate_query_explain_result.rb', line 122 def snapshot ensure_fetched! @snapshot end |