Couchbase C++ SDK 1.0.2 (rev. 51f4775)
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 <string>
28#include <vector>
29
30namespace couchbase
31{
32
40{
41public:
47
53 std::string client_context_id,
55 std::vector<analytics_warning> warnings,
57 std::optional<codec::binary> signature)
58 : request_id_{ std::move(request_id) }
59 , client_context_id_{ std::move(client_context_id) }
60 , status_{ status }
61 , warnings_{ std::move(warnings) }
62 , metrics_{ std::move(metrics) }
63 , signature_{ std::move(signature) }
64 {
65 }
66
75 [[nodiscard]] auto request_id() const -> const std::string&
76 {
77 return request_id_;
78 }
79
88 [[nodiscard]] auto client_context_id() const -> const std::string&
89 {
90 return client_context_id_;
91 }
92
101 [[nodiscard]] auto status() const -> analytics_status
102 {
103 return status_;
104 }
105
116 [[nodiscard]] auto warnings() const -> const std::vector<analytics_warning>&
117 {
118 return warnings_;
119 }
120
129 [[nodiscard]] auto metrics() const -> const analytics_metrics&
130 {
131 return metrics_;
132 }
133
142 [[nodiscard]] auto signature() const -> const std::optional<codec::binary>&
143 {
144 return signature_;
145 }
146
147private:
148 std::string request_id_{};
149 std::string client_context_id_{};
150 analytics_status status_{};
151 std::vector<analytics_warning> warnings_{};
152 analytics_metrics metrics_{};
153 std::optional<codec::binary> signature_{};
154};
155
156} // namespace couchbase
Stores any non-rows results related to the execution of a particular Analytics query.
Definition analytics_meta_data.hxx:40
auto status() const -> analytics_status
Returns the raw query execution status as returned by the query engine.
Definition analytics_meta_data.hxx:101
auto metrics() const -> const analytics_metrics &
Returns the analytics_metrics as returned by the analytics engine if enabled.
Definition analytics_meta_data.hxx:129
auto signature() const -> const std::optional< codec::binary > &
Returns the signature as returned by the analytics engine.
Definition analytics_meta_data.hxx:142
auto client_context_id() const -> const std::string &
Returns the client context identifier string set on the query request.
Definition analytics_meta_data.hxx:88
auto warnings() const -> const std::vector< analytics_warning > &
Returns any warnings returned by the analytics engine.
Definition analytics_meta_data.hxx:116
auto request_id() const -> const std::string &
Returns the request identifier string of the query request.
Definition analytics_meta_data.hxx:75
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:52
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