{"id":13564560,"url":"https://github.com/rs/jplot","last_synced_at":"2025-05-16T01:06:04.578Z","repository":{"id":29771436,"uuid":"122737920","full_name":"rs/jplot","owner":"rs","description":"iTerm2 expvar/JSON monitoring tool","archived":false,"fork":false,"pushed_at":"2024-06-26T19:33:06.000Z","size":21433,"stargazers_count":1153,"open_issues_count":10,"forks_count":39,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-08T11:15:24.089Z","etag":null,"topics":["cli","expvars","golang","iterm2","jplot","json","memstats","monitoring"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-24T12:17:51.000Z","updated_at":"2025-03-22T11:10:01.000Z","dependencies_parsed_at":"2023-01-14T15:37:33.500Z","dependency_job_id":"93752010-63a4-4915-90d4-395f9ca46f58","html_url":"https://github.com/rs/jplot","commit_stats":{"total_commits":51,"total_committers":6,"mean_commits":8.5,"dds":0.1568627450980392,"last_synced_commit":"95795e1176ac3384d5e642f80fb8b882a7f973fb"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rs%2Fjplot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rs%2Fjplot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rs%2Fjplot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rs%2Fjplot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rs","download_url":"https://codeload.github.com/rs/jplot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448579,"owners_count":22072764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","expvars","golang","iterm2","jplot","json","memstats","monitoring"],"created_at":"2024-08-01T13:01:32.951Z","updated_at":"2025-05-16T01:05:59.567Z","avatar_url":"https://github.com/rs.png","language":"Go","readme":"# jplot\n[![license](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/rs/jplot/master/LICENSE)\n\nJplot tracks expvar-like (JSON) metrics and plot their evolution over time right into your iTerm2 terminal (or DRCS Sixel Graphics).\n\n![](doc/demo.gif)\n\nAbove capture is jplot monitoring a Go service's [expvar](https://golang.org/pkg/expvar/):\n\n```\njplot --url http://:8080/debug/vars \\\n    memstats.HeapSys+memstats.HeapAlloc+memstats.HeapIdle+marker,counter:memstats.NumGC \\\n    counter:memstats.TotalAlloc \\\n    memstats.HeapObjects \\\n    memstats.StackSys+memstats.StackInuse\n```\n\nBy default, jplot uses the full size of the terminal, but it is possible to limit the render to a few rows:\n\n![](doc/rows.gif)\n\n## Install\n\nUsing [homebrew](http://brew.sh/):\n\n```\nbrew install rs/tap/jplot\n```\n\nFrom source:\n\n```\ngo install github.com/rs/jplot@latest\n```\n\nThis tool does only work with [iTerm2](https://www.iterm2.com), or terminals support DRCS Sixel Graphics.\n\n## Usage\n\nGiven the following JSON output:\n\n```\n{\n    \"mem\": {\n        \"Heap\": 1234,\n        \"Sys\": 4321,\n        \"Stack\": 203\n    },\n    \"cpu\": {\n        \"STime\": 123,\n        \"UTime\":1234\n    },\n    \"Threads\": 2\n}\n```\n\nYou can graph the number of thread over time:\n\n```\njplot --url http://:8080/debug/vars Threads\n```\n\n![](doc/single.png)\n\nOr create a graph with both Utime and Stime growth rate on the same axis by using `+` between two field paths:\n\n```\njplot --url http://:8080/debug/vars counter:cpu.STime+counter:cpu.UTime\n```\n\nNote: the `counter:` prefix instructs jplot to compute the difference between the values instead of showing their absolute value.\n\n![](doc/dual.png)\n\n\nOr create several graphs by providing groups of fields as separate arguments; each argument creates a new graph:\n\n```\njplot --url http://:8080/debug/vars mem.Heap+mem.Sys+mem.Stack counter:cpu.STime+cpu.UTime Threads\n```\n\n![](doc/all.png)\n\n### Spec Syntax\n\nEach positional arguments given to jplot create a stacked graph with the specified values. To reference the values, use [gojq](https://github.com/elgs/gojq) JSON query syntax. Several value paths can be referenced for the same graph by using the `+` character to separate them.\n\nIn addition, each value path can be prefixed with options separated from the path by a column. Several options can be used for the same command by separating them with a comma like so: `option1,option2:value.path`.\n\nSupported options are:\n* `counter`: Computes the difference with the last value. The value must increase monotonically.\n* `marker`: When the value is none-zero, a vertical line is drawn.\n\n## Recipes\n\n### Memstats\n\nHere is an example command to graph a Go program memstats:\n\n```\njplot --url http://:8080/debug/vars \\\n    memstats.HeapSys+memstats.HeapAlloc+memstats.HeapIdle+marker,counter:memstats.NumGC \\\n    counter:memstats.TotalAlloc \\\n    memstats.HeapObjects \\\n    memstats.StackSys+memstats.StackInuse\n```\n\n![](doc/memstats.png)\n\n### Vegeta\n\nWith the help of [jaggr](https://github.com/rs/jaggr) can be used to integrate [vegeta](https://github.com/tsenart/vegeta) with jplot as follow:\n\n```\necho 'GET http://localhost:8080' | \\\n    vegeta attack -rate 5000 -workers 100 -duration 10m | vegeta dump | \\\n    jaggr @count=rps \\\n          hist\\[100,200,300,400,500\\]:code \\\n          p25,p50,p95:latency \\\n          sum:bytes_in \\\n          sum:bytes_out | \\\n    jplot rps+code.hist.100+code.hist.200+code.hist.300+code.hist.400+code.hist.500 \\\n          latency.p95+latency.p50+latency.p25 \\\n          bytes_in.sum+bytes_out.sum\n```\n\n![](doc/vegeta.gif)\n\n### Supported Terminals\n\n* [xterm](http://invisible-island.net/xterm/)\n* [iTerm2](https://www.iterm2.com/) on OSX\n* [mintty](https://mintty.github.io/) on UNIX OSs via SSH\n* [mlterm](https://sourceforge.net/projects/mlterm/) on Linux and Windows\n* [RLogin](http://nanno.dip.jp/softlib/man/rlogin/) on Windows\n* [yaft](http://uobikiemukot.github.io/yaft/) on Linux console\n* [yaft-android](https://github.com/uobikiemukot/yaft-android) on Android\n* [Tanasinn](http://saitoha.github.io/tanasinn/) on Firefox/Thunderbird\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frs%2Fjplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frs%2Fjplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frs%2Fjplot/lists"}