Couchbase C++ SDK 1.0.2 (rev. 51f4775)
Loading...
Searching...
No Matches
analytics_metrics.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
20#include <chrono>
21#include <cinttypes>
22
23namespace couchbase
24{
25
33{
34public:
39 analytics_metrics() = default;
40
45 analytics_metrics(std::chrono::nanoseconds elapsed_time,
46 std::chrono::nanoseconds execution_time,
47 std::uint64_t result_count,
48 std::uint64_t result_size,
49 std::uint64_t processed_objects,
50 std::uint64_t error_count,
51 std::uint64_t warning_count)
52 : elapsed_time_{ elapsed_time }
53 , execution_time_{ execution_time }
54 , result_count_{ result_count }
55 , result_size_{ result_size }
56 , processed_objects_{ processed_objects }
57 , error_count_{ error_count }
58 , warning_count_{ warning_count }
59 {
60 }
61
71 [[nodiscard]] auto elapsed_time() const -> std::chrono::nanoseconds
72 {
73 return elapsed_time_;
74 }
75
85 [[nodiscard]] auto execution_time() const -> std::chrono::nanoseconds
86 {
87 return execution_time_;
88 }
89
98 [[nodiscard]] auto result_count() const -> std::uint64_t
99 {
100 return result_count_;
101 }
102
111 [[nodiscard]] auto result_size() const -> std::uint64_t
112 {
113 return result_size_;
114 }
115
124 [[nodiscard]] auto processed_objects() const -> std::uint64_t
125 {
126 return processed_objects_;
127 }
128
137 [[nodiscard]] auto error_count() const -> std::uint64_t
138 {
139 return error_count_;
140 }
141
150 [[nodiscard]] auto warning_count() const -> std::uint64_t
151 {
152 return warning_count_;
153 }
154
155private:
156 std::chrono::nanoseconds elapsed_time_{};
157 std::chrono::nanoseconds execution_time_{};
158 std::uint64_t result_count_{};
159 std::uint64_t result_size_{};
160 std::uint64_t processed_objects_{};
161 std::uint64_t error_count_{};
162 std::uint64_t warning_count_{};
163};
164
165} // namespace couchbase
Analytics Metrics contains the query result metrics containing counts and timings.
Definition analytics_metrics.hxx:33
auto result_size() const -> std::uint64_t
The total number of bytes in the results.
Definition analytics_metrics.hxx:111
analytics_metrics(std::chrono::nanoseconds elapsed_time, std::chrono::nanoseconds execution_time, std::uint64_t result_count, std::uint64_t result_size, std::uint64_t processed_objects, std::uint64_t error_count, std::uint64_t warning_count)
Definition analytics_metrics.hxx:45
auto result_count() const -> std::uint64_t
The total number of objects in the results.
Definition analytics_metrics.hxx:98
auto processed_objects() const -> std::uint64_t
The number of processed objects for the request.
Definition analytics_metrics.hxx:124
auto error_count() const -> std::uint64_t
The number of errors that occurred during the request.
Definition analytics_metrics.hxx:137
auto execution_time() const -> std::chrono::nanoseconds
The time taken for the execution of the request, that is the time from when query execution started u...
Definition analytics_metrics.hxx:85
auto elapsed_time() const -> std::chrono::nanoseconds
The total time taken for the request, that is the time from when the request was received until the r...
Definition analytics_metrics.hxx:71
auto warning_count() const -> std::uint64_t
The number of warnings that occurred during the request.
Definition analytics_metrics.hxx:150
Represents a single item from the result of collection::scan()
Definition allow_querying_search_index_options.hxx:28