Couchbase C++ SDK
1.4.0 (rev. 59aa900)
Toggle main menu visibility
Loading...
Searching...
No Matches
search_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
23
namespace
couchbase
24
{
25
32
class
search_metrics
33
{
34
public
:
39
search_metrics
() =
default
;
40
45
search_metrics
(std::chrono::nanoseconds
took
,
46
std::uint64_t
total_rows
,
47
std::uint64_t
success_partition_count
,
48
std::uint64_t
error_partition_count
,
49
std::uint64_t
total_partition_count
,
50
double
max_score
)
51
: took_{
took
}
52
, total_rows_{
total_rows
}
53
, success_partition_count_{
success_partition_count
}
54
, error_partition_count_{
error_partition_count
}
55
, total_partition_count_{
total_partition_count
}
56
, max_score_{
max_score
}
57
{
58
}
59
69
[[nodiscard]]
auto
took
() const -> std::chrono::nanoseconds
70
{
71
return
took_;
72
}
73
78
[[nodiscard]]
auto
total_rows
() const -> std::uint64_t
79
{
80
return
total_rows_;
81
}
82
87
[[nodiscard]]
auto
success_partition_count
() const -> std::uint64_t
88
{
89
return
success_partition_count_;
90
}
91
96
[[nodiscard]]
auto
error_partition_count
() const -> std::uint64_t
97
{
98
return
error_partition_count_;
99
}
100
105
[[nodiscard]]
auto
total_partition_count
() const -> std::uint64_t
106
{
107
return
total_partition_count_;
108
}
109
114
[[nodiscard]]
auto
max_score
() const ->
double
115
{
116
return
max_score_;
117
}
118
119
private
:
120
std::chrono::nanoseconds took_{};
121
std::uint64_t total_rows_{};
122
std::uint64_t success_partition_count_{};
123
std::uint64_t error_partition_count_{};
124
std::uint64_t total_partition_count_{};
125
double
max_score_{};
126
};
127
128
}
// namespace couchbase
couchbase::search_metrics::search_metrics
search_metrics(std::chrono::nanoseconds took, std::uint64_t total_rows, std::uint64_t success_partition_count, std::uint64_t error_partition_count, std::uint64_t total_partition_count, double max_score)
Definition
search_metrics.hxx:45
couchbase::search_metrics::success_partition_count
auto success_partition_count() const -> std::uint64_t
Definition
search_metrics.hxx:87
couchbase::search_metrics::total_rows
auto total_rows() const -> std::uint64_t
Definition
search_metrics.hxx:78
couchbase::search_metrics::search_metrics
search_metrics()=default
couchbase::search_metrics::took
auto took() 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
search_metrics.hxx:69
couchbase::search_metrics::max_score
auto max_score() const -> double
Definition
search_metrics.hxx:114
couchbase::search_metrics::error_partition_count
auto error_partition_count() const -> std::uint64_t
Definition
search_metrics.hxx:96
couchbase::search_metrics::total_partition_count
auto total_partition_count() const -> std::uint64_t
Definition
search_metrics.hxx:105
couchbase
Represents a single item from the result of scan().
Definition
allow_querying_search_index_options.hxx:28
couchbase
search_metrics.hxx
Generated by
1.17.0