algolia 3.3.0 → 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/Bug_report.yml +0 -1
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +6 -6
- data/lib/algolia/models/recommend/recommendations_results.rb +11 -0
- data/lib/algolia/models/search/browse_response.rb +11 -0
- data/lib/algolia/models/search/search_response.rb +11 -0
- data/lib/algolia/version.rb +1 -1
- metadata +2 -12
- data/lib/algolia/api/usage_client.rb +0 -349
- data/lib/algolia/models/usage/error_base.rb +0 -212
- data/lib/algolia/models/usage/error_item.rb +0 -240
- data/lib/algolia/models/usage/forbidden_error.rb +0 -231
- data/lib/algolia/models/usage/granularity.rb +0 -32
- data/lib/algolia/models/usage/index_usage.rb +0 -213
- data/lib/algolia/models/usage/invalid_request_error.rb +0 -231
- data/lib/algolia/models/usage/statistic.rb +0 -199
- data/lib/algolia/models/usage/statistic_entry.rb +0 -221
- data/lib/algolia/models/usage/statistic_value.rb +0 -108
@@ -1,349 +0,0 @@
|
|
1
|
-
# Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
2
|
-
|
3
|
-
module Algolia
|
4
|
-
class UsageClient
|
5
|
-
attr_accessor :api_client
|
6
|
-
|
7
|
-
def initialize(config = nil)
|
8
|
-
raise "`config` is missing." if config.nil?
|
9
|
-
raise "`app_id` is missing." if config.app_id.nil? || config.app_id == ""
|
10
|
-
raise "`api_key` is missing." if config.api_key.nil? || config.api_key == ""
|
11
|
-
|
12
|
-
@api_client = Algolia::ApiClient.new(config)
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.create(app_id, api_key, opts = {})
|
16
|
-
hosts = []
|
17
|
-
hosts << Transport::StatefulHost.new("usage.algolia.com", accept: CallType::READ | CallType::WRITE)
|
18
|
-
|
19
|
-
config = Algolia::Configuration.new(app_id, api_key, hosts, "Usage", opts)
|
20
|
-
create_with_config(config)
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.create_with_config(config)
|
24
|
-
new(config)
|
25
|
-
end
|
26
|
-
|
27
|
-
# Helper method to switch the API key used to authenticate the requests.
|
28
|
-
#
|
29
|
-
# @param api_key [String] the new API key to use.
|
30
|
-
# @return [void]
|
31
|
-
def set_client_api_key(api_key)
|
32
|
-
@api_client.set_client_api_key(api_key)
|
33
|
-
end
|
34
|
-
|
35
|
-
# This method allow you to send requests to the Algolia REST API.
|
36
|
-
|
37
|
-
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
38
|
-
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
39
|
-
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
40
|
-
# @return [Http::Response] the response
|
41
|
-
def custom_delete_with_http_info(path, parameters = nil, request_options = {})
|
42
|
-
# verify the required parameter 'path' is set
|
43
|
-
if @api_client.config.client_side_validation && path.nil?
|
44
|
-
raise ArgumentError, "Parameter `path` is required when calling `custom_delete`."
|
45
|
-
end
|
46
|
-
|
47
|
-
path = "/{path}".sub("{" + "path" + "}", path.to_s)
|
48
|
-
query_params = {}
|
49
|
-
query_params = query_params.merge(parameters) unless parameters.nil?
|
50
|
-
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
51
|
-
header_params = {}
|
52
|
-
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
53
|
-
|
54
|
-
post_body = request_options[:debug_body]
|
55
|
-
|
56
|
-
new_options = request_options.merge(
|
57
|
-
:operation => :"UsageClient.custom_delete",
|
58
|
-
:header_params => header_params,
|
59
|
-
:query_params => query_params,
|
60
|
-
:body => post_body,
|
61
|
-
:use_read_transporter => false
|
62
|
-
)
|
63
|
-
|
64
|
-
@api_client.call_api(:DELETE, path, new_options)
|
65
|
-
end
|
66
|
-
|
67
|
-
# This method allow you to send requests to the Algolia REST API.
|
68
|
-
|
69
|
-
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
70
|
-
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
71
|
-
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
72
|
-
# @return [Object]
|
73
|
-
def custom_delete(path, parameters = nil, request_options = {})
|
74
|
-
response = custom_delete_with_http_info(path, parameters, request_options)
|
75
|
-
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
|
76
|
-
end
|
77
|
-
|
78
|
-
# This method allow you to send requests to the Algolia REST API.
|
79
|
-
|
80
|
-
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
81
|
-
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
82
|
-
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
83
|
-
# @return [Http::Response] the response
|
84
|
-
def custom_get_with_http_info(path, parameters = nil, request_options = {})
|
85
|
-
# verify the required parameter 'path' is set
|
86
|
-
if @api_client.config.client_side_validation && path.nil?
|
87
|
-
raise ArgumentError, "Parameter `path` is required when calling `custom_get`."
|
88
|
-
end
|
89
|
-
|
90
|
-
path = "/{path}".sub("{" + "path" + "}", path.to_s)
|
91
|
-
query_params = {}
|
92
|
-
query_params = query_params.merge(parameters) unless parameters.nil?
|
93
|
-
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
94
|
-
header_params = {}
|
95
|
-
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
96
|
-
|
97
|
-
post_body = request_options[:debug_body]
|
98
|
-
|
99
|
-
new_options = request_options.merge(
|
100
|
-
:operation => :"UsageClient.custom_get",
|
101
|
-
:header_params => header_params,
|
102
|
-
:query_params => query_params,
|
103
|
-
:body => post_body,
|
104
|
-
:use_read_transporter => false
|
105
|
-
)
|
106
|
-
|
107
|
-
@api_client.call_api(:GET, path, new_options)
|
108
|
-
end
|
109
|
-
|
110
|
-
# This method allow you to send requests to the Algolia REST API.
|
111
|
-
|
112
|
-
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
113
|
-
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
114
|
-
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
115
|
-
# @return [Object]
|
116
|
-
def custom_get(path, parameters = nil, request_options = {})
|
117
|
-
response = custom_get_with_http_info(path, parameters, request_options)
|
118
|
-
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
|
119
|
-
end
|
120
|
-
|
121
|
-
# This method allow you to send requests to the Algolia REST API.
|
122
|
-
|
123
|
-
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
124
|
-
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
125
|
-
# @param body [Object] Parameters to send with the custom request.
|
126
|
-
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
127
|
-
# @return [Http::Response] the response
|
128
|
-
def custom_post_with_http_info(path, parameters = nil, body = nil, request_options = {})
|
129
|
-
# verify the required parameter 'path' is set
|
130
|
-
if @api_client.config.client_side_validation && path.nil?
|
131
|
-
raise ArgumentError, "Parameter `path` is required when calling `custom_post`."
|
132
|
-
end
|
133
|
-
|
134
|
-
path = "/{path}".sub("{" + "path" + "}", path.to_s)
|
135
|
-
query_params = {}
|
136
|
-
query_params = query_params.merge(parameters) unless parameters.nil?
|
137
|
-
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
138
|
-
header_params = {}
|
139
|
-
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
140
|
-
|
141
|
-
post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)
|
142
|
-
|
143
|
-
new_options = request_options.merge(
|
144
|
-
:operation => :"UsageClient.custom_post",
|
145
|
-
:header_params => header_params,
|
146
|
-
:query_params => query_params,
|
147
|
-
:body => post_body,
|
148
|
-
:use_read_transporter => false
|
149
|
-
)
|
150
|
-
|
151
|
-
@api_client.call_api(:POST, path, new_options)
|
152
|
-
end
|
153
|
-
|
154
|
-
# This method allow you to send requests to the Algolia REST API.
|
155
|
-
|
156
|
-
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
157
|
-
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
158
|
-
# @param body [Object] Parameters to send with the custom request.
|
159
|
-
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
160
|
-
# @return [Object]
|
161
|
-
def custom_post(path, parameters = nil, body = nil, request_options = {})
|
162
|
-
response = custom_post_with_http_info(path, parameters, body, request_options)
|
163
|
-
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
|
164
|
-
end
|
165
|
-
|
166
|
-
# This method allow you to send requests to the Algolia REST API.
|
167
|
-
|
168
|
-
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
169
|
-
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
170
|
-
# @param body [Object] Parameters to send with the custom request.
|
171
|
-
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
172
|
-
# @return [Http::Response] the response
|
173
|
-
def custom_put_with_http_info(path, parameters = nil, body = nil, request_options = {})
|
174
|
-
# verify the required parameter 'path' is set
|
175
|
-
if @api_client.config.client_side_validation && path.nil?
|
176
|
-
raise ArgumentError, "Parameter `path` is required when calling `custom_put`."
|
177
|
-
end
|
178
|
-
|
179
|
-
path = "/{path}".sub("{" + "path" + "}", path.to_s)
|
180
|
-
query_params = {}
|
181
|
-
query_params = query_params.merge(parameters) unless parameters.nil?
|
182
|
-
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
183
|
-
header_params = {}
|
184
|
-
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
185
|
-
|
186
|
-
post_body = request_options[:debug_body] || @api_client.object_to_http_body(body)
|
187
|
-
|
188
|
-
new_options = request_options.merge(
|
189
|
-
:operation => :"UsageClient.custom_put",
|
190
|
-
:header_params => header_params,
|
191
|
-
:query_params => query_params,
|
192
|
-
:body => post_body,
|
193
|
-
:use_read_transporter => false
|
194
|
-
)
|
195
|
-
|
196
|
-
@api_client.call_api(:PUT, path, new_options)
|
197
|
-
end
|
198
|
-
|
199
|
-
# This method allow you to send requests to the Algolia REST API.
|
200
|
-
|
201
|
-
# @param path [String] Path of the endpoint, anything after \"/1\" must be specified. (required)
|
202
|
-
# @param parameters [Hash<String, Object>] Query parameters to apply to the current query.
|
203
|
-
# @param body [Object] Parameters to send with the custom request.
|
204
|
-
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
205
|
-
# @return [Object]
|
206
|
-
def custom_put(path, parameters = nil, body = nil, request_options = {})
|
207
|
-
response = custom_put_with_http_info(path, parameters, body, request_options)
|
208
|
-
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
|
209
|
-
end
|
210
|
-
|
211
|
-
# Retrieves the selected usage statistics for one index.
|
212
|
-
|
213
|
-
# @param statistic [Statistic] Usage statistics to retrieve. Use `*` to retrieve all usage metrics, otherwise add one or more of the following metrics, separated by a comma. **Search operations** - `search_operations`. All search operations. - `total_search_operations`: Sum of all search operations. - `total_search_requests`: Sum of all [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). The number of billed search requests is equal to this value minus `querysuggestions_total_search_requests`. - `queries_operations`. Number of [single index search](/specs/search#tag/Search/operation/searchSingleIndex) operations. - `multi_queries_operations`. Number of [multi-index search](/specs/search#tag/Search/operation/search) operations. **ACL operations** - `acl_operations`. All ACL operations. - `total_acl_operations`. Sum of all ACL operations. - `get_api_keys_operations`. Number of [list API keys](/specs/search#tag/Api-Keys/operation/listApiKeys) operations. - `get_api_key_operations`. Number of [get API key permission](/specs/search#tag/Api-Keys/operation/getApiKey) operations. - `add_api_key_operations`. Number of [create API key](/specs/search#tag/Api-Keys/operation/addApiKey) operations. - `update_api_key_operations`. Number of [update API key](/specs/search#tag/Api-Keys/operation/updateApiKey) operations. - `delete_api_key_operations`. Number of [delete API key](/specs/search#tag/Api-Keys/operation/deleteApiKey) operations. - `list_api_key_operations`. Number of list index API keys operations. **Indexing operations** - `indexing_operations`. All indexing operations. - `total_indexing_operations`. Sum of all indexing operations. - `browse_operations`. Number of [browse index](/specs/search#tag/Search/operation/browse) operations. - `clear_index_operations`. Number of [clear records](/specs/search#tag/Records/operation/clearObjects) operations. - `copy_move_operations`. Number of [copy or move index](/specs/search#tag/Indices/operation/operationIndex) operations. - `delete_index_operations`. Number of [delete index](/specs/search#tag/Indices/operation/deleteIndex) operations. - `get_log_operations`. Number of [get logs](/specs/search#tag/Advanced/operation/getLogs) operations. - `get_settings_operations`. Number of [get settings](/specs/search#operation/getIndexUsage) operations. - `set_settings_operations`. Number of [set settings](/specs/search#tag/Indices/operation/setSettings) operations. - `list_indices_operations`. Number of [list indices](/specs/search#tag/Indices/operation/listIndices) operations. - `wait_task_operations`. Number of [wait](/specs/search#tag/Indices/operation/getTask) operations. **Record operations** - `record_operations`. All record operations. - `total_records_operations`. Sum of all record operations. - `add_record_operations`. Number of [add or replace record](/specs/search#tag/Records/operation/saveObject) operations. - `batch_operations`. Number of [batch indexing](/specs/search#tag/Records/operation/multipleBatch) operations. - `delete_by_query_operations`. Number of [delete by query](/specs/search#tag/Records/operation/deleteBy) operations. - `delete_record_operations`. Number of [delete record](/specs/search#tag/Records/operation/deleteObject) operations. - `get_record_operations`. Number of [get record](/specs/search#tag/Records/operation/getObject) operations. - `partial_update_record_operations`. Number of [partially update records](/specs/search#tag/Records/operation/partialUpdateObject) operations. - `update_record_operations`. Number of [add or replace record by objectID](/specs/search#tag/Records/operation/addOrUpdateObject) operations. **Synonym operations** - `synonym_operations`. All synonym operations. - `total_synonym_operations`. Sum of all synonym operations. - `batch_synonym_operations`. Number of [save all synonyms](/specs/search#tag/Synonyms/operation/saveSynonyms) operations. - `clear_synonym_operations`. Number of [clear synonyms](/specs/search#tag/Synonyms/operation/clearSynonyms) operations. - `delete_synonym_operations`. Number of [delete synonym](/specs/search#tag/Synonyms/operation/deleteSynonym) operations. - `get_synonym_operations`. Number of [get synonym](/specs/search#tag/Synonyms/operation/getSynonym) operations. - `query_synonym_operations`. Number of [search synonyms](/specs/search#tag/Synonyms/operation/searchSynonyms) operations. - `update_synonym_operations`. Number of [save a synonym](/specs/search#tag/Synonyms/operation/saveSynonym) operations. **Rule operations** - `rule_operations`. All rule operations. - `total_rules_operations`. Sum of all rule operations. - `batch_rules_operations`. Number of [batch rules](/specs/search#tag/Rules/operation/saveRules) operations. - `clear_rules_operations`. Number of [delete rule](/specs/search#tag/Rules/operation/deleteRule) operations. - `delete_rules_operations`. Number of [clear rules](/specs/search#tag/Rules/operation/clearRules) operations. - `get_rules_operations`. Number of [get rule](/specs/search#tag/Rules/operation/getRule) operations. - `save_rules_operations`. Number of [save rule](/specs/search#operation/getIndexUsage) operations. - `search_rules_operations`. Number of [search rules](/specs/search#tag/Rules/operation/searchRules) operations. **Total operations** - `total_recommend_requests`. Number of [Recommend requests](https://www.algolia.com/doc/guides/algolia-ai/recommend/) - `total_write_operations`. Number of Write operations - `total_read_operations`. Number of read operations - `total_operations`. Sum of all operations **Total Query Suggestions operations** Query Suggestions operations are a subset of `total_search_operations`. - `querysuggestions_total_search_operations`. Number of Query Suggestions search operations. - `querysuggestions_total_search_requests`. Number of Query Suggestions [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). - `querysuggestions_total_acl_operations`. Sum of all Query Suggestions [ACL operations](#acl-operations). - `querysuggestions_total_indexing_operations`. Number of Query Suggestions [indexing operations](#indexing-operations). - `querysuggestions_total_records_operations`. Number of Query Suggestions [record operations](#record-operations). - `querysuggestions_total_synonym_operations`. Number of Query Suggestions [synonym operations](#synonym-operations). - `querysuggestions_total_rules_operations`. Number of Query Suggestions [Rule operations](#rule-operations). - `querysuggestions_total_write_operations`. Number of Query Suggestions Write operations. - `querysuggestions_total_read_operations`. Number of Query Suggestions Read operations. - `querysuggestions_total_operations`. Sum of all Query Suggestions operations. **Processing time** - `avg_processing_time`. Average processing time (in milliseconds). - `90p_processing_time`. 90th percentile of processing time (in milliseconds). - `99p_processing_time`. 99th percentile of processing time (in milliseconds). - `queries_above_last_ms_processing_time`. Number of queries that take one or more seconds to process. **Indices** - `records`. Number of records. - `data_size`. The size of the records (in bytes). - `file_size`. The size of the records _and_ index metadata (in bytes). **Maximum queries per second** - `max_qps`. [Maximum queries per second](https://support.algolia.com/hc/en-us/articles/4406975224721) per server. - `region_max_qps`. Maximum queries per second per region. - `total_max_qps`. Maximum queries per second across all servers. **Used search capacity** The following capacities are reported in percent: - `used_search_capacity`. Maximum search capacity used per server. - `avg_used_search_capacity`. Average search capacity used per server. - `region_used_search_capacity`. Maximum search capacity used per region. - `region_avg_used_search_capacity`. Average search capacity used per region. - `total_used_search_capacity`. Maximum search capacity used for all servers. - `total_avg_used_search_capacity`. Average used search capacity for all servers. **Degraded queries** Check the impact of [degraded queries](https://support.algolia.com/hc/en-us/articles/4406981934481). - `degraded_queries_ssd_used_queries_impacted`. Percentage of degraded queries due to the Algolia search engine having to read from the server's SSD. - `degraded_queries_ssd_used_seconds_impacted`. Percentage of seconds affected by `ssd_used` degraded queries. - `degraded_queries_max_capacity_queries_impacted`. Percentage of degraded queries due to all search threads being used. - `degraded_queries_max_capacity_seconds_impacted`. Percentage of seconds affected by `max_capacity` degraded queries. (required)
|
214
|
-
# @param index_name [String] Name of the index on which to perform the operation. (required)
|
215
|
-
# @param start_date [String] Start date of the period to analyze, in RFC 3339 format. (required)
|
216
|
-
# @param end_date [String] End date of the period to analyze, in RFC 3339 format. (required)
|
217
|
-
# @param granularity [Granularity] Granularity of the aggregated metrics. - `hourly`: the maximum time range for hourly metrics is 7 days. - `daily`: the maximum time range for daily metrics is 365 days. (default to 'daily')
|
218
|
-
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
219
|
-
# @return [Http::Response] the response
|
220
|
-
def get_index_usage_with_http_info(
|
221
|
-
statistic,
|
222
|
-
index_name,
|
223
|
-
start_date,
|
224
|
-
end_date,
|
225
|
-
granularity = nil,
|
226
|
-
request_options = {}
|
227
|
-
)
|
228
|
-
# verify the required parameter 'statistic' is set
|
229
|
-
if @api_client.config.client_side_validation && statistic.nil?
|
230
|
-
raise ArgumentError, "Parameter `statistic` is required when calling `get_index_usage`."
|
231
|
-
end
|
232
|
-
# verify the required parameter 'index_name' is set
|
233
|
-
if @api_client.config.client_side_validation && index_name.nil?
|
234
|
-
raise ArgumentError, "Parameter `index_name` is required when calling `get_index_usage`."
|
235
|
-
end
|
236
|
-
# verify the required parameter 'start_date' is set
|
237
|
-
if @api_client.config.client_side_validation && start_date.nil?
|
238
|
-
raise ArgumentError, "Parameter `start_date` is required when calling `get_index_usage`."
|
239
|
-
end
|
240
|
-
# verify the required parameter 'end_date' is set
|
241
|
-
if @api_client.config.client_side_validation && end_date.nil?
|
242
|
-
raise ArgumentError, "Parameter `end_date` is required when calling `get_index_usage`."
|
243
|
-
end
|
244
|
-
|
245
|
-
path = "/1/usage/{statistic}/{indexName}".sub("{" + "statistic" + "}", Transport.encode_uri(statistic.to_s)).sub(
|
246
|
-
"{" + "indexName" + "}",
|
247
|
-
Transport.encode_uri(index_name.to_s)
|
248
|
-
)
|
249
|
-
query_params = {}
|
250
|
-
query_params[:startDate] = start_date
|
251
|
-
query_params[:endDate] = end_date
|
252
|
-
query_params[:granularity] = granularity unless granularity.nil?
|
253
|
-
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
254
|
-
header_params = {}
|
255
|
-
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
256
|
-
|
257
|
-
post_body = request_options[:debug_body]
|
258
|
-
|
259
|
-
new_options = request_options.merge(
|
260
|
-
:operation => :"UsageClient.get_index_usage",
|
261
|
-
:header_params => header_params,
|
262
|
-
:query_params => query_params,
|
263
|
-
:body => post_body,
|
264
|
-
:use_read_transporter => false
|
265
|
-
)
|
266
|
-
|
267
|
-
@api_client.call_api(:GET, path, new_options)
|
268
|
-
end
|
269
|
-
|
270
|
-
# Retrieves the selected usage statistics for one index.
|
271
|
-
|
272
|
-
# @param statistic [Statistic] Usage statistics to retrieve. Use `*` to retrieve all usage metrics, otherwise add one or more of the following metrics, separated by a comma. **Search operations** - `search_operations`. All search operations. - `total_search_operations`: Sum of all search operations. - `total_search_requests`: Sum of all [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). The number of billed search requests is equal to this value minus `querysuggestions_total_search_requests`. - `queries_operations`. Number of [single index search](/specs/search#tag/Search/operation/searchSingleIndex) operations. - `multi_queries_operations`. Number of [multi-index search](/specs/search#tag/Search/operation/search) operations. **ACL operations** - `acl_operations`. All ACL operations. - `total_acl_operations`. Sum of all ACL operations. - `get_api_keys_operations`. Number of [list API keys](/specs/search#tag/Api-Keys/operation/listApiKeys) operations. - `get_api_key_operations`. Number of [get API key permission](/specs/search#tag/Api-Keys/operation/getApiKey) operations. - `add_api_key_operations`. Number of [create API key](/specs/search#tag/Api-Keys/operation/addApiKey) operations. - `update_api_key_operations`. Number of [update API key](/specs/search#tag/Api-Keys/operation/updateApiKey) operations. - `delete_api_key_operations`. Number of [delete API key](/specs/search#tag/Api-Keys/operation/deleteApiKey) operations. - `list_api_key_operations`. Number of list index API keys operations. **Indexing operations** - `indexing_operations`. All indexing operations. - `total_indexing_operations`. Sum of all indexing operations. - `browse_operations`. Number of [browse index](/specs/search#tag/Search/operation/browse) operations. - `clear_index_operations`. Number of [clear records](/specs/search#tag/Records/operation/clearObjects) operations. - `copy_move_operations`. Number of [copy or move index](/specs/search#tag/Indices/operation/operationIndex) operations. - `delete_index_operations`. Number of [delete index](/specs/search#tag/Indices/operation/deleteIndex) operations. - `get_log_operations`. Number of [get logs](/specs/search#tag/Advanced/operation/getLogs) operations. - `get_settings_operations`. Number of [get settings](/specs/search#operation/getIndexUsage) operations. - `set_settings_operations`. Number of [set settings](/specs/search#tag/Indices/operation/setSettings) operations. - `list_indices_operations`. Number of [list indices](/specs/search#tag/Indices/operation/listIndices) operations. - `wait_task_operations`. Number of [wait](/specs/search#tag/Indices/operation/getTask) operations. **Record operations** - `record_operations`. All record operations. - `total_records_operations`. Sum of all record operations. - `add_record_operations`. Number of [add or replace record](/specs/search#tag/Records/operation/saveObject) operations. - `batch_operations`. Number of [batch indexing](/specs/search#tag/Records/operation/multipleBatch) operations. - `delete_by_query_operations`. Number of [delete by query](/specs/search#tag/Records/operation/deleteBy) operations. - `delete_record_operations`. Number of [delete record](/specs/search#tag/Records/operation/deleteObject) operations. - `get_record_operations`. Number of [get record](/specs/search#tag/Records/operation/getObject) operations. - `partial_update_record_operations`. Number of [partially update records](/specs/search#tag/Records/operation/partialUpdateObject) operations. - `update_record_operations`. Number of [add or replace record by objectID](/specs/search#tag/Records/operation/addOrUpdateObject) operations. **Synonym operations** - `synonym_operations`. All synonym operations. - `total_synonym_operations`. Sum of all synonym operations. - `batch_synonym_operations`. Number of [save all synonyms](/specs/search#tag/Synonyms/operation/saveSynonyms) operations. - `clear_synonym_operations`. Number of [clear synonyms](/specs/search#tag/Synonyms/operation/clearSynonyms) operations. - `delete_synonym_operations`. Number of [delete synonym](/specs/search#tag/Synonyms/operation/deleteSynonym) operations. - `get_synonym_operations`. Number of [get synonym](/specs/search#tag/Synonyms/operation/getSynonym) operations. - `query_synonym_operations`. Number of [search synonyms](/specs/search#tag/Synonyms/operation/searchSynonyms) operations. - `update_synonym_operations`. Number of [save a synonym](/specs/search#tag/Synonyms/operation/saveSynonym) operations. **Rule operations** - `rule_operations`. All rule operations. - `total_rules_operations`. Sum of all rule operations. - `batch_rules_operations`. Number of [batch rules](/specs/search#tag/Rules/operation/saveRules) operations. - `clear_rules_operations`. Number of [delete rule](/specs/search#tag/Rules/operation/deleteRule) operations. - `delete_rules_operations`. Number of [clear rules](/specs/search#tag/Rules/operation/clearRules) operations. - `get_rules_operations`. Number of [get rule](/specs/search#tag/Rules/operation/getRule) operations. - `save_rules_operations`. Number of [save rule](/specs/search#operation/getIndexUsage) operations. - `search_rules_operations`. Number of [search rules](/specs/search#tag/Rules/operation/searchRules) operations. **Total operations** - `total_recommend_requests`. Number of [Recommend requests](https://www.algolia.com/doc/guides/algolia-ai/recommend/) - `total_write_operations`. Number of Write operations - `total_read_operations`. Number of read operations - `total_operations`. Sum of all operations **Total Query Suggestions operations** Query Suggestions operations are a subset of `total_search_operations`. - `querysuggestions_total_search_operations`. Number of Query Suggestions search operations. - `querysuggestions_total_search_requests`. Number of Query Suggestions [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). - `querysuggestions_total_acl_operations`. Sum of all Query Suggestions [ACL operations](#acl-operations). - `querysuggestions_total_indexing_operations`. Number of Query Suggestions [indexing operations](#indexing-operations). - `querysuggestions_total_records_operations`. Number of Query Suggestions [record operations](#record-operations). - `querysuggestions_total_synonym_operations`. Number of Query Suggestions [synonym operations](#synonym-operations). - `querysuggestions_total_rules_operations`. Number of Query Suggestions [Rule operations](#rule-operations). - `querysuggestions_total_write_operations`. Number of Query Suggestions Write operations. - `querysuggestions_total_read_operations`. Number of Query Suggestions Read operations. - `querysuggestions_total_operations`. Sum of all Query Suggestions operations. **Processing time** - `avg_processing_time`. Average processing time (in milliseconds). - `90p_processing_time`. 90th percentile of processing time (in milliseconds). - `99p_processing_time`. 99th percentile of processing time (in milliseconds). - `queries_above_last_ms_processing_time`. Number of queries that take one or more seconds to process. **Indices** - `records`. Number of records. - `data_size`. The size of the records (in bytes). - `file_size`. The size of the records _and_ index metadata (in bytes). **Maximum queries per second** - `max_qps`. [Maximum queries per second](https://support.algolia.com/hc/en-us/articles/4406975224721) per server. - `region_max_qps`. Maximum queries per second per region. - `total_max_qps`. Maximum queries per second across all servers. **Used search capacity** The following capacities are reported in percent: - `used_search_capacity`. Maximum search capacity used per server. - `avg_used_search_capacity`. Average search capacity used per server. - `region_used_search_capacity`. Maximum search capacity used per region. - `region_avg_used_search_capacity`. Average search capacity used per region. - `total_used_search_capacity`. Maximum search capacity used for all servers. - `total_avg_used_search_capacity`. Average used search capacity for all servers. **Degraded queries** Check the impact of [degraded queries](https://support.algolia.com/hc/en-us/articles/4406981934481). - `degraded_queries_ssd_used_queries_impacted`. Percentage of degraded queries due to the Algolia search engine having to read from the server's SSD. - `degraded_queries_ssd_used_seconds_impacted`. Percentage of seconds affected by `ssd_used` degraded queries. - `degraded_queries_max_capacity_queries_impacted`. Percentage of degraded queries due to all search threads being used. - `degraded_queries_max_capacity_seconds_impacted`. Percentage of seconds affected by `max_capacity` degraded queries. (required)
|
273
|
-
# @param index_name [String] Name of the index on which to perform the operation. (required)
|
274
|
-
# @param start_date [String] Start date of the period to analyze, in RFC 3339 format. (required)
|
275
|
-
# @param end_date [String] End date of the period to analyze, in RFC 3339 format. (required)
|
276
|
-
# @param granularity [Granularity] Granularity of the aggregated metrics. - `hourly`: the maximum time range for hourly metrics is 7 days. - `daily`: the maximum time range for daily metrics is 365 days. (default to 'daily')
|
277
|
-
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
278
|
-
# @return [IndexUsage]
|
279
|
-
def get_index_usage(statistic, index_name, start_date, end_date, granularity = nil, request_options = {})
|
280
|
-
response = get_index_usage_with_http_info(
|
281
|
-
statistic,
|
282
|
-
index_name,
|
283
|
-
start_date,
|
284
|
-
end_date,
|
285
|
-
granularity,
|
286
|
-
request_options
|
287
|
-
)
|
288
|
-
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Usage::IndexUsage")
|
289
|
-
end
|
290
|
-
|
291
|
-
# Retrieves usage statistics evaluated over a specified period.
|
292
|
-
|
293
|
-
# @param statistic [Statistic] Usage statistics to retrieve. Use `*` to retrieve all usage metrics, otherwise add one or more of the following metrics, separated by a comma. **Search operations** - `search_operations`. All search operations. - `total_search_operations`: Sum of all search operations. - `total_search_requests`: Sum of all [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). The number of billed search requests is equal to this value minus `querysuggestions_total_search_requests`. - `queries_operations`. Number of [single index search](/specs/search#tag/Search/operation/searchSingleIndex) operations. - `multi_queries_operations`. Number of [multi-index search](/specs/search#tag/Search/operation/search) operations. **ACL operations** - `acl_operations`. All ACL operations. - `total_acl_operations`. Sum of all ACL operations. - `get_api_keys_operations`. Number of [list API keys](/specs/search#tag/Api-Keys/operation/listApiKeys) operations. - `get_api_key_operations`. Number of [get API key permission](/specs/search#tag/Api-Keys/operation/getApiKey) operations. - `add_api_key_operations`. Number of [create API key](/specs/search#tag/Api-Keys/operation/addApiKey) operations. - `update_api_key_operations`. Number of [update API key](/specs/search#tag/Api-Keys/operation/updateApiKey) operations. - `delete_api_key_operations`. Number of [delete API key](/specs/search#tag/Api-Keys/operation/deleteApiKey) operations. - `list_api_key_operations`. Number of list index API keys operations. **Indexing operations** - `indexing_operations`. All indexing operations. - `total_indexing_operations`. Sum of all indexing operations. - `browse_operations`. Number of [browse index](/specs/search#tag/Search/operation/browse) operations. - `clear_index_operations`. Number of [clear records](/specs/search#tag/Records/operation/clearObjects) operations. - `copy_move_operations`. Number of [copy or move index](/specs/search#tag/Indices/operation/operationIndex) operations. - `delete_index_operations`. Number of [delete index](/specs/search#tag/Indices/operation/deleteIndex) operations. - `get_log_operations`. Number of [get logs](/specs/search#tag/Advanced/operation/getLogs) operations. - `get_settings_operations`. Number of [get settings](/specs/search#operation/getIndexUsage) operations. - `set_settings_operations`. Number of [set settings](/specs/search#tag/Indices/operation/setSettings) operations. - `list_indices_operations`. Number of [list indices](/specs/search#tag/Indices/operation/listIndices) operations. - `wait_task_operations`. Number of [wait](/specs/search#tag/Indices/operation/getTask) operations. **Record operations** - `record_operations`. All record operations. - `total_records_operations`. Sum of all record operations. - `add_record_operations`. Number of [add or replace record](/specs/search#tag/Records/operation/saveObject) operations. - `batch_operations`. Number of [batch indexing](/specs/search#tag/Records/operation/multipleBatch) operations. - `delete_by_query_operations`. Number of [delete by query](/specs/search#tag/Records/operation/deleteBy) operations. - `delete_record_operations`. Number of [delete record](/specs/search#tag/Records/operation/deleteObject) operations. - `get_record_operations`. Number of [get record](/specs/search#tag/Records/operation/getObject) operations. - `partial_update_record_operations`. Number of [partially update records](/specs/search#tag/Records/operation/partialUpdateObject) operations. - `update_record_operations`. Number of [add or replace record by objectID](/specs/search#tag/Records/operation/addOrUpdateObject) operations. **Synonym operations** - `synonym_operations`. All synonym operations. - `total_synonym_operations`. Sum of all synonym operations. - `batch_synonym_operations`. Number of [save all synonyms](/specs/search#tag/Synonyms/operation/saveSynonyms) operations. - `clear_synonym_operations`. Number of [clear synonyms](/specs/search#tag/Synonyms/operation/clearSynonyms) operations. - `delete_synonym_operations`. Number of [delete synonym](/specs/search#tag/Synonyms/operation/deleteSynonym) operations. - `get_synonym_operations`. Number of [get synonym](/specs/search#tag/Synonyms/operation/getSynonym) operations. - `query_synonym_operations`. Number of [search synonyms](/specs/search#tag/Synonyms/operation/searchSynonyms) operations. - `update_synonym_operations`. Number of [save a synonym](/specs/search#tag/Synonyms/operation/saveSynonym) operations. **Rule operations** - `rule_operations`. All rule operations. - `total_rules_operations`. Sum of all rule operations. - `batch_rules_operations`. Number of [batch rules](/specs/search#tag/Rules/operation/saveRules) operations. - `clear_rules_operations`. Number of [delete rule](/specs/search#tag/Rules/operation/deleteRule) operations. - `delete_rules_operations`. Number of [clear rules](/specs/search#tag/Rules/operation/clearRules) operations. - `get_rules_operations`. Number of [get rule](/specs/search#tag/Rules/operation/getRule) operations. - `save_rules_operations`. Number of [save rule](/specs/search#operation/getIndexUsage) operations. - `search_rules_operations`. Number of [search rules](/specs/search#tag/Rules/operation/searchRules) operations. **Total operations** - `total_recommend_requests`. Number of [Recommend requests](https://www.algolia.com/doc/guides/algolia-ai/recommend/) - `total_write_operations`. Number of Write operations - `total_read_operations`. Number of read operations - `total_operations`. Sum of all operations **Total Query Suggestions operations** Query Suggestions operations are a subset of `total_search_operations`. - `querysuggestions_total_search_operations`. Number of Query Suggestions search operations. - `querysuggestions_total_search_requests`. Number of Query Suggestions [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). - `querysuggestions_total_acl_operations`. Sum of all Query Suggestions [ACL operations](#acl-operations). - `querysuggestions_total_indexing_operations`. Number of Query Suggestions [indexing operations](#indexing-operations). - `querysuggestions_total_records_operations`. Number of Query Suggestions [record operations](#record-operations). - `querysuggestions_total_synonym_operations`. Number of Query Suggestions [synonym operations](#synonym-operations). - `querysuggestions_total_rules_operations`. Number of Query Suggestions [Rule operations](#rule-operations). - `querysuggestions_total_write_operations`. Number of Query Suggestions Write operations. - `querysuggestions_total_read_operations`. Number of Query Suggestions Read operations. - `querysuggestions_total_operations`. Sum of all Query Suggestions operations. **Processing time** - `avg_processing_time`. Average processing time (in milliseconds). - `90p_processing_time`. 90th percentile of processing time (in milliseconds). - `99p_processing_time`. 99th percentile of processing time (in milliseconds). - `queries_above_last_ms_processing_time`. Number of queries that take one or more seconds to process. **Indices** - `records`. Number of records. - `data_size`. The size of the records (in bytes). - `file_size`. The size of the records _and_ index metadata (in bytes). **Maximum queries per second** - `max_qps`. [Maximum queries per second](https://support.algolia.com/hc/en-us/articles/4406975224721) per server. - `region_max_qps`. Maximum queries per second per region. - `total_max_qps`. Maximum queries per second across all servers. **Used search capacity** The following capacities are reported in percent: - `used_search_capacity`. Maximum search capacity used per server. - `avg_used_search_capacity`. Average search capacity used per server. - `region_used_search_capacity`. Maximum search capacity used per region. - `region_avg_used_search_capacity`. Average search capacity used per region. - `total_used_search_capacity`. Maximum search capacity used for all servers. - `total_avg_used_search_capacity`. Average used search capacity for all servers. **Degraded queries** Check the impact of [degraded queries](https://support.algolia.com/hc/en-us/articles/4406981934481). - `degraded_queries_ssd_used_queries_impacted`. Percentage of degraded queries due to the Algolia search engine having to read from the server's SSD. - `degraded_queries_ssd_used_seconds_impacted`. Percentage of seconds affected by `ssd_used` degraded queries. - `degraded_queries_max_capacity_queries_impacted`. Percentage of degraded queries due to all search threads being used. - `degraded_queries_max_capacity_seconds_impacted`. Percentage of seconds affected by `max_capacity` degraded queries. (required)
|
294
|
-
# @param start_date [String] Start date of the period to analyze, in RFC 3339 format. (required)
|
295
|
-
# @param end_date [String] End date of the period to analyze, in RFC 3339 format. (required)
|
296
|
-
# @param granularity [Granularity] Granularity of the aggregated metrics. - `hourly`: the maximum time range for hourly metrics is 7 days. - `daily`: the maximum time range for daily metrics is 365 days. (default to 'daily')
|
297
|
-
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
298
|
-
# @return [Http::Response] the response
|
299
|
-
def get_usage_with_http_info(statistic, start_date, end_date, granularity = nil, request_options = {})
|
300
|
-
# verify the required parameter 'statistic' is set
|
301
|
-
if @api_client.config.client_side_validation && statistic.nil?
|
302
|
-
raise ArgumentError, "Parameter `statistic` is required when calling `get_usage`."
|
303
|
-
end
|
304
|
-
# verify the required parameter 'start_date' is set
|
305
|
-
if @api_client.config.client_side_validation && start_date.nil?
|
306
|
-
raise ArgumentError, "Parameter `start_date` is required when calling `get_usage`."
|
307
|
-
end
|
308
|
-
# verify the required parameter 'end_date' is set
|
309
|
-
if @api_client.config.client_side_validation && end_date.nil?
|
310
|
-
raise ArgumentError, "Parameter `end_date` is required when calling `get_usage`."
|
311
|
-
end
|
312
|
-
|
313
|
-
path = "/1/usage/{statistic}".sub("{" + "statistic" + "}", Transport.encode_uri(statistic.to_s))
|
314
|
-
query_params = {}
|
315
|
-
query_params[:startDate] = start_date
|
316
|
-
query_params[:endDate] = end_date
|
317
|
-
query_params[:granularity] = granularity unless granularity.nil?
|
318
|
-
query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
|
319
|
-
header_params = {}
|
320
|
-
header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
|
321
|
-
|
322
|
-
post_body = request_options[:debug_body]
|
323
|
-
|
324
|
-
new_options = request_options.merge(
|
325
|
-
:operation => :"UsageClient.get_usage",
|
326
|
-
:header_params => header_params,
|
327
|
-
:query_params => query_params,
|
328
|
-
:body => post_body,
|
329
|
-
:use_read_transporter => false
|
330
|
-
)
|
331
|
-
|
332
|
-
@api_client.call_api(:GET, path, new_options)
|
333
|
-
end
|
334
|
-
|
335
|
-
# Retrieves usage statistics evaluated over a specified period.
|
336
|
-
|
337
|
-
# @param statistic [Statistic] Usage statistics to retrieve. Use `*` to retrieve all usage metrics, otherwise add one or more of the following metrics, separated by a comma. **Search operations** - `search_operations`. All search operations. - `total_search_operations`: Sum of all search operations. - `total_search_requests`: Sum of all [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). The number of billed search requests is equal to this value minus `querysuggestions_total_search_requests`. - `queries_operations`. Number of [single index search](/specs/search#tag/Search/operation/searchSingleIndex) operations. - `multi_queries_operations`. Number of [multi-index search](/specs/search#tag/Search/operation/search) operations. **ACL operations** - `acl_operations`. All ACL operations. - `total_acl_operations`. Sum of all ACL operations. - `get_api_keys_operations`. Number of [list API keys](/specs/search#tag/Api-Keys/operation/listApiKeys) operations. - `get_api_key_operations`. Number of [get API key permission](/specs/search#tag/Api-Keys/operation/getApiKey) operations. - `add_api_key_operations`. Number of [create API key](/specs/search#tag/Api-Keys/operation/addApiKey) operations. - `update_api_key_operations`. Number of [update API key](/specs/search#tag/Api-Keys/operation/updateApiKey) operations. - `delete_api_key_operations`. Number of [delete API key](/specs/search#tag/Api-Keys/operation/deleteApiKey) operations. - `list_api_key_operations`. Number of list index API keys operations. **Indexing operations** - `indexing_operations`. All indexing operations. - `total_indexing_operations`. Sum of all indexing operations. - `browse_operations`. Number of [browse index](/specs/search#tag/Search/operation/browse) operations. - `clear_index_operations`. Number of [clear records](/specs/search#tag/Records/operation/clearObjects) operations. - `copy_move_operations`. Number of [copy or move index](/specs/search#tag/Indices/operation/operationIndex) operations. - `delete_index_operations`. Number of [delete index](/specs/search#tag/Indices/operation/deleteIndex) operations. - `get_log_operations`. Number of [get logs](/specs/search#tag/Advanced/operation/getLogs) operations. - `get_settings_operations`. Number of [get settings](/specs/search#operation/getIndexUsage) operations. - `set_settings_operations`. Number of [set settings](/specs/search#tag/Indices/operation/setSettings) operations. - `list_indices_operations`. Number of [list indices](/specs/search#tag/Indices/operation/listIndices) operations. - `wait_task_operations`. Number of [wait](/specs/search#tag/Indices/operation/getTask) operations. **Record operations** - `record_operations`. All record operations. - `total_records_operations`. Sum of all record operations. - `add_record_operations`. Number of [add or replace record](/specs/search#tag/Records/operation/saveObject) operations. - `batch_operations`. Number of [batch indexing](/specs/search#tag/Records/operation/multipleBatch) operations. - `delete_by_query_operations`. Number of [delete by query](/specs/search#tag/Records/operation/deleteBy) operations. - `delete_record_operations`. Number of [delete record](/specs/search#tag/Records/operation/deleteObject) operations. - `get_record_operations`. Number of [get record](/specs/search#tag/Records/operation/getObject) operations. - `partial_update_record_operations`. Number of [partially update records](/specs/search#tag/Records/operation/partialUpdateObject) operations. - `update_record_operations`. Number of [add or replace record by objectID](/specs/search#tag/Records/operation/addOrUpdateObject) operations. **Synonym operations** - `synonym_operations`. All synonym operations. - `total_synonym_operations`. Sum of all synonym operations. - `batch_synonym_operations`. Number of [save all synonyms](/specs/search#tag/Synonyms/operation/saveSynonyms) operations. - `clear_synonym_operations`. Number of [clear synonyms](/specs/search#tag/Synonyms/operation/clearSynonyms) operations. - `delete_synonym_operations`. Number of [delete synonym](/specs/search#tag/Synonyms/operation/deleteSynonym) operations. - `get_synonym_operations`. Number of [get synonym](/specs/search#tag/Synonyms/operation/getSynonym) operations. - `query_synonym_operations`. Number of [search synonyms](/specs/search#tag/Synonyms/operation/searchSynonyms) operations. - `update_synonym_operations`. Number of [save a synonym](/specs/search#tag/Synonyms/operation/saveSynonym) operations. **Rule operations** - `rule_operations`. All rule operations. - `total_rules_operations`. Sum of all rule operations. - `batch_rules_operations`. Number of [batch rules](/specs/search#tag/Rules/operation/saveRules) operations. - `clear_rules_operations`. Number of [delete rule](/specs/search#tag/Rules/operation/deleteRule) operations. - `delete_rules_operations`. Number of [clear rules](/specs/search#tag/Rules/operation/clearRules) operations. - `get_rules_operations`. Number of [get rule](/specs/search#tag/Rules/operation/getRule) operations. - `save_rules_operations`. Number of [save rule](/specs/search#operation/getIndexUsage) operations. - `search_rules_operations`. Number of [search rules](/specs/search#tag/Rules/operation/searchRules) operations. **Total operations** - `total_recommend_requests`. Number of [Recommend requests](https://www.algolia.com/doc/guides/algolia-ai/recommend/) - `total_write_operations`. Number of Write operations - `total_read_operations`. Number of read operations - `total_operations`. Sum of all operations **Total Query Suggestions operations** Query Suggestions operations are a subset of `total_search_operations`. - `querysuggestions_total_search_operations`. Number of Query Suggestions search operations. - `querysuggestions_total_search_requests`. Number of Query Suggestions [search requests](https://support.algolia.com/hc/en-us/articles/4406981829777-How-does-Algolia-count-records-and-operations-). - `querysuggestions_total_acl_operations`. Sum of all Query Suggestions [ACL operations](#acl-operations). - `querysuggestions_total_indexing_operations`. Number of Query Suggestions [indexing operations](#indexing-operations). - `querysuggestions_total_records_operations`. Number of Query Suggestions [record operations](#record-operations). - `querysuggestions_total_synonym_operations`. Number of Query Suggestions [synonym operations](#synonym-operations). - `querysuggestions_total_rules_operations`. Number of Query Suggestions [Rule operations](#rule-operations). - `querysuggestions_total_write_operations`. Number of Query Suggestions Write operations. - `querysuggestions_total_read_operations`. Number of Query Suggestions Read operations. - `querysuggestions_total_operations`. Sum of all Query Suggestions operations. **Processing time** - `avg_processing_time`. Average processing time (in milliseconds). - `90p_processing_time`. 90th percentile of processing time (in milliseconds). - `99p_processing_time`. 99th percentile of processing time (in milliseconds). - `queries_above_last_ms_processing_time`. Number of queries that take one or more seconds to process. **Indices** - `records`. Number of records. - `data_size`. The size of the records (in bytes). - `file_size`. The size of the records _and_ index metadata (in bytes). **Maximum queries per second** - `max_qps`. [Maximum queries per second](https://support.algolia.com/hc/en-us/articles/4406975224721) per server. - `region_max_qps`. Maximum queries per second per region. - `total_max_qps`. Maximum queries per second across all servers. **Used search capacity** The following capacities are reported in percent: - `used_search_capacity`. Maximum search capacity used per server. - `avg_used_search_capacity`. Average search capacity used per server. - `region_used_search_capacity`. Maximum search capacity used per region. - `region_avg_used_search_capacity`. Average search capacity used per region. - `total_used_search_capacity`. Maximum search capacity used for all servers. - `total_avg_used_search_capacity`. Average used search capacity for all servers. **Degraded queries** Check the impact of [degraded queries](https://support.algolia.com/hc/en-us/articles/4406981934481). - `degraded_queries_ssd_used_queries_impacted`. Percentage of degraded queries due to the Algolia search engine having to read from the server's SSD. - `degraded_queries_ssd_used_seconds_impacted`. Percentage of seconds affected by `ssd_used` degraded queries. - `degraded_queries_max_capacity_queries_impacted`. Percentage of degraded queries due to all search threads being used. - `degraded_queries_max_capacity_seconds_impacted`. Percentage of seconds affected by `max_capacity` degraded queries. (required)
|
338
|
-
# @param start_date [String] Start date of the period to analyze, in RFC 3339 format. (required)
|
339
|
-
# @param end_date [String] End date of the period to analyze, in RFC 3339 format. (required)
|
340
|
-
# @param granularity [Granularity] Granularity of the aggregated metrics. - `hourly`: the maximum time range for hourly metrics is 7 days. - `daily`: the maximum time range for daily metrics is 365 days. (default to 'daily')
|
341
|
-
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
|
342
|
-
# @return [IndexUsage]
|
343
|
-
def get_usage(statistic, start_date, end_date, granularity = nil, request_options = {})
|
344
|
-
response = get_usage_with_http_info(statistic, start_date, end_date, granularity, request_options)
|
345
|
-
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Usage::IndexUsage")
|
346
|
-
end
|
347
|
-
|
348
|
-
end
|
349
|
-
end
|
@@ -1,212 +0,0 @@
|
|
1
|
-
# Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
2
|
-
|
3
|
-
require "date"
|
4
|
-
require "time"
|
5
|
-
|
6
|
-
module Algolia
|
7
|
-
module Usage
|
8
|
-
# Error.
|
9
|
-
class ErrorBase
|
10
|
-
attr_accessor :message
|
11
|
-
|
12
|
-
attr_accessor :additional_properties
|
13
|
-
|
14
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
15
|
-
def self.attribute_map
|
16
|
-
{
|
17
|
-
:message => :message
|
18
|
-
}
|
19
|
-
end
|
20
|
-
|
21
|
-
# Returns all the JSON keys this model knows about
|
22
|
-
def self.acceptable_attributes
|
23
|
-
attribute_map.values
|
24
|
-
end
|
25
|
-
|
26
|
-
# Attribute type mapping.
|
27
|
-
def self.types_mapping
|
28
|
-
{
|
29
|
-
:message => :"String"
|
30
|
-
}
|
31
|
-
end
|
32
|
-
|
33
|
-
# List of attributes with nullable: true
|
34
|
-
def self.openapi_nullable
|
35
|
-
Set.new(
|
36
|
-
[]
|
37
|
-
)
|
38
|
-
end
|
39
|
-
|
40
|
-
# Initializes the object
|
41
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
42
|
-
def initialize(attributes = {})
|
43
|
-
if (!attributes.is_a?(Hash))
|
44
|
-
raise(
|
45
|
-
ArgumentError,
|
46
|
-
"The input argument (attributes) must be a hash in `Algolia::ErrorBase` initialize method"
|
47
|
-
)
|
48
|
-
end
|
49
|
-
|
50
|
-
if attributes.key?(:message)
|
51
|
-
self.message = attributes[:message]
|
52
|
-
end
|
53
|
-
|
54
|
-
# add extra attribute to additional_properties
|
55
|
-
self.additional_properties ||= {}
|
56
|
-
self.additional_properties.merge!(attributes.reject { |k, _| self.class.attribute_map.key?(k.to_sym) })
|
57
|
-
end
|
58
|
-
|
59
|
-
# Checks equality by comparing each attribute.
|
60
|
-
# @param [Object] Object to be compared
|
61
|
-
def ==(other)
|
62
|
-
return true if self.equal?(other)
|
63
|
-
self.class == other.class &&
|
64
|
-
message == other.message
|
65
|
-
end
|
66
|
-
|
67
|
-
# @see the `==` method
|
68
|
-
# @param [Object] Object to be compared
|
69
|
-
def eql?(other)
|
70
|
-
self == other
|
71
|
-
end
|
72
|
-
|
73
|
-
# Calculates hash code according to all attributes.
|
74
|
-
# @return [Integer] Hash code
|
75
|
-
def hash
|
76
|
-
[message].hash
|
77
|
-
end
|
78
|
-
|
79
|
-
# Builds the object from hash
|
80
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
81
|
-
# @return [Object] Returns the model itself
|
82
|
-
def self.build_from_hash(attributes)
|
83
|
-
return nil unless attributes.is_a?(Hash)
|
84
|
-
attributes = attributes.transform_keys(&:to_sym)
|
85
|
-
transformed_hash = {}
|
86
|
-
types_mapping.each_pair do |key, type|
|
87
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
88
|
-
transformed_hash[key.to_sym] = nil
|
89
|
-
elsif type =~ /\AArray<(.*)>/i
|
90
|
-
# check to ensure the input is an array given that the attribute
|
91
|
-
# is documented as an array but the input is not
|
92
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
93
|
-
transformed_hash[key.to_sym] = attributes[attribute_map[key]].map { |v|
|
94
|
-
_deserialize(::Regexp.last_match(1), v)
|
95
|
-
}
|
96
|
-
end
|
97
|
-
elsif !attributes[attribute_map[key]].nil?
|
98
|
-
transformed_hash[key.to_sym] = _deserialize(type, attributes[attribute_map[key]])
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
# add extra attribute to transformed_hash
|
103
|
-
transformed_hash.merge!(attributes.reject { |k, _| attribute_map.key?(k.to_sym) })
|
104
|
-
new(transformed_hash)
|
105
|
-
end
|
106
|
-
|
107
|
-
# Deserializes the data based on type
|
108
|
-
# @param string type Data type
|
109
|
-
# @param string value Value to be deserialized
|
110
|
-
# @return [Object] Deserialized data
|
111
|
-
def self._deserialize(type, value)
|
112
|
-
case type.to_sym
|
113
|
-
when :Time
|
114
|
-
Time.parse(value)
|
115
|
-
when :Date
|
116
|
-
Date.parse(value)
|
117
|
-
when :String
|
118
|
-
value.to_s
|
119
|
-
when :Integer
|
120
|
-
value.to_i
|
121
|
-
when :Float
|
122
|
-
value.to_f
|
123
|
-
when :Boolean
|
124
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
125
|
-
true
|
126
|
-
else
|
127
|
-
false
|
128
|
-
end
|
129
|
-
|
130
|
-
when :Object
|
131
|
-
# generic object (usually a Hash), return directly
|
132
|
-
value
|
133
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
134
|
-
inner_type = Regexp.last_match[:inner_type]
|
135
|
-
value.map { |v| _deserialize(inner_type, v) }
|
136
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
137
|
-
k_type = Regexp.last_match[:k_type]
|
138
|
-
v_type = Regexp.last_match[:v_type]
|
139
|
-
{}.tap do |hash|
|
140
|
-
value.each do |k, v|
|
141
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
142
|
-
end
|
143
|
-
end
|
144
|
-
# model
|
145
|
-
else
|
146
|
-
# models (e.g. Pet) or oneOf
|
147
|
-
klass = Algolia::Usage.const_get(type)
|
148
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass
|
149
|
-
.build_from_hash(value)
|
150
|
-
end
|
151
|
-
end
|
152
|
-
|
153
|
-
# Returns the string representation of the object
|
154
|
-
# @return [String] String presentation of the object
|
155
|
-
def to_s
|
156
|
-
to_hash.to_s
|
157
|
-
end
|
158
|
-
|
159
|
-
# to_body is an alias to to_hash (backward compatibility)
|
160
|
-
# @return [Hash] Returns the object in the form of hash
|
161
|
-
def to_body
|
162
|
-
to_hash
|
163
|
-
end
|
164
|
-
|
165
|
-
def to_json(*_args)
|
166
|
-
to_hash.to_json
|
167
|
-
end
|
168
|
-
|
169
|
-
# Returns the object in the form of hash
|
170
|
-
# @return [Hash] Returns the object in the form of hash
|
171
|
-
def to_hash
|
172
|
-
hash = {}
|
173
|
-
self.class.attribute_map.each_pair do |attr, param|
|
174
|
-
value = send(attr)
|
175
|
-
if value.nil?
|
176
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
177
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
178
|
-
end
|
179
|
-
|
180
|
-
hash[param] = _to_hash(value)
|
181
|
-
end
|
182
|
-
|
183
|
-
# also add attributes from additional_properties to hash
|
184
|
-
self.additional_properties&.each_pair do |k, v|
|
185
|
-
hash[k.to_sym] = _to_hash(v)
|
186
|
-
end
|
187
|
-
|
188
|
-
hash
|
189
|
-
end
|
190
|
-
|
191
|
-
# Outputs non-array value in the form of hash
|
192
|
-
# For object, use to_hash. Otherwise, just return the value
|
193
|
-
# @param [Object] value Any valid value
|
194
|
-
# @return [Hash] Returns the value in the form of hash
|
195
|
-
def _to_hash(value)
|
196
|
-
if value.is_a?(Array)
|
197
|
-
value.compact.map { |v| _to_hash(v) }
|
198
|
-
elsif value.is_a?(Hash)
|
199
|
-
{}.tap do |hash|
|
200
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
201
|
-
end
|
202
|
-
elsif value.respond_to?(:to_hash)
|
203
|
-
value.to_hash
|
204
|
-
else
|
205
|
-
value
|
206
|
-
end
|
207
|
-
end
|
208
|
-
|
209
|
-
end
|
210
|
-
|
211
|
-
end
|
212
|
-
end
|