Самый простой способ получить общую информацию о вашем узле Manticore — выполнить команду status в клиенте MySQL. Она отобразит информацию о различных аспектах, таких как:
- Текущая версия
- Используется ли SSL или нет
- Текущий TCP порт/Unix сокет
- Время работы
- Количество потоков
- Количество заданий в очереди
- Количество подключений (
clients) - Количество задач, обрабатываемых в данный момент
- Количество выполненных запросов с момента запуска
- Количество заданий в очереди и количество задач, нормализованное по количеству потоков
- SQL
mysql> status--------------
mysql Ver 14.14 Distrib 5.7.30, for Linux (x86_64) using EditLine wrapper
Connection id: 378
Current database: Manticore
Current user: Usual
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 3.4.3 a48c61d6@200702 coroutines git branch coroutines_work_junk...origin/coroutines_work_junk
Protocol version: 10
Connection: 0 via TCP/IP
Server characterset:
Db characterset:
Client characterset: utf8
Conn. characterset: utf8
TCP port: 8306
Uptime: 23 hours 6 sec
Threads: 12 Queue: 3 Clients: 1 Vip clients: 0 Tasks: 5 Queries: 318967 Wall: 7h CPU: 0us
Queue/Th: 0.2 Tasks/Th: 0.4
--------------SHOW STATUS [ LIKE pattern ]
SHOW STATUS — это SQL-запрос, который показывает различные полезные счетчики производительности. Счетчики ввода-вывода и CPU будут доступны только если searchd был запущен с ключами --iostats и --cpustats соответственно (или если они были включены через SET GLOBAL iostats/cpustats=1).
- SQL
SHOW STATUS;+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| Counter | Value |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| uptime | 182 |
| connections | 368 |
| maxed_out | 0 |
| version | 6.3.7 b10359434@24100213 dev (columnar 2.3.1 bd59d08@24093015) (secondary 2.3.1 bd59d08@24093015) (knn 2.3.1 bd59d08@24093015) (buddy v2.3.13) |
| mysql_version | 6.3.7 b10359434@24100213 dev (columnar 2.3.1 bd59d08@24093015) (secondary 2.3.1 bd59d08@24093015) (knn 2.3.1 bd59d08@24093015) |
| command_search | 4 |
| command_excerpt | 0 |
| command_update | 2 |
| command_keywords | 0 |
| command_persist | 0 |
| command_status | 8 |
| command_flushattrs | 0 |
| command_sphinxql | 0 |
| command_ping | 0 |
| command_delete | 3 |
| command_set | 0 |
| command_insert | 3 |
| command_replace | 3 |
| command_commit | 0 |
| command_suggest | 0 |
| command_json | 0 |
| command_callpq | 0 |
| command_cluster | 0 |
| command_getfield | 0 |
| insert_replace_stats_ms_avg | 42.625 35.895 35.895 |
| insert_replace_stats_ms_min | 0.096 0.096 0.096 |
| insert_replace_stats_ms_max | 85.154 85.154 85.154 |
| insert_replace_stats_ms_pct95 | 42.625 42.625 42.625 |
| insert_replace_stats_ms_pct99 | 42.625 42.625 42.625 |
| search_stats_ms_avg | 0.209 0.188 0.188 |
| search_stats_ms_min | 0.205 0.058 0.058 |
| search_stats_ms_max | 0.214 0.278 0.278 |
| search_stats_ms_pct95 | 0.214 0.278 0.278 |
| search_stats_ms_pct99 | 0.214 0.278 0.278 |
| update_stats_ms_avg | 0.024 0.024 0.024 |
| update_stats_ms_min | 0.007 0.007 0.007 |
| update_stats_ms_max | 0.042 0.042 0.042 |
| update_stats_ms_pct95 | 0.042 0.042 0.042 |
| update_stats_ms_pct99 | 0.042 0.042 0.042 |
| agent_connect | 0 |
| agent_tfo | 0 |
| agent_retry | 0 |
| queries | 6 |
| dist_queries | 0 |
| workers_total | 32 |
| workers_active | 3 |
| workers_clients | 1 |
| workers_clients_vip | 0 |
| workers_clients_buddy | 1 |
| work_queue_length | 6 |
| load | 0.03 0.03 0.03 |
| load_primary | 0.00 0.00 0.00 |
| load_secondary | 0.00 0.00 0.00 |
| query_wall | 0.000 |
| query_cpu | OFF |
| dist_wall | 0.000 |
| dist_local | 0.000 |
| dist_wait | 0.000 |
| query_reads | OFF |
| query_readkb | OFF |
| query_readtime | OFF |
| avg_query_wall | 0.000 |
| avg_query_cpu | OFF |
| avg_dist_wall | 0.000 |
| avg_dist_local | 0.000 |
| avg_dist_wait | 0.000 |
| avg_query_reads | OFF |
| avg_query_readkb | OFF |
| avg_query_readtime | OFF |
| qcache_max_bytes | 16777216 |
| qcache_thresh_msec | 3000 |
| qcache_ttl_sec | 60 |
| qcache_cached_queries | 0 |
| qcache_used_bytes | 0 |
| qcache_hits | 0 |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+Поддерживается необязательный оператор LIKE, позволяющий выбрать только переменные, соответствующие определенному шаблону. Синтаксис шаблона соответствует стандартным SQL-джокерам, где % означает любое количество любых символов, а _ — один символ.
- qcache
- perf_stats
SHOW STATUS LIKE 'qcache%';SHOW STATUS LIKE '%stats_ms%';+-----------------------+-------+
| Counter | Value |
+-----------------------+-------+
| qcache_max_bytes | 0 |
| qcache_thresh_msec | 3000 |
| qcache_ttl_sec | 60 |
| qcache_cached_queries | 0 |
| qcache_used_bytes | 0 |
| qcache_hits | 0 |
+-----------------------+-------++-------------------------------+-------------------+
| Counter | Value |
+-------------------------------+-------------------+
| insert_replace_stats_ms_avg | N/A 35.895 35.895 |
| insert_replace_stats_ms_min | N/A 0.096 0.096 |
| insert_replace_stats_ms_max | N/A 85.154 85.154 |
| insert_replace_stats_ms_pct95 | N/A 42.625 42.625 |
| insert_replace_stats_ms_pct99 | N/A 42.625 42.625 |
| search_stats_ms_avg | N/A 0.188 0.188 |
| search_stats_ms_min | N/A 0.058 0.058 |
| search_stats_ms_max | N/A 0.278 0.278 |
| search_stats_ms_pct95 | N/A 0.278 0.278 |
| search_stats_ms_pct99 | N/A 0.278 0.278 |
| update_stats_ms_avg | N/A 0.024 0.024 |
| update_stats_ms_min | N/A 0.007 0.007 |
| update_stats_ms_max | N/A 0.042 0.042 |
| update_stats_ms_pct95 | N/A 0.042 0.042 |
| update_stats_ms_pct99 | N/A 0.042 0.042 |
+-------------------------------+-------------------+Команда SHOW STATUS предоставляет подробный отчет о различных показателях производительности в Manticore, включая статистику времени запросов для insert/replace, search и update запросов. Эти статистики рассчитываются за скользящие окна в 1, 5 и 15 минут, показывая средние, минимальные, максимальные и 95-й/99-й перцентили времени запросов.
Эти метрики помогают отслеживать производительность за определенные интервалы времени, что облегчает выявление тенденций в времени отклика запросов и поиск возможных узких мест.
Следующие метрики входят в вывод SHOW STATUS:
*_avg: Среднее время запроса для каждого типа запросов за последние 1, 5 и 15 минут.*_min: Самое короткое время запроса, зафиксированное для каждого типа запросов.*_max: Самое длинное время запроса, зафиксированное для каждого типа запросов.*_pct95: Время, в течение которого выполняются 95% запросов.*_pct99: Время, в течение которого выполняются 99% запросов.
Эти статистики предоставляются отдельно для insert/replace (insert_replace_stats_*), search (search_stats_*) и update (update_stats_*) запросов, что дает детальное представление о производительности различных операций.
Если в течение контролируемого интервала запросы не выполнялись, система отобразит N/A.
- perf_stats
SHOW STATUS LIKE '%stats_ms%';+-------------------------------+-------------------+
| Counter | Value |
+-------------------------------+-------------------+
| insert_replace_stats_ms_avg | N/A 35.895 35.895 |
| insert_replace_stats_ms_min | N/A 0.096 0.096 |
| insert_replace_stats_ms_max | N/A 85.154 85.154 |
| insert_replace_stats_ms_pct95 | N/A 42.625 42.625 |
| insert_replace_stats_ms_pct99 | N/A 42.625 42.625 |
| search_stats_ms_avg | N/A 0.188 0.188 |
| search_stats_ms_min | N/A 0.058 0.058 |
| search_stats_ms_max | N/A 0.278 0.278 |
| search_stats_ms_pct95 | N/A 0.278 0.278 |
| search_stats_ms_pct99 | N/A 0.278 0.278 |
| update_stats_ms_avg | N/A 0.024 0.024 |
| update_stats_ms_min | N/A 0.007 0.007 |
| update_stats_ms_max | N/A 0.042 0.042 |
| update_stats_ms_pct95 | N/A 0.042 0.042 |
| update_stats_ms_pct99 | N/A 0.042 0.042 |
+-------------------------------+-------------------+SHOW SETTINGS — это SQL-запрос, который отображает текущие настройки из вашего конфигурационного файла. Имена настроек представлены в формате: 'config_section_name'.'setting_name'
Результат также включает два дополнительных значения:
configuration_file— путь к конфигурационному файлуworker_pid— идентификатор процесса запущенного экземпляраsearchd
- SQL
SHOW SETTINGS;+--------------------------+-------------------------------------+
| Setting_name | Value |
+--------------------------+-------------------------------------+
| configuration_file | /etc/manticoresearch/manticore.conf |
| worker_pid | 658 |
| searchd.listen | 0.0.0:9312 |
| searchd.listen | 0.0.0:9306:mysql |
| searchd.listen | 0.0.0:9308:http |
| searchd.log | /var/log/manticore/searchd.log |
| searchd.query_log | /var/log/manticore/query.log |
| searchd.pid_file | /run/manticore/searchd.pid |
| searchd.data_dir | /var/lib/manticore |
| searchd.query_log_format | sphinxql |
| searchd.binlog_path | /var/lib/manticore/binlog |
| common.plugin_dir | /usr/local/lib/manticore |
| common.lemmatizer_base | /usr/share/manticore/morph/ |
+--------------------------+-------------------------------------+
13 rows in set (0.00 sec)SHOW AGENT ['agent_or_index'] STATUS [ LIKE pattern ]
SHOW AGENT STATUS отображает статистику удаленных агентов или распределенной таблицы. Включает такие значения, как время с последнего запроса, последнего ответа, количество различных типов ошибок и успешных операций и т.д. Статистика отображается для каждого агента за последние интервалы 1, 5 и 15, каждый из которых состоит из ha_period_karma секунд.
- SQL
- PHP
- Python
- Python-asyncio
- javascript
- Java
- C#
- Rust
- TypeScript
- Go
SHOW AGENT STATUS;$client->nodes()->agentstatus();utilsApi.sql('SHOW AGENT STATUS')await utilsApi.sql('SHOW AGENT STATUS')res = await utilsApi.sql("SHOW AGENT STATUS");utilsApi.sql("SHOW AGENT STATUS");utilsApi.Sql("SHOW AGENT STATUS");utils_api.sql("SHOW AGENT STATUS", Some(true)).await;res = await utilsApi.sql("SHOW AGENT STATUS");res := apiClient.UtilsAPI.Sql(context.Background()).Body("SHOW AGENT STATUS").Execute()+------------------------------------+----------------------------+
| Variable_name | Value |
+------------------------------------+----------------------------+
| status_period_seconds | 60 |
| status_stored_periods | 15 |
| ag_0_hostname | 192.168.0.202:6713 |
| ag_0_references | 2 |
| ag_0_lastquery | 0.41 |
| ag_0_lastanswer | 0.19 |
| ag_0_lastperiodmsec | 222 |
| ag_0_pingtripmsec | 10.521 |
| ag_0_errorsarow | 0 |
| ag_0_1periods_query_timeouts | 0 |
| ag_0_1periods_connect_timeouts | 0 |
| ag_0_1periods_connect_failures | 0 |
| ag_0_1periods_network_errors | 0 |
| ag_0_1periods_wrong_replies | 0 |
| ag_0_1periods_unexpected_closings | 0 |
| ag_0_1periods_warnings | 0 |
| ag_0_1periods_succeeded_queries | 27 |
| ag_0_1periods_msecsperquery | 232.31 |
| ag_0_5periods_query_timeouts | 0 |
| ag_0_5periods_connect_timeouts | 0 |
| ag_0_5periods_connect_failures | 0 |
| ag_0_5periods_network_errors | 0 |
| ag_0_5periods_wrong_replies | 0 |
| ag_0_5periods_unexpected_closings | 0 |
| ag_0_5periods_warnings | 0 |
| ag_0_5periods_succeeded_queries | 146 |
| ag_0_5periods_msecsperquery | 231.83 |
| ag_1_hostname | 192.168.0.202:6714 |
| ag_1_references | 2 |
| ag_1_lastquery | 0.41 |
| ag_1_lastanswer | 0.19 |
| ag_1_lastperiodmsec | 220 |
| ag_1_pingtripmsec | 10.004 |
| ag_1_errorsarow | 0 |
| ag_1_1periods_query_timeouts | 0 |
| ag_1_1periods_connect_timeouts | 0 |
| ag_1_1periods_connect_failures | 0 |
| ag_1_1periods_network_errors | 0 |
| ag_1_1periods_wrong_replies | 0 |
| ag_1_1periods_unexpected_closings | 0 |
| ag_1_1periods_warnings | 0 |
| ag_1_1periods_succeeded_queries | 27 |
| ag_1_1periods_msecsperquery | 231.24 |
| ag_1_5periods_query_timeouts | 0 |
| ag_1_5periods_connect_timeouts | 0 |
| ag_1_5periods_connect_failures | 0 |
| ag_1_5periods_network_errors | 0 |
| ag_1_5periods_wrong_replies | 0 |
| ag_1_5periods_unexpected_closings | 0 |
| ag_1_5periods_warnings | 0 |
| ag_1_5periods_succeeded_queries | 146 |
| ag_1_5periods_msecsperquery | 230.85 |
+------------------------------------+----------------------------+
50 rows in set (0.01 sec)Array(
[status_period_seconds] => 60
[status_stored_periods] => 15
[ag_0_hostname] => 192.168.0.202:6713
[ag_0_references] => 2
[ag_0_lastquery] => 0.41
[ag_0_lastanswer] => 0.19
[ag_0_lastperiodmsec] => 222
[ag_0_errorsarow] => 0
[ag_0_1periods_query_timeouts] => 0
[ag_0_1periods_connect_timeouts] => 0
[ag_0_1periods_connect_failures] => 0
[ag_0_1periods_network_errors] => 0
[ag_0_1periods_wrong_replies] => 0
[ag_0_1periods_unexpected_closings] => 0
[ag_0_1periods_warnings] => 0
[ag_0_1periods_succeeded_queries] => 27
[ag_0_1periods_msecsperquery] => 232.31
[ag_0_5periods_query_timeouts] => 0
[ag_0_5periods_connect_timeouts] => 0
[ag_0_5periods_connect_failures] => 0
[ag_0_5periods_network_errors] => 0
[ag_0_5periods_wrong_replies] => 0
[ag_0_5periods_unexpected_closings] => 0
[ag_0_5periods_warnings] => 0
[ag_0_5periods_succeeded_queries] => 146
[ag_0_5periods_msecsperquery] => 231.83
[ag_1_hostname 192.168.0.202:6714
[ag_1_references] => 2
[ag_1_lastquery] => 0.41
[ag_1_lastanswer] => 0.19
[ag_1_lastperiodmsec] => 220
[ag_1_errorsarow] => 0
[ag_1_1periods_query_timeouts] => 0
[ag_1_1periods_connect_timeouts] => 0
[ag_1_1periods_connect_failures] => 0
[ag_1_1periods_network_errors] => 0
[ag_1_1periods_wrong_replies] => 0
[ag_1_1periods_unexpected_closings] => 0
[ag_1_1periods_warnings] => 0
[ag_1_1periods_succeeded_queries] => 27
[ag_1_1periods_msecsperquery] => 231.24
[ag_1_5periods_query_timeouts] => 0
[ag_1_5periods_connect_timeouts] => 0
[ag_1_5periods_connect_failures] => 0
[ag_1_5periods_network_errors] => 0
[ag_1_5periods_wrong_replies] => 0
[ag_1_5periods_unexpected_closings
[ag_1_5periods_warnings] => 0
[ag_1_5periods_succeeded_queries] => 146
[ag_1_5periods_msecsperquery] => 230.85
){u'columns': [{u'Key': {u'type': u'string'}},
{u'Value': {u'type': u'string'}}],
u'data': [
{u'Key': u'status_period_seconds', u'Value': u'60'},
{u'Key': u'status_stored_periods', u'Value': u'15'},
{u'Key': u'ag_0_hostname', u'Value': u'192.168.0.202:6713'},
{u'Key': u'ag_0_references', u'Value': u'2'},
{u'Key': u'ag_0_lastquery', u'Value': u'0.41'},
{u'Key': u'ag_0_lastanswer', u'Value': u'0.19'},
{u'Key': u'ag_0_lastperiodmsec', u'Value': u'222'},
{u'Key': u'ag_0_errorsarow', u'Value': u'0'},
{u'Key': u'ag_0_1periods_query_timeouts', u'Value': u'0'},
{u'Key': u'ag_0_1periods_connect_timeouts', u'Value': u'0'},
{u'Key': u'ag_0_1periods_connect_failures', u'Value': u'0'},
{u'Key': u'ag_0_1periods_network_errors', u'Value': u'0'},
{u'Key': u'ag_0_1periods_wrong_replies', u'Value': u'0'},
{u'Key': u'ag_0_1periods_unexpected_closings', u'Value': u'0'},
{u'Key': u'ag_0_1periods_warnings', u'Value': u'0'},
{u'Key': u'ag_0_1periods_succeeded_queries', u'Value': u'27'},
{u'Key': u'ag_0_1periods_msecsperquery', u'Value': u'232.31'},
{u'Key': u'ag_0_5periods_query_timeouts', u'Value': u'0'},
{u'Key': u'ag_0_5periods_connect_timeouts', u'Value': u'0'},
{u'Key': u'ag_0_5periods_connect_failures', u'Value': u'0'},
{u'Key': u'ag_0_5periods_network_errors', u'Value': u'0'},
{u'Key': u'ag_0_5periods_wrong_replies', u'Value': u'0'},
{u'Key': u'ag_0_5periods_unexpected_closings', u'Value': u'0'},
{u'Key': u'ag_0_5periods_warnings', u'Value': u'0'},
{u'Key': u'ag_0_5periods_succeeded_queries', u'Value': u'146'},
{u'Key': u'ag_0_5periods_msecsperquery', u'Value': u'231.83'},
{u'Key': u'ag_1_hostname 192.168.0.202:6714'},
{u'Key': u'ag_1_references', u'Value': u'2'},
{u'Key': u'ag_1_lastquery', u'Value': u'0.41'},
{u'Key': u'ag_1_lastanswer', u'Value': u'0.19'},
{u'Key': u'ag_1_lastperiodmsec', u'Value': u'220'},
{u'Key': u'ag_1_errorsarow', u'Value': u'0'},
{u'Key': u'ag_1_1periods_query_timeouts', u'Value': u'0'},
{u'Key': u'ag_1_1periods_connect_timeouts', u'Value': u'0'},
{u'Key': u'ag_1_1periods_connect_failures', u'Value': u'0'},
{u'Key': u'ag_1_1periods_network_errors', u'Value': u'0'},
{u'Key': u'ag_1_1periods_wrong_replies', u'Value': u'0'},
{u'Key': u'ag_1_1periods_unexpected_closings', u'Value': u'0'},
{u'Key': u'ag_1_1periods_warnings', u'Value': u'0'},
{u'Key': u'ag_1_1periods_succeeded_queries', u'Value': u'27'},
{u'Key': u'ag_1_1periods_msecsperquery', u'Value': u'231.24'},
{u'Key': u'ag_1_5periods_query_timeouts', u'Value': u'0'},
{u'Key': u'ag_1_5periods_connect_timeouts', u'Value': u'0'},
{u'Key': u'ag_1_5periods_connect_failures', u'Value': u'0'},
{u'Key': u'ag_1_5periods_network_errors', u'Value': u'0'},
{u'Key': u'ag_1_5periods_wrong_replies', u'Value': u'0'},
{u'Key': u'ag_1_5periods_warnings', u'Value': u'0'},
{u'Key': u'ag_1_5periods_succeeded_queries', u'Value': u'146'},
{u'Key': u'ag_1_5periods_msecsperquery', u'Value': u'230.85'}],
u'error': u'',
u'total': 0,
u'warning': u''}{u'columns': [{u'Key': {u'type': u'string'}},
{u'Value': {u'type': u'string'}}],
u'data': [
{u'Key': u'status_period_seconds', u'Value': u'60'},
{u'Key': u'status_stored_periods', u'Value': u'15'},
{u'Key': u'ag_0_hostname', u'Value': u'192.168.0.202:6713'},
{u'Key': u'ag_0_references', u'Value': u'2'},
{u'Key': u'ag_0_lastquery', u'Value': u'0.41'},
{u'Key': u'ag_0_lastanswer', u'Value': u'0.19'},
{u'Key': u'ag_0_lastperiodmsec', u'Value': u'222'},
{u'Key': u'ag_0_errorsarow', u'Value': u'0'},
{u'Key': u'ag_0_1periods_query_timeouts', u'Value': u'0'},
{u'Key': u'ag_0_1periods_connect_timeouts', u'Value': u'0'},
{u'Key': u'ag_0_1periods_connect_failures', u'Value': u'0'},
{u'Key': u'ag_0_1periods_network_errors', u'Value': u'0'},
{u'Key': u'ag_0_1periods_wrong_replies', u'Value': u'0'},
{u'Key': u'ag_0_1periods_unexpected_closings', u'Value': u'0'},
{u'Key': u'ag_0_1periods_warnings', u'Value': u'0'},
{u'Key': u'ag_0_1periods_succeeded_queries', u'Value': u'27'},
{u'Key': u'ag_0_1periods_msecsperquery', u'Value': u'232.31'},
{u'Key': u'ag_0_5periods_query_timeouts', u'Value': u'0'},
{u'Key': u'ag_0_5periods_connect_timeouts', u'Value': u'0'},
{u'Key': u'ag_0_5periods_connect_failures', u'Value': u'0'},
{u'Key': u'ag_0_5periods_network_errors', u'Value': u'0'},
{u'Key': u'ag_0_5periods_wrong_replies', u'Value': u'0'},
{u'Key': u'ag_0_5periods_unexpected_closings', u'Value': u'0'},
{u'Key': u'ag_0_5periods_warnings', u'Value': u'0'},
{u'Key': u'ag_0_5periods_succeeded_queries', u'Value': u'146'},
{u'Key': u'ag_0_5periods_msecsperquery', u'Value': u'231.83'},
{u'Key': u'ag_1_hostname 192.168.0.202:6714'},
{u'Key': u'ag_1_references', u'Value': u'2'},
{u'Key': u'ag_1_lastquery', u'Value': u'0.41'},
{u'Key': u'ag_1_lastanswer', u'Value': u'0.19'},
{u'Key': u'ag_1_lastperiodmsec', u'Value': u'220'},
{u'Key': u'ag_1_errorsarow', u'Value': u'0'},
{u'Key': u'ag_1_1periods_query_timeouts', u'Value': u'0'},
{u'Key': u'ag_1_1periods_connect_timeouts', u'Value': u'0'},
{u'Key': u'ag_1_1periods_connect_failures', u'Value': u'0'},
{u'Key': u'ag_1_1periods_network_errors', u'Value': u'0'},
{u'Key': u'ag_1_1periods_wrong_replies', u'Value': u'0'},
{u'Key': u'ag_1_1periods_unexpected_closings', u'Value': u'0'},
{u'Key': u'ag_1_1periods_warnings', u'Value': u'0'},
{u'Key': u'ag_1_1periods_succeeded_queries', u'Value': u'27'},
{u'Key': u'ag_1_1periods_msecsperquery', u'Value': u'231.24'},
{u'Key': u'ag_1_5periods_query_timeouts', u'Value': u'0'},
{u'Key': u'ag_1_5periods_connect_timeouts', u'Value': u'0'},
{u'Key': u'ag_1_5periods_connect_failures', u'Value': u'0'},
{u'Key': u'ag_1_5periods_network_errors', u'Value': u'0'},
{u'Key': u'ag_1_5periods_wrong_replies', u'Value': u'0'},
{u'Key': u'ag_1_5periods_warnings', u'Value': u'0'},
{u'Key': u'ag_1_5periods_succeeded_queries', u'Value': u'146'},
{u'Key': u'ag_1_5periods_msecsperquery', u'Value': u'230.85'}],
u'error': u'',
u'total': 0,
u'warning': u''}{
"columns":
[{
"Key":
{
"type": "string"
}
},
{
"Value":
{
"type": "string"
}
}],
"data":
[
{"Key": "status_period_seconds", "Value": "60"},
{"Key": "status_stored_periods", "Value": "15"},
{"Key": "ag_0_hostname", "Value": "192.168.0.202:6713"},
{"Key": "ag_0_references", "Value": "2"},
{"Key": "ag_0_lastquery", "Value": "0.41"},
{"Key": "ag_0_lastanswer", "Value": "0.19"},
{"Key": "ag_0_lastperiodmsec", "Value": "222"},
{"Key": "ag_0_errorsarow", "Value": "0"},
{"Key": "ag_0_1periods_query_timeouts", "Value": "0"},
{"Key": "ag_0_1periods_connect_timeouts", "Value": "0"},
{"Key": "ag_0_1periods_connect_failures", "Value": "0"},
{"Key": "ag_0_1periods_network_errors", "Value": "0"},
{"Key": "ag_0_1periods_wrong_replies", "Value": "0"},
{"Key": "ag_0_1periods_unexpected_closings", "Value": "0"},
{"Key": "ag_0_1periods_warnings", "Value": "0"},
{"Key": "ag_0_1periods_succeeded_queries", "Value": "27"},
{"Key": "ag_0_1periods_msecsperquery", "Value": "232.31"},
{"Key": "ag_0_5periods_query_timeouts", "Value": "0"},
{"Key": "ag_0_5periods_connect_timeouts", "Value": "0"},
{"Key": "ag_0_5periods_connect_failures", "Value": "0"},
{"Key": "ag_0_5periods_network_errors", "Value": "0"},
{"Key": "ag_0_5periods_wrong_replies", "Value": "0"},
{"Key": "ag_0_5periods_unexpected_closings", "Value": "0"},
{"Key": "ag_0_5periods_warnings", "Value": "0"},
{"Key": "ag_0_5periods_succeeded_queries", "Value": "146"},
{"Key": "ag_0_5periods_msecsperquery", "Value": "231.83"},
{"Key": "ag_1_hostname 192.168.0.202:6714"},
{"Key": "ag_1_references", "Value": "2"},
{"Key": "ag_1_lastquery", "Value": "0.41"},
{"Key": "ag_1_lastanswer", "Value": "0.19"},
{"Key": "ag_1_lastperiodmsec", "Value": "220"},
{"Key": "ag_1_errorsarow", "Value": "0"},
{"Key": "ag_1_1periods_query_timeouts", "Value": "0"},
{"Key": "ag_1_1periods_connect_timeouts", "Value": "0"},
{"Key": "ag_1_1periods_connect_failures", "Value": "0"},
{"Key": "ag_1_1periods_network_errors", "Value": "0"},
{"Key": "ag_1_1periods_wrong_replies", "Value": "0"},
{"Key": "ag_1_1periods_unexpected_closings", "Value": "0"},
{"Key": "ag_1_1periods_warnings", "Value": "0"},
{"Key": "ag_1_1periods_succeeded_queries", "Value": "27"},
{"Key": "ag_1_1periods_msecsperquery", "Value": "231.24"},
{"Key": "ag_1_5periods_query_timeouts", "Value": "0"},
{"Key": "ag_1_5periods_connect_timeouts", "Value": "0"},
{"Key": "ag_1_5periods_connect_failures", "Value": "0"},
{"Key": "ag_1_5periods_network_errors", "Value": "0"},
{"Key": "ag_1_5periods_wrong_replies", "Value": "0"},
{"Key": "ag_1_5periods_warnings", "Value": "0"},
{"Key": "ag_1_5periods_succeeded_queries", "Value": "146"},
{"Key": "ag_1_5periods_msecsperquery", "Value": "230.85"}
],
"error": "",
"total": 0,
"warning": ""
}{columns=[{ Key : { type=string }},
{ Value : { type=string }}],
data : [
{ Key=status_period_seconds , Value=60 },
{ Key=status_stored_periods , Value=15 },
{ Key=ag_0_hostname , Value=192.168.0.202:6713 },
{ Key=ag_0_references , Value=2 },
{ Key=ag_0_lastquery , Value=0.41 },
{ Key=ag_0_lastanswer , Value=0.19 },
{ Key=ag_0_lastperiodmsec , Value=222 },
{ Key=ag_0_errorsarow , Value=0 },
{ Key=ag_0_1periods_query_timeouts , Value=0 },
{ Key=ag_0_1periods_connect_timeouts , Value=0 },
{ Key=ag_0_1periods_connect_failures , Value=0 },
{ Key=ag_0_1periods_network_errors , Value=0 },
{ Key=ag_0_1periods_wrong_replies , Value=0 },
{ Key=ag_0_1periods_unexpected_closings , Value=0 },
{ Key=ag_0_1periods_warnings , Value=0 },
{ Key=ag_0_1periods_succeeded_queries , Value=27 },
{ Key=ag_0_1periods_msecsperquery , Value=232.31 },
{ Key=ag_0_5periods_query_timeouts , Value=0 },
{ Key=ag_0_5periods_connect_timeouts , Value=0 },
{ Key=ag_0_5periods_connect_failures , Value=0 },
{ Key=ag_0_5periods_network_errors , Value=0 },
{ Key=ag_0_5periods_wrong_replies , Value=0 },
{ Key=ag_0_5periods_unexpected_closings , Value=0 },
{ Key=ag_0_5periods_warnings , Value=0 },
{ Key=ag_0_5periods_succeeded_queries , Value=146 },
{ Key=ag_0_5periods_msecsperquery , Value=231.83 },
{ Key=ag_1_hostname 192.168.0.202:6714 },
{ Key=ag_1_references , Value=2 },
{ Key=ag_1_lastquery , Value=0.41 },
{ Key=ag_1_lastanswer , Value=0.19 },
{ Key=ag_1_lastperiodmsec , Value=220 },
{ Key=ag_1_errorsarow , Value=0 },
{ Key=ag_1_1periods_query_timeouts , Value=0 },
{ Key=ag_1_1periods_connect_timeouts , Value=0 },
{ Key=ag_1_1periods_connect_failures , Value=0 },
{ Key=ag_1_1periods_network_errors , Value=0 },
{ Key=ag_1_1periods_wrong_replies , Value=0 },
{ Key=ag_1_1periods_unexpected_closings , Value=0 },
{ Key=ag_1_1periods_warnings , Value=0 },
{ Key=ag_1_1periods_succeeded_queries , Value=27 },
{ Key=ag_1_1periods_msecsperquery , Value=231.24 },
{ Key=ag_1_5periods_query_timeouts , Value=0 },
{ Key=ag_1_5periods_connect_timeouts , Value=0 },
{ Key=ag_1_5periods_connect_failures , Value=0 },
{ Key=ag_1_5periods_network_errors , Value=0 },
{ Key=ag_1_5periods_wrong_replies , Value=0 },
{ Key=ag_1_5periods_warnings , Value=0 },
{ Key=ag_1_5periods_succeeded_queries , Value=146 },
{ Key=ag_1_5periods_msecsperquery , Value=230.85 }],
error= ,
total=0,
warning= }{columns=[{ Key : { type=string }},
{ Value : { type=string }}],
data : [
{ Key=status_period_seconds , Value=60 },
{ Key=status_stored_periods , Value=15 },
{ Key=ag_0_hostname , Value=192.168.0.202:6713 },
{ Key=ag_0_references , Value=2 },
{ Key=ag_0_lastquery , Value=0.41 },
{ Key=ag_0_lastanswer , Value=0.19 },
{ Key=ag_0_lastperiodmsec , Value=222 },
{ Key=ag_0_errorsarow , Value=0 },
{ Key=ag_0_1periods_query_timeouts , Value=0 },
{ Key=ag_0_1periods_connect_timeouts , Value=0 },
{ Key=ag_0_1periods_connect_failures , Value=0 },
{ Key=ag_0_1periods_network_errors , Value=0 },
{ Key=ag_0_1periods_wrong_replies , Value=0 },
{ Key=ag_0_1periods_unexpected_closings , Value=0 },
{ Key=ag_0_1periods_warnings , Value=0 },
{ Key=ag_0_1periods_succeeded_queries , Value=27 },
{ Key=ag_0_1periods_msecsperquery , Value=232.31 },
{ Key=ag_0_5periods_query_timeouts , Value=0 },
{ Key=ag_0_5periods_connect_timeouts , Value=0 },
{ Key=ag_0_5periods_connect_failures , Value=0 },
{ Key=ag_0_5periods_network_errors , Value=0 },
{ Key=ag_0_5periods_wrong_replies , Value=0 },
{ Key=ag_0_5periods_unexpected_closings , Value=0 },
{ Key=ag_0_5periods_warnings , Value=0 },
{ Key=ag_0_5periods_succeeded_queries , Value=146 },
{ Key=ag_0_5periods_msecsperquery , Value=231.83 },
{ Key=ag_1_hostname 192.168.0.202:6714 },
{ Key=ag_1_references , Value=2 },
{ Key=ag_1_lastquery , Value=0.41 },
{ Key=ag_1_lastanswer , Value=0.19 },
{ Key=ag_1_lastperiodmsec , Value=220 },
{ Key=ag_1_errorsarow , Value=0 },
{ Key=ag_1_1periods_query_timeouts , Value=0 },
{ Key=ag_1_1periods_connect_timeouts , Value=0 },
{ Key=ag_1_1periods_connect_failures , Value=0 },
{ Key=ag_1_1periods_network_errors , Value=0 },
{ Key=ag_1_1periods_wrong_replies , Value=0 },
{ Key=ag_1_1periods_unexpected_closings , Value=0 },
{ Key=ag_1_1periods_warnings , Value=0 },
{ Key=ag_1_1periods_succeeded_queries , Value=27 },
{ Key=ag_1_1periods_msecsperquery , Value=231.24 },
{ Key=ag_1_5periods_query_timeouts , Value=0 },
{ Key=ag_1_5periods_connect_timeouts , Value=0 },
{ Key=ag_1_5periods_connect_failures , Value=0 },
{ Key=ag_1_5periods_network_errors , Value=0 },
{ Key=ag_1_5periods_wrong_replies , Value=0 },
{ Key=ag_1_5periods_warnings , Value=0 },
{ Key=ag_1_5periods_succeeded_queries , Value=146 },
{ Key=ag_1_5periods_msecsperquery , Value=230.85 }],
error="" ,
total=0,
warning="" }{columns=[{ Key : { type=string }},
{ Value : { type=string }}],
data : [
{ Key=status_period_seconds , Value=60 },
{ Key=status_stored_periods , Value=15 },
{ Key=ag_0_hostname , Value=192.168.0.202:6713 },
{ Key=ag_0_references , Value=2 },
{ Key=ag_0_lastquery , Value=0.41 },
{ Key=ag_0_lastanswer , Value=0.19 },
{ Key=ag_0_lastperiodmsec , Value=222 },
{ Key=ag_0_errorsarow , Value=0 },
{ Key=ag_0_1periods_query_timeouts , Value=0 },
{ Key=ag_0_1periods_connect_timeouts , Value=0 },
{ Key=ag_0_1periods_connect_failures , Value=0 },
{ Key=ag_0_1periods_network_errors , Value=0 },
{ Key=ag_0_1periods_wrong_replies , Value=0 },
{ Key=ag_0_1periods_unexpected_closings , Value=0 },
{ Key=ag_0_1periods_warnings , Value=0 },
{ Key=ag_0_1periods_succeeded_queries , Value=27 },
{ Key=ag_0_1periods_msecsperquery , Value=232.31 },
{ Key=ag_0_5periods_query_timeouts , Value=0 },
{ Key=ag_0_5periods_connect_timeouts , Value=0 },
{ Key=ag_0_5periods_connect_failures , Value=0 },
{ Key=ag_0_5periods_network_errors , Value=0 },
{ Key=ag_0_5periods_wrong_replies , Value=0 },
{ Key=ag_0_5periods_unexpected_closings , Value=0 },
{ Key=ag_0_5periods_warnings , Value=0 },
{ Key=ag_0_5periods_succeeded_queries , Value=146 },
{ Key=ag_0_5periods_msecsperquery , Value=231.83 },
{ Key=ag_1_hostname 192.168.0.202:6714 },
{ Key=ag_1_references , Value=2 },
{ Key=ag_1_lastquery , Value=0.41 },
{ Key=ag_1_lastanswer , Value=0.19 },
{ Key=ag_1_lastperiodmsec , Value=220 },
{ Key=ag_1_errorsarow , Value=0 },
{ Key=ag_1_1periods_query_timeouts , Value=0 },
{ Key=ag_1_1periods_connect_timeouts , Value=0 },
{ Key=ag_1_1periods_connect_failures , Value=0 },
{ Key=ag_1_1periods_network_errors , Value=0 },
{ Key=ag_1_1periods_wrong_replies , Value=0 },
{ Key=ag_1_1periods_unexpected_closings , Value=0 },
{ Key=ag_1_1periods_warnings , Value=0 },
{ Key=ag_1_1periods_succeeded_queries , Value=27 },
{ Key=ag_1_1periods_msecsperquery , Value=231.24 },
{ Key=ag_1_5periods_query_timeouts , Value=0 },
{ Key=ag_1_5periods_connect_timeouts , Value=0 },
{ Key=ag_1_5periods_connect_failures , Value=0 },
{ Key=ag_1_5periods_network_errors , Value=0 },
{ Key=ag_1_5periods_wrong_replies , Value=0 },
{ Key=ag_1_5periods_warnings , Value=0 },
{ Key=ag_1_5periods_succeeded_queries , Value=146 },
{ Key=ag_1_5periods_msecsperquery , Value=230.85 }],
error="" ,
total=0,
warning="" }{
"columns":
[{
"Key":
{
"type": "string"
}
},
{
"Value":
{
"type": "string"
}
}],
"data":
[
{"Key": "status_period_seconds", "Value": "60"},
{"Key": "status_stored_periods", "Value": "15"},
{"Key": "ag_0_hostname", "Value": "192.168.0.202:6713"},
{"Key": "ag_0_references", "Value": "2"},
{"Key": "ag_0_lastquery", "Value": "0.41"},
{"Key": "ag_0_lastanswer", "Value": "0.19"},
{"Key": "ag_0_lastperiodmsec", "Value": "222"},
{"Key": "ag_0_errorsarow", "Value": "0"},
{"Key": "ag_0_1periods_query_timeouts", "Value": "0"},
{"Key": "ag_0_1periods_connect_timeouts", "Value": "0"},
{"Key": "ag_0_1periods_connect_failures", "Value": "0"},
{"Key": "ag_0_1periods_network_errors", "Value": "0"},
{"Key": "ag_0_1periods_wrong_replies", "Value": "0"},
{"Key": "ag_0_1periods_unexpected_closings", "Value": "0"},
{"Key": "ag_0_1periods_warnings", "Value": "0"},
{"Key": "ag_0_1periods_succeeded_queries", "Value": "27"},
{"Key": "ag_0_1periods_msecsperquery", "Value": "232.31"},
{"Key": "ag_0_5periods_query_timeouts", "Value": "0"},
{"Key": "ag_0_5periods_connect_timeouts", "Value": "0"},
{"Key": "ag_0_5periods_connect_failures", "Value": "0"},
{"Key": "ag_0_5periods_network_errors", "Value": "0"},
{"Key": "ag_0_5periods_wrong_replies", "Value": "0"},
{"Key": "ag_0_5periods_unexpected_closings", "Value": "0"},
{"Key": "ag_0_5periods_warnings", "Value": "0"},
{"Key": "ag_0_5periods_succeeded_queries", "Value": "146"},
{"Key": "ag_0_5periods_msecsperquery", "Value": "231.83"},
{"Key": "ag_1_hostname 192.168.0.202:6714"},
{"Key": "ag_1_references", "Value": "2"},
{"Key": "ag_1_lastquery", "Value": "0.41"},
{"Key": "ag_1_lastanswer", "Value": "0.19"},
{"Key": "ag_1_lastperiodmsec", "Value": "220"},
{"Key": "ag_1_errorsarow", "Value": "0"},
{"Key": "ag_1_1periods_query_timeouts", "Value": "0"},
{"Key": "ag_1_1periods_connect_timeouts", "Value": "0"},
{"Key": "ag_1_1periods_connect_failures", "Value": "0"},
{"Key": "ag_1_1periods_network_errors", "Value": "0"},
{"Key": "ag_1_1periods_wrong_replies", "Value": "0"},
{"Key": "ag_1_1periods_unexpected_closings", "Value": "0"},
{"Key": "ag_1_1periods_warnings", "Value": "0"},
{"Key": "ag_1_1periods_succeeded_queries", "Value": "27"},
{"Key": "ag_1_1periods_msecsperquery", "Value": "231.24"},
{"Key": "ag_1_5periods_query_timeouts", "Value": "0"},
{"Key": "ag_1_5periods_connect_timeouts", "Value": "0"},
{"Key": "ag_1_5periods_connect_failures", "Value": "0"},
{"Key": "ag_1_5periods_network_errors", "Value": "0"},
{"Key": "ag_1_5periods_wrong_replies", "Value": "0"},
{"Key": "ag_1_5periods_warnings", "Value": "0"},
{"Key": "ag_1_5periods_succeeded_queries", "Value": "146"},
{"Key": "ag_1_5periods_msecsperquery", "Value": "230.85"}
],
"error": "",
"total": 0,
"warning": ""
}Поддерживается необязательный оператор LIKE, синтаксис которого такой же, как в SHOW STATUS.
- SQL
- PHP
- Python
- Python-asyncio
- javascript
- Java
- C#
- Rust
- TypeScript
- Go
SHOW AGENT STATUS LIKE '%5period%msec%';$client->nodes()->agentstatus(
['body'=>
['pattern'=>'%5period%msec%']
]
);utilsApi.sql('SHOW AGENT STATUS LIKE \'%5period%msec%\'')await utilsApi.sql('SHOW AGENT STATUS LIKE \'%5period%msec%\'')res = await utilsApi.sql("SHOW AGENT STATUS LIKE \"%5period%msec%\"");utilsApi.sql("SHOW AGENT STATUS LIKE \"%5period%msec%\"");utilsApi.Sql("SHOW AGENT STATUS LIKE \"%5period%msec%\"");utils_api.sql("SHOW AGENT STATUS LIKE \"%5period%msec%\"", Some(true)).await;res = await utilsApi.sql("SHOW AGENT STATUS LIKE \"%5period%msec%\"");apiClient.UtilsAPI.Sql(context.Background()).Body("SHOW AGENT STATUS LIKE \"%5period%msec%\"").Execute()+-----------------------------+--------+
| Key | Value |
+-----------------------------+--------+
| ag_0_5periods_msecsperquery | 234.72 |
| ag_1_5periods_msecsperquery | 233.73 |
| ag_2_5periods_msecsperquery | 343.81 |
+-----------------------------+--------+
3 rows in set (0.00 sec)Array(
[ag_0_5periods_msecsperquery] => 234.72
[ag_1_5periods_msecsperquery] => 233.73
[ag_2_5periods_msecsperquery] => 343.81
){u'columns': [{u'Key': {u'type': u'string'}},
{u'Value': {u'type': u'string'}}],
u'data': [
{u'Key': u'ag_0_5periods_msecsperquery', u'Value': u'234.72'},
{u'Key': u'ag_1_5periods_msecsperquery', u'Value': u'233.73'},
{u'Key': u'ag_2_5periods_msecsperquery', u'Value': u'343.81'}],
u'error': u'',
u'total': 0,
u'warning': u''}{u'columns': [{u'Key': {u'type': u'string'}},
{u'Value': {u'type': u'string'}}],
u'data': [
{u'Key': u'ag_0_5periods_msecsperquery', u'Value': u'234.72'},
{u'Key': u'ag_1_5periods_msecsperquery', u'Value': u'233.73'},
{u'Key': u'ag_2_5periods_msecsperquery', u'Value': u'343.81'}],
u'error': u'',
u'total': 0,
u'warning': u''}{"columns": [{"Key": {"type": "string"}},
{"Value": {"type": "string"}}],
"data": [
{"Key": "ag_0_5periods_msecsperquery", "Value": "234.72"},
{"Key": "ag_1_5periods_msecsperquery", "Value": "233.73"},
{"Key": "ag_2_5periods_msecsperquery", "Value": "343.81"}],
"error": "",
"total": 0,
"warning": ""}{columns: [{Key={type=string}},
{Value={type=string}}],
data: [
{Key=ag_0_5periods_msecsperquery, Value=234.72},
{Key=ag_1_5periods_msecsperquery, Value=233.73},
{Key=ag_2_5periods_msecsperquery, Value=343.81}],
error: ,
total: 0,
warning: }{columns: [{Key={type=string}},
{Value={type=string}}],
data: [
{Key=ag_0_5periods_msecsperquery, Value=234.72},
{Key=ag_1_5periods_msecsperquery, Value=233.73},
{Key=ag_2_5periods_msecsperquery, Value=343.81}],
error: "",
total: 0,
warning: ""}{columns: [{Key={type=string}},
{Value={type=string}}],
data: [
{Key=ag_0_5periods_msecsperquery, Value=234.72},
{Key=ag_1_5periods_msecsperquery, Value=233.73},
{Key=ag_2_5periods_msecsperquery, Value=343.81}],
error: "",
total: 0,
warning: ""}{
"columns":
[{
"Key": {"type": "string"}
},
{
"Value": {"type": "string"}
}],
"data":
[
{"Key": "ag_0_5periods_msecsperquery", "Value": "234.72"},
{"Key": "ag_1_5periods_msecsperquery", "Value": "233.73"},
{"Key": "ag_2_5periods_msecsperquery", "Value": "343.81"}
],
"error": "",
"total": 0,
"warning": ""
}{
"columns":
[{
"Key": {"type": "string"}
},
{
"Value": {"type": "string"}
}],
"data":
[
{"Key": "ag_0_5periods_msecsperquery", "Value": "234.72"},
{"Key": "ag_1_5periods_msecsperquery", "Value": "233.73"},
{"Key": "ag_2_5periods_msecsperquery", "Value": "343.81"}
],
"error": "",
"total": 0,
"warning": ""
}You can specify a particular agent by its address. In this case, only that agent's data will be displayed. Additionally, the agent_ prefix will be used instead of ag_N_:
- SQL
- PHP
- Python
- Python-asyncio
- javascript
- Java
- C#
- Rust
- TypeScript
- Go
SHOW AGENT '192.168.0.202:6714' STATUS LIKE '%15periods%';$client->nodes()->agentstatus(
['body'=>
['agent'=>'192.168.0.202:6714'],
['pattern'=>'%5period%msec%']
]
);utilsApi.sql('SHOW AGENT \'192.168.0.202:6714\' STATUS LIKE \'%15periods%\'')await utilsApi.sql('SHOW AGENT \'192.168.0.202:6714\' STATUS LIKE \'%15periods%\'')res = await utilsApi.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");utilsApi.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");utilsApi.Sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");utils_api.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"", Some(true)).await;res = await utilsApi.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");apiClient.UtilsAPI.Sql(context.Background()).Body("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\").Execute()+-------------------------------------+--------+
| Variable_name | Value |
+-------------------------------------+--------+
| agent_15periods_query_timeouts | 0 |
| agent_15periods_connect_timeouts | 0 |
| agent_15periods_connect_failures | 0 |
| agent_15periods_network_errors | 0 |
| agent_15periods_wrong_replies | 0 |
| agent_15periods_unexpected_closings | 0 |
| agent_15periods_warnings | 0 |
| agent_15periods_succeeded_queries | 439 |
| agent_15periods_msecsperquery | 231.73 |
+-------------------------------------+--------+
9 rows in set (0.00 sec)Array(
[agent_15periods_query_timeouts] => 0
[agent_15periods_connect_timeouts] => 0
[agent_15periods_connect_failures] => 0
[agent_15periods_network_errors] => 0
[agent_15periods_wrong_replies] => 0
[agent_15periods_unexpected_closings] => 0
[agent_15periods_warnings] => 0
[agent_15periods_succeeded_queries] => 439
[agent_15periods_msecsperquery] => 231.73
){u'columns': [{u'Key': {u'type': u'string'}},
{u'Value': {u'type': u'string'}}],
u'data': [
{u'Key': u'agent_15periods_query_timeouts', u'Value': u'0'},
{u'Key': u'agent_15periods_connect_timeouts', u'Value': u'0'},
{u'Key': u'agent_15periods_connect_failures', u'Value': u'0'},
{u'Key': u'agent_15periods_network_errors', u'Value': u'0'},
{u'Key': u'agent_15periods_connect_failures', u'Value': u'0'},
{u'Key': u'agent_15periods_wrong_replies', u'Value': u'0'},
{u'Key': u'agent_15periods_unexpected_closings', u'Value': u'0'},
{u'Key': u'agent_15periods_warnings', u'Value': u'0'},
{u'Key': u'agent_15periods_succeeded_queries', u'Value': u'439'},
{u'Key': u'agent_15periods_msecsperquery', u'Value': u'233.73'},
],
u'error': u'',
u'total': 0,
u'warning': u''}{u'columns': [{u'Key': {u'type': u'string'}},
{u'Value': {u'type': u'string'}}],
u'data': [
{u'Key': u'agent_15periods_query_timeouts', u'Value': u'0'},
{u'Key': u'agent_15periods_connect_timeouts', u'Value': u'0'},
{u'Key': u'agent_15periods_connect_failures', u'Value': u'0'},
{u'Key': u'agent_15periods_network_errors', u'Value': u'0'},
{u'Key': u'agent_15periods_connect_failures', u'Value': u'0'},
{u'Key': u'agent_15periods_wrong_replies', u'Value': u'0'},
{u'Key': u'agent_15periods_unexpected_closings', u'Value': u'0'},
{u'Key': u'agent_15periods_warnings', u'Value': u'0'},
{u'Key': u'agent_15periods_succeeded_queries', u'Value': u'439'},
{u'Key': u'agent_15periods_msecsperquery', u'Value': u'233.73'},
],
u'error': u'',
u'total': 0,
u'warning': u''}{"columns": [{"Key": {"type": "string"}},
{"Value": {"type": "string"}}],
"data": [
{"Key": "agent_15periods_query_timeouts", "Value": "0"},
{"Key": "agent_15periods_connect_timeouts", "Value": "0"},
{"Key": "agent_15periods_connect_failures", "Value": "0"},
{"Key": "agent_15periods_network_errors", "Value": "0"},
{"Key": "agent_15periods_connect_failures", "Value": "0"},
{"Key": "agent_15periods_wrong_replies", "Value": "0"},
{"Key": "agent_15periods_unexpected_closings", "Value": "0"},
{"Key": "agent_15periods_warnings", "Value": "0"},
{"Key": "agent_15periods_succeeded_queries", "Value": "439"},
{"Key": "agent_15periods_msecsperquery", "Value": "233.73"},
],
"error": "",
"total": 0,
"warning": ""}{columns=[{Key={type=string}},
{Value={type=string}}],
data=[
{Key=agent_15periods_query_timeouts, Value=0},
{Key=agent_15periods_connect_timeouts, Value=0},
{Key=agent_15periods_connect_failures, Value=0},
{Key=agent_15periods_network_errors, Value=0},
{Key=agent_15periods_connect_failures, Value=0},
{Key=agent_15periods_wrong_replies, Value=0},
{Key=agent_15periods_unexpected_closings, Value=0},
{Key=agent_15periods_warnings, Value=0},
{Key=agent_15periods_succeeded_queries, Value=439},
{Key=agent_15periods_msecsperquery, Value=233.73},
],
error=,
total=0,
warning=}{columns=[{Key={type=string}},
{Value={type=string}}],
data=[
{Key=agent_15periods_query_timeouts, Value=0},
{Key=agent_15periods_connect_timeouts, Value=0},
{Key=agent_15periods_connect_failures, Value=0},
{Key=agent_15periods_network_errors, Value=0},
{Key=agent_15periods_connect_failures, Value=0},
{Key=agent_15periods_wrong_replies, Value=0},
{Key=agent_15periods_unexpected_closings, Value=0},
{Key=agent_15periods_warnings, Value=0},
{Key=agent_15periods_succeeded_queries, Value=439},
{Key=agent_15periods_msecsperquery, Value=233.73},
],
error="",
total=0,
warning=""}{columns=[{Key={type=string}},
{Value={type=string}}],
data=[
{Key=agent_15periods_query_timeouts, Value=0},
{Key=agent_15periods_connect_timeouts, Value=0},
{Key=agent_15periods_connect_failures, Value=0},
{Key=agent_15periods_network_errors, Value=0},
{Key=agent_15periods_connect_failures, Value=0},
{Key=agent_15periods_wrong_replies, Value=0},
{Key=agent_15periods_unexpected_closings, Value=0},
{Key=agent_15periods_warnings, Value=0},
{Key=agent_15periods_succeeded_queries, Value=439},
{Key=agent_15periods_msecsperquery, Value=233.73},
],
error="",
total=0,
warning=""}{
"columns":
[{
{"Key": {"type": "string"}
},
{"Value": {"type": "string"}
}],
"data":
[
{"Key": "agent_15periods_query_timeouts", "Value": "0"},
{"Key": "agent_15periods_connect_timeouts", "Value": "0"},
{"Key": "agent_15periods_connect_failures", "Value": "0"},
{"Key": "agent_15periods_network_errors", "Value": "0"},
{"Key": "agent_15periods_connect_failures", "Value": "0"},
{"Key": "agent_15periods_wrong_replies", "Value": "0"},
{"Key": "agent_15periods_unexpected_closings", "Value": "0"},
{"Key": "agent_15periods_warnings", "Value": "0"},
{"Key": "agent_15periods_succeeded_queries", "Value": "439"},
{"Key": "agent_15periods_msecsperquery", "Value": "233.73"},
],
"error": "",
"total": 0,
"warning": ""
}{
"columns":
[{
{"Key": {"type": "string"}
},
{"Value": {"type": "string"}
}],
"data":
[
{"Key": "agent_15periods_query_timeouts", "Value": "0"},
{"Key": "agent_15periods_connect_timeouts", "Value": "0"},
{"Key": "agent_15periods_connect_failures", "Value": "0"},
{"Key": "agent_15periods_network_errors", "Value": "0"},
{"Key": "agent_15periods_connect_failures", "Value": "0"},
{"Key": "agent_15periods_wrong_replies", "Value": "0"},
{"Key": "agent_15periods_unexpected_closings", "Value": "0"},
{"Key": "agent_15periods_warnings", "Value": "0"},
{"Key": "agent_15periods_succeeded_queries", "Value": "439"},
{"Key": "agent_15periods_msecsperquery", "Value": "233.73"},
],
"error": "",
"total": 0,
"warning": ""
}Finally, you can check the status of the agents in a specific distributed table using the SHOW AGENT table_name STATUS statement. This statement displays the table's HA status (i.e., whether or not it uses agent mirrors at all) and provides information on the mirrors, including: address, blackhole and persistent flags, and the mirror selection probability used when one of the weighted probability strategies is in effect.
- SQL
- PHP
- Python
- Python-asyncio
- javascript
- Java
- C#
- Rust
- TypeScript
- Go
SHOW AGENT dist_index STATUS;$client->nodes()->agentstatus(
['body'=>
['agent'=>'dist_index']
]
);utilsApi.sql('SHOW AGENT \'192.168.0.202:6714\' STATUS LIKE \'%15periods%\'')await utilsApi.sql('SHOW AGENT \'192.168.0.202:6714\' STATUS LIKE \'%15periods%\'')res = await utilsApi.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");utilsApi.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");utilsApi.Sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");utils_api.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"", Some(true)).await;res = await utilsApi.sql("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"");apiClient.UtilsAPI.Sql(context.Background()).Body("SHOW AGENT \"192.168.0.202:6714\" STATUS LIKE \"%15periods%\"").Execute()+--------------------------------------+--------------------------------+
| Variable_name | Value |
+--------------------------------------+--------------------------------+
| dstindex_1_is_ha | 1 |
| dstindex_1mirror1_id | 192.168.0.202:6713:loc |
| dstindex_1mirror1_probability_weight | 0.372864 |
| dstindex_1mirror1_is_blackhole | 0 |
| dstindex_1mirror1_is_persistent | 0 |
| dstindex_1mirror2_id | 192.168.0.202:6714:loc |
| dstindex_1mirror2_probability_weight | 0.374635 |
| dstindex_1mirror2_is_blackhole | 0 |
| dstindex_1mirror2_is_persistent | 0 |
| dstindex_1mirror3_id | dev1.manticoresearch.com:6714:loc |
| dstindex_1mirror3_probability_weight | 0.252501 |
| dstindex_1mirror3_is_blackhole | 0 |
| dstindex_1mirror3_is_persistent | 0 |
+--------------------------------------+--------------------------------+
13 rows in set (0.00 sec)Array(
[dstindex_1_is_ha] => 1
[dstindex_1mirror1_id] => 192.168.0.202:6713:loc
[dstindex_1mirror1_probability_weight] => 0.372864
[dstindex_1mirror1_is_blackhole] => 0
[dstindex_1mirror1_is_persistent] => 0
[dstindex_1mirror2_id] => 192.168.0.202:6714:loc
[dstindex_1mirror2_probability_weight] => 0.374635
[dstindex_1mirror2_is_blackhole] => 0
[dstindex_1mirror2_is_persistent] => 0
[dstindex_1mirror3_id] => dev1.manticoresearch.com:6714:loc
[dstindex_1mirror3_probability_weight] => 0.252501
[dstindex_1mirror3_is_blackhole] => 0
[dstindex_1mirror3_is_persistent] => 0
){u'columns': [{u'Key': {u'type': u'string'}},
{u'Value': {u'type': u'string'}}],
u'data': [
{u'Key': u'dstindex_1_is_ha', u'Value': u'1'},
{u'Key': u'dstindex_1mirror1_id', u'Value': u'192.168.0.202:6713:loc'},
{u'Key': u'dstindex_1mirror1_probability_weight', u'Value': u'0.372864'},
{u'Key': u'dstindex_1mirror1_is_blackhole', u'Value': u'0'},
{u'Key': u'dstindex_1mirror1_is_persistent', u'Value': u'0'},
{u'Key': u'dstindex_1mirror2_id', u'Value': u'192.168.0.202:6714:loc'},
{u'Key': u'dstindex_1mirror2_probability_weight', u'Value': u'0.374635'},
{u'Key': u'dstindex_1mirror2_is_blackhole', u'Value': u'0'},
{u'Key': u'dstindex_1mirror2_is_persistent', u'Value': u'439'},
{u'Key': u'dstindex_1mirror3_id', u'Value': u'dev1.manticoresearch.com:6714:loc'},
{u'Key': u'dstindex_1mirror3_probability_weight', u'Value': u' 0.252501'},
{u'Key': u'dstindex_1mirror3_is_blackhole', u'Value': u'0'},
{u'Key': u'dstindex_1mirror3_is_persistent', u'Value': u'439'}
],
u'error': u'',
u'total': 0,
u'warning': u''}{u'columns': [{u'Key': {u'type': u'string'}},
{u'Value': {u'type': u'string'}}],
u'data': [
{u'Key': u'dstindex_1_is_ha', u'Value': u'1'},
{u'Key': u'dstindex_1mirror1_id', u'Value': u'192.168.0.202:6713:loc'},
{u'Key': u'dstindex_1mirror1_probability_weight', u'Value': u'0.372864'},
{u'Key': u'dstindex_1mirror1_is_blackhole', u'Value': u'0'},
{u'Key': u'dstindex_1mirror1_is_persistent', u'Value': u'0'},
{u'Key': u'dstindex_1mirror2_id', u'Value': u'192.168.0.202:6714:loc'},
{u'Key': u'dstindex_1mirror2_probability_weight', u'Value': u'0.374635'},
{u'Key': u'dstindex_1mirror2_is_blackhole', u'Value': u'0'},
{u'Key': u'dstindex_1mirror2_is_persistent', u'Value': u'439'},
{u'Key': u'dstindex_1mirror3_id', u'Value': u'dev1.manticoresearch.com:6714:loc'},
{u'Key': u'dstindex_1mirror3_probability_weight', u'Value': u' 0.252501'},
{u'Key': u'dstindex_1mirror3_is_blackhole', u'Value': u'0'},
{u'Key': u'dstindex_1mirror3_is_persistent', u'Value': u'439'}
],
u'error': u'',
u'total': 0,
u'warning': u''}{"columns": [{"Key": {"type": "string"}},
{"Value": {"type": "string"}}],
"data": [
{"Key": "dstindex_1_is_ha", "Value": "1"},
{"Key": "dstindex_1mirror1_id", "Value": "192.168.0.202:6713:loc"},
{"Key": "dstindex_1mirror1_probability_weight", "Value": "0.372864"},
{"Key": "dstindex_1mirror1_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror1_is_persistent", "Value": "0"},
{"Key": "dstindex_1mirror2_id", "Value": "192.168.0.202:6714:loc"},
{"Key": "dstindex_1mirror2_probability_weight", "Value": "0.374635"},
{"Key": "dstindex_1mirror2_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror2_is_persistent", "Value": "439"},
{"Key": "dstindex_1mirror3_id", "Value": "dev1.manticoresearch.com:6714:loc"},
{"Key": "dstindex_1mirror3_probability_weight", "Value": " 0.252501"},
{"Key": "dstindex_1mirror3_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror3_is_persistent", "Value": "439"}
],
"error": "",
"total": 0,
"warning": ""}{columns=[{Key={type=string}},
{Value={type=string}}],
data=[
{Key=dstindex_1_is_ha, Value=1},
{Key=dstindex_1mirror1_id, Value=192.168.0.202:6713:loc},
{Key=dstindex_1mirror1_probability_weight, Value=0.372864},
{Key=dstindex_1mirror1_is_blackhole, Value=0},
{Key=dstindex_1mirror1_is_persistent, Value=0},
{Key=dstindex_1mirror2_id, Value=192.168.0.202:6714:loc},
{Key=dstindex_1mirror2_probability_weight, Value=0.374635},
{Key=dstindex_1mirror2_is_blackhole, Value=0},
{Key=dstindex_1mirror2_is_persistent, Value=439},
{Key=dstindex_1mirror3_id, Value=dev1.manticoresearch.com:6714:loc},
{Key=dstindex_1mirror3_probability_weight, Value= 0.252501},
{Key=dstindex_1mirror3_is_blackhole, Value=0},
{Key=dstindex_1mirror3_is_persistent, Value=439}
],
error=,
total=0,
warning=}{columns=[{Key={type=string}},
{Value={type=string}}],
data=[
{Key=dstindex_1_is_ha, Value=1},
{Key=dstindex_1mirror1_id, Value=192.168.0.202:6713:loc},
{Key=dstindex_1mirror1_probability_weight, Value=0.372864},
{Key=dstindex_1mirror1_is_blackhole, Value=0},
{Key=dstindex_1mirror1_is_persistent, Value=0},
{Key=dstindex_1mirror2_id, Value=192.168.0.202:6714:loc},
{Key=dstindex_1mirror2_probability_weight, Value=0.374635},
{Key=dstindex_1mirror2_is_blackhole, Value=0},
{Key=dstindex_1mirror2_is_persistent, Value=439},
{Key=dstindex_1mirror3_id, Value=dev1.manticoresearch.com:6714:loc},
{Key=dstindex_1mirror3_probability_weight, Value= 0.252501},
{Key=dstindex_1mirror3_is_blackhole, Value=0},
{Key=dstindex_1mirror3_is_persistent, Value=439}
],
error="",
total=0,
warning=""}{columns=[{Key={type=string}},
{Value={type=string}}],
data=[
{Key=dstindex_1_is_ha, Value=1},
{Key=dstindex_1mirror1_id, Value=192.168.0.202:6713:loc},
{Key=dstindex_1mirror1_probability_weight, Value=0.372864},
{Key=dstindex_1mirror1_is_blackhole, Value=0},
{Key=dstindex_1mirror1_is_persistent, Value=0},
{Key=dstindex_1mirror2_id, Value=192.168.0.202:6714:loc},
{Key=dstindex_1mirror2_probability_weight, Value=0.374635},
{Key=dstindex_1mirror2_is_blackhole, Value=0},
{Key=dstindex_1mirror2_is_persistent, Value=439},
{Key=dstindex_1mirror3_id, Value=dev1.manticoresearch.com:6714:loc},
{Key=dstindex_1mirror3_probability_weight, Value= 0.252501},
{Key=dstindex_1mirror3_is_blackhole, Value=0},
{Key=dstindex_1mirror3_is_persistent, Value=439}
],
error="",
total=0,
warning=""}{
"columns":
[{
"Key": {"type": "string"}},
{"Value": {"type": "string"}
}],
"data":
[
{"Key": "dstindex_1_is_ha", "Value": "1"},
{"Key": "dstindex_1mirror1_id", "Value": "192.168.0.202:6713:loc"},
{"Key": "dstindex_1mirror1_probability_weight", "Value": "0.372864"},
{"Key": "dstindex_1mirror1_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror1_is_persistent", "Value": "0"},
{"Key": "dstindex_1mirror2_id", "Value": "192.168.0.202:6714:loc"},
{"Key": "dstindex_1mirror2_probability_weight", "Value": "0.374635"},
{"Key": "dstindex_1mirror2_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror2_is_persistent", "Value": "439"},
{"Key": "dstindex_1mirror3_id", "Value": "dev1.manticoresearch.com:6714:loc"},
{"Key": "dstindex_1mirror3_probability_weight", "Value": " 0.252501"},
{"Key": "dstindex_1mirror3_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror3_is_persistent", "Value": "439"}
],
"error": "",
"total": 0,
"warning": ""
}{
"columns":
[{
"Key": {"type": "string"}},
{"Value": {"type": "string"}
}],
"data":
[
{"Key": "dstindex_1_is_ha", "Value": "1"},
{"Key": "dstindex_1mirror1_id", "Value": "192.168.0.202:6713:loc"},
{"Key": "dstindex_1mirror1_probability_weight", "Value": "0.372864"},
{"Key": "dstindex_1mirror1_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror1_is_persistent", "Value": "0"},
{"Key": "dstindex_1mirror2_id", "Value": "192.168.0.202:6714:loc"},
{"Key": "dstindex_1mirror2_probability_weight", "Value": "0.374635"},
{"Key": "dstindex_1mirror2_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror2_is_persistent", "Value": "439"},
{"Key": "dstindex_1mirror3_id", "Value": "dev1.manticoresearch.com:6714:loc"},
{"Key": "dstindex_1mirror3_probability_weight", "Value": " 0.252501"},
{"Key": "dstindex_1mirror3_is_blackhole", "Value": "0"},
{"Key": "dstindex_1mirror3_is_persistent", "Value": "439"}
],
"error": "",
"total": 0,
"warning": ""
}Manticore Search has a built-in Prometheus exporter. To request metrics, make sure the HTTP port is exposed and simply call the /metrics endpoint.
Note: The exporter requires Buddy to be enabled.
- http
curl -s 0:9308/metrics# HELP manticore_uptime_seconds Time in seconds since start
# TYPE manticore_uptime_seconds counter
manticore_uptime_seconds 25
# HELP manticore_connections_count Connections count since start
# TYPE manticore_connections_count gauge
manticore_connections_count 55
# HELP manticore_maxed_out_error_count Count of maxed_out errors since start
# TYPE manticore_maxed_out_error_count counter
manticore_maxed_out_error_count 0
# HELP manticore_version Manticore Search version
# TYPE manticore_version gauge
manticore_version {version="0.0.0 c88e811b2@25060409 (columnar 5.0.1 59c7092@25060304) (secondary 5.0.1 59c7092@25060304) (knn 5.0.1 59c7092@25060304) (embeddings 1.0.0) (buddy v3.28.6-7-g14ee10)"} 1
# HELP manticore_mysql_version Manticore Search version
# TYPE manticore_mysql_version gauge
manticore_mysql_version {version="0.0.0 c88e811b2@25060409 (columnar 5.0.1 59c7092@25060304) (secondary 5.0.1 59c7092@25060304) (knn 5.0.1 59c7092@25060304) (embeddings 1.0.0)"} 1
# HELP manticore_command_search_count Count of search queries since start
# TYPE manticore_command_search_count counter
manticore_command_search_count 1
......SHOW META [ LIKE pattern ]
SHOW META — это SQL-запрос, который отображает дополнительную мета-информацию о выполняемом запросе, включая время выполнения запроса, статистику по ключевым словам и информацию о используемых вторичных индексах. Синтаксис:
Включённые элементы:
total: Количество совпадений, которые действительно были извлечены и отправлены клиенту. Это значение обычно ограничивается опцией поиска LIMIT/size.total_found:- Оценочное общее число совпадений для запроса в индексе. Если необходим точный подсчет, используйте
SELECT COUNT(*)вместо опоры на это значение. - Для запросов с
GROUP BYзначениеtotal_foundпредставляет количество групп, а не отдельных совпадений. - При использовании
HAVINGсGROUP BYtotal_foundотражает количество групп после применения фильтраHAVING. Это обеспечивает корректную пагинацию с условиямиHAVING. - Для запросов GROUP N BY
total_foundпо-прежнему отражает количество групп, независимо от значенияN.
- Оценочное общее число совпадений для запроса в индексе. Если необходим точный подсчет, используйте
total_relation: Указывает, является ли значениеtotal_foundточным или оценочным.- Если Manticore не может определить точное значение
total_found, в этом поле будет отображеноtotal_relation: gte, что означает, что фактическое количество совпадений Больше Или Равно заявленному вtotal_found. - Если значение
total_foundточно, будет отображеноtotal_relation: eq.
- Если Manticore не может определить точное значение
time: Продолжительность (в секундах) обработки поискового запроса.keyword[N]: N-й ключевой слово, использованное в поисковом запросе. Обратите внимание, что ключевое слово может быть представлено с использованием подстановочных символов, например,abc*.docs[N]: Общее количество документов (или записей), содержащих N-е ключевое слово из поискового запроса. Если ключевое слово представлено с подстановочным знаком, это значение представляет сумму документов для всех расширенных подслов, возможно превышая фактическое количество совпавших документов.hits[N]: Общее количество вхождений (или попаданий) N-го ключевого слова во всех документах.index: Информация об используемом индексе (например, вторичный индекс).
- SQL
SELECT id, story_author FROM hn_small WHERE MATCH('one|two|three') and comment_ranking > 2 limit 5;
show meta;+---------+--------------+
| id | story_author |
+---------+--------------+
| 151171 | anewkid |
| 302758 | bks |
| 805806 | drRoflol |
| 1099245 | tnorthcutt |
| 303252 | whiten |
+---------+--------------+
5 rows in set (0.00 sec)
+----------------+---------------------------------------+
| Variable_name | Value |
+----------------+---------------------------------------+
| total | 5 |
| total_found | 2308 |
| total_relation | eq |
| time | 0.001 |
| keyword[0] | one |
| docs[0] | 224387 |
| hits[0] | 310327 |
| keyword[1] | three |
| docs[1] | 18181 |
| hits[1] | 21102 |
| keyword[2] | two |
| docs[2] | 63251 |
| hits[2] | 75961 |
| index | comment_ranking:SecondaryIndex (100%) |
+----------------+---------------------------------------+
14 rows in set (0.00 sec)SHOW META может отображать счётчики ввода/вывода и CPU, но они будут доступны только если searchd был запущен с переключателями --iostats и --cpustats соответственно.
- SQL
SELECT id,channel_id FROM records WHERE MATCH('one|two|three') limit 5;
SHOW META;+--------+--------------+
| id | story_author |
+--------+--------------+
| 300263 | throwaway37 |
| 713503 | mahmud |
| 716804 | mahmud |
| 776906 | jimbokun |
| 753332 | foxhop |
+--------+--------------+
5 rows in set (0.01 sec)
+-----------------------+--------+
| Variable_name | Value |
+-----------------------+--------+
| total | 5 |
| total_found | 266385 |
| total_relation | eq |
| time | 0.011 |
| cpu_time | 18.004 |
| agents_cpu_time | 0.000 |
| io_read_time | 0.000 |
| io_read_ops | 0 |
| io_read_kbytes | 0.0 |
| io_write_time | 0.000 |
| io_write_ops | 0 |
| io_write_kbytes | 0.0 |
| agent_io_read_time | 0.000 |
| agent_io_read_ops | 0 |
| agent_io_read_kbytes | 0.0 |
| agent_io_write_time | 0.000 |
| agent_io_write_ops | 0 |
| agent_io_write_kbytes | 0.0 |
| keyword[0] | one |
| docs[0] | 224387 |
| hits[0] | 310327 |
| keyword[1] | three |
| docs[1] | 18181 |
| hits[1] | 21102 |
| keyword[2] | two |
| docs[2] | 63251 |
| hits[2] | 75961 |
+-----------------------+--------+
27 rows in set (0.00 sec)Дополнительные значения, такие как predicted_time, dist_predicted_time, local_fetched_docs, local_fetched_hits, local_fetched_skips и их соответствующие аналоги dist_fetched_* будут доступны только в случае, если searchd был настроен с предсказанными затратами времени и запрос содержал predicted_time в разделе OPTION.
- SQL
SELECT id,story_author FROM hn_small WHERE MATCH('one|two|three') limit 5 option max_predicted_time=100;
SHOW META;+--------+--------------+
| id | story_author |
+--------+--------------+
| 300263 | throwaway37 |
| 713503 | mahmud |
| 716804 | mahmud |
| 776906 | jimbokun |
| 753332 | foxhop |
+--------+--------------+
5 rows in set (0.01 sec)
mysql> show meta;
+---------------------+--------+
| Variable_name | Value |
+---------------------+--------+
| total | 5 |
| total_found | 266385 |
| total_relation | eq |
| time | 0.012 |
| local_fetched_docs | 307212 |
| local_fetched_hits | 407390 |
| local_fetched_skips | 24 |
| predicted_time | 56 |
| keyword[0] | one |
| docs[0] | 224387 |
| hits[0] | 310327 |
| keyword[1] | three |
| docs[1] | 18181 |
| hits[1] | 21102 |
| keyword[2] | two |
| docs[2] | 63251 |
| hits[2] | 75961 |
+---------------------+--------+
17 rows in set (0.00 sec)SHOW META должен выполняться сразу после запроса в той же самой сессии. Поскольку некоторые MySQL коннекторы/библиотеки используют connection pools, выполнение SHOW META как отдельного запроса может привести к неожиданным результатам, таким как получение метаданных другого запроса. В таких случаях (и как общее рекомендуемое решение) выполняйте составной запрос, объединяющий основной запрос вместе с SHOW META. Некоторые коннекторы/библиотеки поддерживают много-запросы в одном вызове, в то время как другие требуют использования специального метода для много-запросов или установки определённых опций при настройке соединения.
- SQL
SELECT id,story_author FROM hn_small WHERE MATCH('one|two|three') LIMIT 5; SHOW META;+--------+--------------+
| id | story_author |
+--------+--------------+
| 300263 | throwaway37 |
| 713503 | mahmud |
| 716804 | mahmud |
| 776906 | jimbokun |
| 753332 | foxhop |
+--------+--------------+
5 rows in set (0.01 sec)
+----------------+--------+
| Variable_name | Value |
+----------------+--------+
| total | 5 |
| total_found | 266385 |
| total_relation | eq |
| time | 0.011 |
| keyword[0] | one |
| docs[0] | 224387 |
| hits[0] | 310327 |
| keyword[1] | three |
| docs[1] | 18181 |
| hits[1] | 21102 |
| keyword[2] | two |
| docs[2] | 63251 |
| hits[2] | 75961 |
+----------------+--------+
13 rows in set (0.00 sec)Также можно использовать необязательное выражение LIKE, которое позволяет выбрать только переменные, соответствующие определённому шаблону. Синтаксис шаблона следует стандартным SQL подстановочным символам, где % обозначает любое количество любых символов, а _ обозначает одиночный символ.
- SQL
SHOW META LIKE 'total%';+----------------+--------+
| Variable_name | Value |
+----------------+--------+
| total | 5 |
| total_found | 266385 |
| total_relation | eq |
+----------------+--------+
3 rows in set (0.00 sec)При использовании фасетного поиска можно проверить поле multiplier в выводе SHOW META, чтобы определить, сколько запросов было выполнено в оптимизированной группе.
- SQL
SELECT * FROM facetdemo FACET brand_id FACET price FACET categories;
SHOW META LIKE 'multiplier';+------+-------+----------+---------------------+-------------+-------------+---------------------------------------+------------+
| id | price | brand_id | title | brand_name | property | j | categories |
+------+-------+----------+---------------------+-------------+-------------+---------------------------------------+------------+
| 1 | 306 | 1 | Product Ten Three | Brand One | Six_Ten | {"prop1":66,"prop2":91,"prop3":"One"} | 10,11 |
...
+----------+----------+
| brand_id | count(*) |
+----------+----------+
| 1 | 1013 |
...
+-------+----------+
| price | count(*) |
+-------+----------+
| 306 | 7 |
...
+------------+----------+
| categories | count(*) |
+------------+----------+
| 10 | 2436 |
...
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| multiplier | 4 |
+---------------+-------+
1 row in set (0.00 sec)Когда оптимизатор запросов на основе стоимости выбирает использование DocidIndex, ColumnarScan или SecondaryIndex вместо обычного фильтра, это отражается в команде SHOW META.
Переменная index отображает имена и типы вторичных индексов, использованных при выполнении запроса. Процент указывает, сколько дисковых чанков (для RT-таблиц) или псевдо-шард (для обычных таблиц) использовали вторичный индекс.
- SQL
SELECT count(*) FROM taxi1 WHERE tip_amount = 5;
SHOW META;+----------------+----------------------------------+
| Variable_name | Value |
+----------------+----------------------------------+
| total | 1 |
| total_found | 1 |
| total_relation | eq |
| time | 0.016 |
| index | tip_amount:SecondaryIndex (100%) |
+----------------+----------------------------------+
5 rows in set (0.00 sec)SHOW META можно использовать после выполнения CALL PQ, в этом случае вывод будет отличаться.
SHOW META после запроса CALL PQ включает:
total— общее время, затраченное на сопоставление документа(ов)queries_matched— количество сохранённых запросов, совпавших с документом(ами)document_matches— количество документов, совпавших с запросами, сохранёнными в таблицеtotal_queries_stored— общее число запросов, сохранённых в таблицеterm_only_queries— число запросов в таблице, содержащих только термы; остальные запросы используют расширенный синтаксис запросов.
- SQL
CALL PQ ('pq', ('{"title":"angry", "gid":3 }')); SHOW META;+------+
| id |
+------+
| 2 |
+------+
1 row in set (0.00 sec)
+-----------------------+-----------+
| Variable name | Value |
+-----------------------+-----------+
| total | 0.000 sec |
| queries_matched | 1 |
| queries_failed | 0 |
| document_matched | 1 |
| total_queries_stored | 2 |
| term_only_queries | 2 |
| fast_rejected_queries | 1 |
+-----------------------+-----------+
7 rows in set (0.00 sec)Использование CALL PQ с опцией verbose предоставляет более подробный вывод.
Он включает следующие дополнительные записи:
Setup- Время, затраченное на начальную настройку процесса сопоставления, такое как разбор документов и установка опцийQueries failed- Количество запросов, которые завершились неудачейFast rejected queries- Количество запросов, которые не были полностью оценены, но быстро сопоставлены и отклонены с использованием фильтров или других условийTime per query- Детальное время для каждого запросаTime of matched queries- Общее время, затраченное на запросы, которые сопоставились с какими-либо документами
- SQL
CALL PQ ('pq', ('{"title":"angry", "gid":3 }'), 1 as verbose); SHOW META;+------+
| id |
+------+
| 2 |
+------+
1 row in set (0.00 sec)
+-------------------------+-----------+
| Variable name | Value |
+-------------------------+-----------+
| total | 0.000 sec |
| setup | 0.000 sec |
| queries_matched | 1 |
| queries_failed | 0 |
| document_matched | 1 |
| total_queries_stored | 2 |
| term_only_queries | 2 |
| fast_rejected_queries | 1 |
| time_per_query | 69 |
| time_of_matched_queries | 69 |
+-------------------------+-----------+
10 rows in set (0.00 sec)SHOW THREADS [ OPTION columns=width[,format=sphinxql][,format=all] ]
SHOW THREADS — это SQL-запрос, который отображает информацию обо всех потоках и их текущей активности.
В результирующей таблице содержатся следующие столбцы:
TID: ID, присвоенный потоку ядромName: Имя потока, также отображается вtop,htop,psи других инструментах просмотра процессовProto: Протокол соединения; возможные значения включаютsphinx,mysql,http,ssl,compressed,replicationили их комбинации (например,http,sslилиcompressed,mysql)State: Состояние потока; возможные значения:handshake,net_read,net_write,query,net_idleConnection from:ip:portклиентаConnID: ID соединения (начинается с 0)This/prev job time: Если поток занят — сколько времени выполняется текущая задача; если поток простаивает — длительность предыдущей задачи + суффиксprevJobs done: Количество выполненных этим потоком задачThread status:idlingилиworkingInfo: Информация о запросе, которая может включать несколько запросов, если запрос направлен к распределённой таблице или таблице реального времени
- SQL
- JSON
- PHP
- Python
- Python-asyncio
- javascript
- Java
- C#
- Rust
- TypeScript
- Go
SHOW THREADS;POST /cli -d "SHOW THREADS"require_once __DIR__ . '/vendor/autoload.php';
$config = ['host'=>'127.0.0.1','port'=>9308];
$client = new \Manticoresearch\Client($config);
print_r($client->nodes()->threads());import manticoresearch
config = manticoresearch.Configuration(
host = "http://127.0.0.1:9308"
)
client = manticoresearch.ApiClient(config)
utilsApi = manticoresearch.UtilsApi(client)
print(utilsApi.sql('SHOW THREADS'))import manticoresearch
config = manticoresearch.Configuration(
host = "http://127.0.0.1:9308"
)
client = manticoresearch.ApiClient(config)
utilsApi = manticoresearch.UtilsApi(client)
res = await utilsApi.sql('SHOW THREADS')
print(res)var Manticoresearch = require('manticoresearch');
var utilsApi = new Manticoresearch.UtilsApi();
async function showThreads() {
res = await utilsApi.sql('SHOW THREADS');
console.log(JSON.stringify(res, null, 4));
}
showThreads();utilsApi.sql("SHOW THREADS");utilsApi.Sql("SHOW THREADS");utils_api.sql("SHOW THREADS", Some(true)).await;res = await utilsApi.sql('SHOW THREADS');apiClient.UtilsAPI.Sql(context.Background()).Body("SHOW THREADS").Execute()*************************** 1. row ***************************
TID: 83
Name: work_1
Proto: mysql
State: query
Connection from: 172.17.0.1:43300
ConnID: 8
This/prev job time: 630us
CPU activity: 94%
Jobs done: 2490
Thread status: working
Info: SHOW THREADS
*************************** 2. row ***************************
TID: 84
Name: work_2
Proto: mysql
State: query
Connection from: 172.17.0.1:43301
ConnID: 9
This/prev job time: 689us
CPU activity: 89%
Jobs done: 1830
Thread status: working
Info: show threads+--------+---------+-------+-------+-----------------+--------+-----------------------+-----------+---------------+--------------+
| TID | Name | Proto | State | Connection from | ConnID | This/prev job time, s | Jobs done | Thread status | Info |
+--------+---------+-------+-------+-----------------+--------+-----------------------+-----------+---------------+--------------+
| 501494 | work_23 | http | query | 127.0.0.1:41300 | 1473 | 249us | 1681 | working | show_threads |
+--------+---------+-------+-------+-----------------+--------+-----------------------+-----------+---------------+--------------+Array
(
[0] => Array
(
[TID] => 506960
[Name] => work_8
[Proto] => http
[State] => query
[Connection from] => 127.0.0.1:38072
[ConnID] => 17
[This/prev job time, s] => 231us
[CPU activity] => 94%
[Jobs done] => 8
[Thread status] => working
[Info] => show_threads
)
)[{'columns': [{'TID': {'type': 'long'}}, {'Name': {'type': 'string'}}, {'Proto': {'type': 'string'}}, {'State': {'type': 'string'}}, {'Connection from': {'type': 'string'}}, {'ConnID': {'type': 'long long'}}, {'This/prev job time, s': {'type': 'string'}}, {'CPU activity': {'type': 'string'}}, {'Jobs done': {'type': 'long'}}, {'Thread status': {'type': 'string'}}, {'Info': {'type': 'string'}}], 'data': [{'TID': 506958, 'Name': 'work_6', 'Proto': 'http', 'State': 'query', 'Connection from': '127.0.0.1:38600', 'ConnID': 834, 'This/prev job time, s': '206us', 'CPU activity': '92%', 'Jobs done': 943, 'Thread status': 'working', 'Info': 'show_threads'}], 'total': 1, 'error': '', 'warning': ''}][{'columns': [{'TID': {'type': 'long'}}, {'Name': {'type': 'string'}}, {'Proto': {'type': 'string'}}, {'State': {'type': 'string'}}, {'Connection from': {'type': 'string'}}, {'ConnID': {'type': 'long long'}}, {'This/prev job time, s': {'type': 'string'}}, {'CPU activity': {'type': 'string'}}, {'Jobs done': {'type': 'long'}}, {'Thread status': {'type': 'string'}}, {'Info': {'type': 'string'}}], 'data': [{'TID': 506958, 'Name': 'work_6', 'Proto': 'http', 'State': 'query', 'Connection from': '127.0.0.1:38600', 'ConnID': 834, 'This/prev job time, s': '206us', 'CPU activity': '92%', 'Jobs done': 943, 'Thread status': 'working', 'Info': 'show_threads'}], 'total': 1, 'error': '', 'warning': ''}][
{
"columns": [
{
"TID": {
"type": "long"
}
},
{
"Name": {
"type": "string"
}
},
{
"Proto": {
"type": "string"
}
},
{
"State": {
"type": "string"
}
},
{
"Connection from": {
"type": "string"
}
},
{
"ConnID": {
"type": "long long"
}
},
{
"This/prev job time, s": {
"type": "string"
}
},
{
"CPU activity": {
"type": "string"
}
},
{
"Jobs done": {
"type": "long"
}
},
{
"Thread status": {
"type": "string"
}
},
{
"Info": {
"type": "string"
}
}
],
"data": [
{
"TID": 506964,
"Name": "work_12",
"Proto": "http",
"State": "query",
"Connection from": "127.0.0.1:36656",
"ConnID": 2884,
"This/prev job time, s": "236us",
"CPU activity": "92%",
"Jobs done": 3328,
"Thread status": "working",
"Info": "show_threads"
}
],
"total": 1,
"error": "",
"warning": ""
}
]{
columns=[
{
TID={
type=string
}
},
{
Name={
type=string
}
},
{
Proto={
type=string
}
},
{
State={
type=string
}
},
{
Connection from={
type=string
}
},
{
ConnID={
type=string
}
},
{
This/prev job time={
type=string
}
},
{
CPU activity={
type=string
}
},
{
Jobs done={
type=string
}
},
{
Thread status={
type=string
}
},
{
Info={
type=string
}
}
],
data=[
{
TID=82,
Name=work_0,
Proto=http,
State=query,
Connection from=172.17.0.1:60550,
ConnID=163,
This/prev job time=105us,
CPU activity=45%,
Jobs done=849,
Thread status=working,
Info=show_threads
}
],
total=0,
error=,
warning=
}{
columns=[
{
TID={
type=string
}
},
{
Name={
type=string
}
},
{
Proto={
type=string
}
},
{
State={
type=string
}
},
{
Connection from={
type=string
}
},
{
ConnID={
type=string
}
},
{
This/prev job time= {
type=string
}
},
{
Jobs done={
type=string
}
},
{
Thread status={
type=string
}
},
{
Info={
type=string
}
}
],
data=[
{
TID=83,
Name=work_1,
Proto=http,
State=query,
Connection from=172.17.0.1:41410,
ConnID=6,
This/prev job time=689us,
Jobs done=159,
Thread status=working,
Info=show_threads
}
],
total=0,
error="",
warning=""
}{
columns=[
{
TID={
type=string
}
},
{
Name={
type=string
}
},
{
Proto={
type=string
}
},
{
State={
type=string
}
},
{
Connection from={
type=string
}
},
{
ConnID={
type=string
}
},
{
This/prev job time= {
type=string
}
},
{
Jobs done={
type=string
}
},
{
Thread status={
type=string
}
},
{
Info={
type=string
}
}
],
data=[
{
TID=83,
Name=work_1,
Proto=http,
State=query,
Connection from=172.17.0.1:41410,
ConnID=6,
This/prev job time=689us,
Jobs done=159,
Thread status=working,
Info=show_threads
}
],
total=0,
error="",
warning=""
}[
{
"columns": [
{
"TID": {
"type": "long"
}
},
{
"Name": {
"type": "string"
}
},
{
"Proto": {
"type": "string"
}
},
{
"State": {
"type": "string"
}
},
{
"Connection from": {
"type": "string"
}
},
{
"ConnID": {
"type": "long long"
}
},
{
"This/prev job time, s": {
"type": "string"
}
},
{
"CPU activity": {
"type": "string"
}
},
{
"Jobs done": {
"type": "long"
}
},
{
"Thread status": {
"type": "string"
}
},
{
"Info": {
"type": "string"
}
}
],
"data": [
{
"TID": 506964,
"Name": "work_12",
"Proto": "http",
"State": "query",
"Connection from": "127.0.0.1:36656",
"ConnID": 2884,
"This/prev job time, s": "236us",
"CPU activity": "92%",
"Jobs done": 3328,
"Thread status": "working",
"Info": "show_threads"
}
],
"total": 1,
"error": "",
"warning": ""
}
][
{
"columns": [
{
"TID": {
"type": "long"
}
},
{
"Name": {
"type": "string"
}
},
{
"Proto": {
"type": "string"
}
},
{
"State": {
"type": "string"
}
},
{
"Connection from": {
"type": "string"
}
},
{
"ConnID": {
"type": "long long"
}
},
{
"This/prev job time, s": {
"type": "string"
}
},
{
"CPU activity": {
"type": "string"
}
},
{
"Jobs done": {
"type": "long"
}
},
{
"Thread status": {
"type": "string"
}
},
{
"Info": {
"type": "string"
}
}
],
"data": [
{
"TID": 506964,
"Name": "work_12",
"Proto": "http",
"State": "query",
"Connection from": "127.0.0.1:36656",
"ConnID": 2884,
"This/prev job time, s": "236us",
"CPU activity": "92%",
"Jobs done": 3328,
"Thread status": "working",
"Info": "show_threads"
}
],
"total": 1,
"error": "",
"warning": ""
}
]Столбец Info отображает:
- Исходный текст запросов, выполненных через интерфейс Manticore SQL
- Полный текст с синтаксисом, комментариями и размером данных для запросов, выполненных через внутренний бинарный протокол Manticore (например, с удалённого экземпляра Manticore)
Вы можете ограничить максимальную ширину столбца Info, указав опцию columns=N.
По умолчанию запросы отображаются в исходном формате. Однако при использовании опции format=sphinxql запросы будут показаны в формате SQL, независимо от протокола выполнения.
Использование format=all покажет все потоки, в то время как простаивающие и системные потоки скрыты без этой опции (например, те, что заняты OPTIMIZE).
- SQL
- JSON
- PHP
- Python
- Python-asyncio
- javascript
- Java
- C#
- Rust
- TypeScript
- Go
SHOW THREADS OPTION columns=30\GPOST /cli -d "SHOW THREADS OPTION columns=30"$client->nodes()->threads(['body'=>['columns'=>30]]);utilsApi.sql('SHOW THREADS OPTION columns=30')await utilsApi.sql('SHOW THREADS OPTION columns=30')res = await utilsApi.sql('SHOW THREADS OPTION columns=30');utilsApi.sql("SHOW THREADS OPTION columns=30");utilsApi.Sql("SHOW THREADS OPTION columns=30");utils_api.sql("SHOW THREADS OPTION columns=30", Some(true)).await;res = await utilsApi.sql('SHOW THREADS OPTION columns=30');apiClient.UtilsAPI.Sql(context.Background()).Body("SHOW THREADS OPTION columns=30").Execute()SHOW QUERIES
ПРИМЕЧАНИЕ:
SHOW QUERIESтребует Manticore Buddy. Если не работает, убедитесь, что Buddy установлен.
SHOW QUERIES возвращает информацию обо всех текущих выполняющихся запросах. Вывод представляет собой таблицу со следующей структурой:
id: ID запроса, который можно использовать в KILL для завершения запросаquery: Текст запроса или его частьtime: Время выполнения команды или сколько времени назад был выполнен запрос (в этом случае значение будет содержатьago)protocol: Протокол соединения, возможные значения:sphinx,mysql,http,ssl,compressed,replicationили их комбинации (например,http,sslилиcompressed,mysql)host:ip:portклиента
- SQL
mysql> SHOW QUERIES;+------+--------------+---------+----------+-----------------+
| id | query | time | protocol | host |
+------+--------------+---------+----------+-----------------+
| 111 | select | 5ms ago | http | 127.0.0.1:58986 |
| 96 | SHOW QUERIES | 255us | mysql | 127.0.0.1:33616 |
+------+--------------+---------+----------+-----------------+
2 rows in set (0.61 sec)Обратитесь к SHOW THREADS, если хотите получить информацию с точки зрения самих потоков.