expvar

command
v0.5.29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 6 Imported by: 0

README

これは何?

expvar パッケージのサンプルです。

実行すると以下のようになります。

$ task run
task: [build] go build
task: [run] ./expvar opt1 opt2 &
task: [run] for i in {1..3} ; do curl -sS http://localhost:8888/debug/vars | jq 'del(.memstats)'; sleep 2; done
{
  "cmdline": [
    "./expvar",
    "opt1",
    "opt2"
  ],
  "counter": 0,
  "message": "",
  "values": {}
}
{
  "cmdline": [
    "./expvar",
    "opt1",
    "opt2"
  ],
  "counter": 2,
  "message": "hello-02",
  "values": {
    "counter": 4,
    "message": "HELLO-02"
  }
}
{
  "cmdline": [
    "./expvar",
    "opt1",
    "opt2"
  ],
  "counter": 4,
  "message": "hello-04",
  "values": {
    "counter": 16,
    "message": "HELLO-04"
  }
}
task: [run] pgrep expvar | xargs kill

参考情報

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL