Как получить прогресс выполнения запроса?

366 views
Skip to first unread message

Max Lapshin

unread,
Jun 16, 2017, 4:07:55 AM6/16/17
to ClickHouse
Консольный клиент показывает крутой прогресс бар.

Куда надо поглядеть, что бы сделать такой же у себя?


По идее эту информацию можно получить через плавно отдающиеся хедеры ответа или отказаться от HTTP и подключиться по какому-то протоколу?

madm1ke

unread,
Jun 16, 2017, 5:19:39 AM6/16/17
to Max Lapshin, ClickHouse
Выдрать реализацию нативного протокола из сишного клиента?

16 июня 2017 г., 11:07 пользователь Max Lapshin <max.l...@gmail.com> написал:
Консольный клиент показывает крутой прогресс бар.

Куда надо поглядеть, что бы сделать такой же у себя?


По идее эту информацию можно получить через плавно отдающиеся хедеры ответа или отказаться от HTTP и подключиться по какому-то протоколу?

--
You received this message because you are subscribed to the Google Groups "ClickHouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clickhouse+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clickhouse/18ec37b7-6d05-49c3-8b99-8064e900999b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Mikhail U. Petrov.

man...@gmail.com

unread,
Jun 16, 2017, 12:36:08 PM6/16/17
to ClickHouse
За это отвечают настройки:

    /** Send progress notifications using X-ClickHouse-Progress headers. \
      * Some clients do not support high amount of HTTP headers (Python requests in particular), so it is disabled by default. \
      */ \
    M(SettingBool, send_progress_in_http_headers, false) \
    \
    /** Do not send HTTP headers X-ClickHouse-Progress more frequently than at each specified interval. */ \
    M(SettingUInt64, http_headers_progress_interval_ms, 100) \


Пример использования:


milovidov@mtexample03t:~/ClickHouse/private/tests$ curl -sSv 'http://localhost:8123/' -d "SELECT URL, uniq(UserID) AS u FROM test.hits GROUP BY URL ORDER BY u DESC LIMIT 10"
* Hostname was NOT found in DNS cache * Trying ::1... * Connected to localhost (::1) port 8123 (#0) > POST / HTTP/1.1 > User-Agent: curl/7.35.0 > Host: localhost:8123 > Accept: */* > Content-Length: 82 > Content-Type: application/x-www-form-urlencoded > * upload completely sent off: 82 out of 82 bytes < HTTP/1.1 200 OK < Date: Sun, 22 Jan 2017 16:51:32 GMT < Connection: Keep-Alive < Content-Type: text/tab-separated-values; charset=UTF-8 < Transfer-Encoding: chunked < Keep-Alive: timeout=3 < X-ClickHouse-Progress: {"read_rows":"2752512","read_bytes":"240570816","total_rows":"8880128"} < X-ClickHouse-Progress: {"read_rows":"5439488","read_bytes":"482285394","total_rows":"8880128"} < X-ClickHouse-Progress: {"read_rows":"8783786","read_bytes":"819092887","total_rows":"8880128"} < http://yandex.ru/ 16748

Max Lapshin

unread,
Jun 19, 2017, 10:33:58 AM6/19/17
to man...@gmail.com, ClickHouse
в 1.1.54236  это уже есть?

Настройка указывается в config.xml:

<yandex>

    <http_port>8123</http_port>

    <send_progress_in_http_headers>true</send_progress_in_http_headers>

    <http_headers_progress_interval_ms>500</http_headers_progress_interval_ms>

</yandex>


?

Max Lapshin

unread,
Jun 19, 2017, 12:08:23 PM6/19/17
to man...@gmail.com, ClickHouse
если передать эти параметры в query string, то оно работает.
Reply all
Reply to author
Forward
0 new messages