{"id":301252,"date":"2020-04-03T15:00:53","date_gmt":"2020-04-03T15:00:53","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=301252"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=301252","title":{"rendered":"pipeplot \u2014 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 pipe \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/495416\/\">\u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u043d\u0435 \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u043a\u0438\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u043b\u044e\u0431\u0438\u0442 \u0435\u0451 ascii-\u0433\u0440\u0430\u0444\u0438\u043a\u0443, \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0438\u0437 pipe. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u044b.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041f\u0438\u043d\u0433<\/h4>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ec\/fv\/jo\/ecfvjoxm0vuhvv7nrr4ww6457g4.gif\" width=\"100%\"><\/p>\n<pre><code class=\"bash\">ping ya.ru | grep --line-buffered time | sed -u -e 's#.*time=\\([^ ]*\\).*#\\1#' | pipeplot --min 0 <\/code><\/pre>\n<p>  <\/p>\n<h4>\u041c\u043e\u0436\u043d\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u0440\u043e\u043d\u0430\u0432\u0438\u0440\u0443\u0441 \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/github.com\/javieraviles\/covidAPI\" rel=\"nofollow\">covidAPI<\/a><\/h4>\n<p>  <\/p>\n<pre><code class=\"bash\">while true; \\     do curl -s https:\/\/coronavirus-19-api.herokuapp.com\/all \\     | jq '.deaths'; \\     sleep 60; \\ done \\ | pipeplot --color 1 --direction left <\/code><\/pre>\n<p>  <i>\u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c jq \u0434\u043b\u044f \u0440\u0430\u0437\u0431\u043e\u0440\u0430 json<\/i><\/p>\n<h4>\u041f\u044f\u0442\u0438\u0441\u043e\u0442\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 \u0433\u0440\u0430\u0444\u0438\u0442<\/h4>\n<p>  <\/p>\n<pre><code class=\"bash\">while true; \\ do \\     curl -s 'http:\/\/graphite\/render?target=my_app_rps_error&amp;format=json&amp;from=-5min&amp;until=now' \\     | jq -c '.[0].datapoints[-1]'; \\     sleep 5; \\ done \\ | sed -u s\/null\/0\/ \\ | stdbuf -oL uniq \\ | stdbuf -oL jq '.[0]' \\ | pipeplot <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0411\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f<\/h4>\n<p>  \u041c\u043d\u043e\u0433\u0438\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0438\u0440\u0443\u044e\u0442 stdout. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 pipe \u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438: <i>sed -u<\/i>, <i>grep &#8212;line-buffered<\/i>. \u0412 \u0434\u0440\u0443\u0433\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 <i>stdbuf -oL<\/i> \u0438 <i>unbuffer<\/i>.<\/p>\n<h4>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043e\u043f\u0446\u0438\u0438<\/h4>\n<p>   <i>&#8212;color COLOR<\/i> \u2014 \u0446\u0432\u0435\u0442 \u043a\u043e\u043b\u043e\u043d\u043e\u043a, \u0447\u0438\u0441\u043b\u043e \u0438\u0437 \u043f\u0430\u043b\u0438\u0442\u0440\u044b <a href=\"https:\/\/jonasjacek.github.io\/colors\/\" rel=\"nofollow\">Xterm<\/a><br \/>  <i>&#8212;symbol SYMBOL<\/i> \u2014 \u0441\u0438\u043c\u0432\u043e\u043b \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u043e\u043d\u043e\u043a, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 <a href=\"https:\/\/unicode-table.com\/ru\/sets\/cats\/\" rel=\"nofollow\">\u043a\u043e\u0442\u0438\u043a\u043e\u0432<\/a><br \/>  <i>&#8212;scale {all,window}<\/i> \u2014 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0430 \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0430, all \u2014 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, window \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0438\u0434\u0438\u043c\u044b\u0435<br \/>  <i>&#8212;direction {left,right}<\/i> \u2014 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435<br \/>  <i>&#8212;min MIN &#8212;max MAX<\/i> \u2014 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c, \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442\u0441\u044f \u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c<\/p>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h4>\n<p>  <\/p>\n<pre><code class=\"bash\">pip install pipeplot<\/code><\/pre>\n<p>  <b>P.S.:<\/b> \u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043d\u0430 <a href=\"https:\/\/github.com\/MyGodIsHe\/pipeplot\" rel=\"nofollow\">github<\/a> \u043f\u0440\u043e\u0435\u043a\u0442\u0430 ^-^. \u041f\u0438\u0448\u0438\u0442\u0435 \u0432 \u041f\u0420\u044b, \u0438\u043b\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u044b, \u0441\u0432\u043e\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u044b. \u0421\u0430\u043c\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044e \u0432 readme!<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/495416\/\"> https:\/\/habr.com\/ru\/post\/495416\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/495416\/\">\u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u043d\u0435 \u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u043a\u0438\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u043b\u044e\u0431\u0438\u0442 \u0435\u0451 ascii-\u0433\u0440\u0430\u0444\u0438\u043a\u0443, \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0438\u0437 pipe. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u044b.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-301252","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301252","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=301252"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301252\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=301252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=301252"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=301252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}