Couchbase C++ SDK 1.0.1 (rev. 58d46d7)
Loading...
Searching...
No Matches
analytics_meta_data.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright 2020-Present Couchbase, Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#pragma once
19
24
25#include <cinttypes>
26#include <optional>
27#include <vector>
28
29namespace couchbase
30{
31
39{
40public:
46
52 std::string client_context_id,
54 std::vector<analytics_warning> warnings,
56 std::optional<codec::binary> signature)
57 : request_id_{ std::move(request_id) }
58 , client_context_id_{ std::move(client_context_id) }
59 , status_{ status }
60 , warnings_{ std::move(warnings) }
61 , metrics_{ std::move(metrics) }
62 , signature_{ std::move(signature) }
63 {
64 }
65
74 [[nodiscard]] auto request_id() const -> const std::string&
75 {
76 return request_id_;
77 }
78
87 [[nodiscard]] auto client_context_id() const -> const std::string&
88 {
89 return client_context_id_;
90 }
91
100 [[nodiscard]] auto status() const -> analytics_status
101 {
102 return status_;
103 }
104
115 [[nodiscard]] auto warnings() const -> const std::vector<analytics_warning>&
116 {
117 return warnings_;
118 }
119
128 [[nodiscard]] auto metrics() const -> const analytics_metrics&
129 {
130 return metrics_;
131 }
132
141 [[nodiscard]] auto signature() const -> const std::optional<codec::binary>&
142 {
143 return signature_;
144 }
145
146private:
147 std::string request_id_{};
148 std::string client_context_id_{};
149 analytics_status status_{};
150 std::vector<analytics_warning> warnings_{};
151 analytics_metrics metrics_{};
152 std::optional<codec::binary> signature_{};
153};
154
155} // namespace couchbase
Stores any non-rows results related to the execution of a particular Analytics query.
Definition analytics_meta_data.hxx:39
auto status() const -> analytics_status
Returns the raw query execution status as returned by the query engine.
Definition analytics_meta_data.hxx:100
auto metrics() const -> const analytics_metrics &
Returns the analytics_metrics as returned by the analytics engine if enabled.
Definition analytics_meta_data.hxx:128
auto signature() const -> const std::optional< codec::binary > &
Returns the signature as returned by the analytics engine.
Definition analytics_meta_data.hxx:141
auto client_context_id() const -> const std::string &
Returns the client context identifier string set on the query request.
Definition analytics_meta_data.hxx:87
auto warnings() const -> const std::vector< analytics_warning > &
Returns any warnings returned by the analytics engine.
Definition analytics_meta_data.hxx:115
auto request_id() const -> const std::string &
Returns the request identifier string of the query request.
Definition analytics_meta_data.hxx:74
analytics_meta_data(std::string request_id, std::string client_context_id, analytics_status status, std::vector< analytics_warning > warnings, analytics_metrics metrics, std::optional< codec::binary > signature)
Definition analytics_meta_data.hxx:51
Analytics Metrics contains the query result metrics containing counts and timings.
Definition analytics_metrics.hxx:33
Represents a single warning returned from the analytics engine.
Definition analytics_warning.hxx:37
Represents a single item from the result of collection::scan()
Definition allow_querying_search_index_options.hxx:28
analytics_status
Status of the Analytics Query.
Definition analytics_status.hxx:28