HTTP
NSQ的HTTP API是基于 Go's net/http
包實現(xiàn)的. 就是
常見的HTTP應用,在大多數(shù)高級編程語言中都能直接使用而無需額外的三方包。
簡潔就是它最有力的武器,Go的 HTTP tool-chest最強大的就是其調(diào)試功能. net/http/pprof
包直接集成了
HTTP server,可以方便的訪問 CPU, heap, goroutine, and OS 進程文檔
.gotool就能直接實現(xiàn)上述操作:
$ go tool pprof http://127.0.0.1:4151/debug/pprof/profile
這對于調(diào)試和 實時
監(jiān)控進程非常有用!
此外,/stats端端返回JSON或是美觀的文本格式信息,這讓管理員使用命令行實時監(jiān)控非常容易 :
$ watch -n 0.5 'curl -s http://127.0.0.1:4151/stats | grep -v connected'
打印出的結果如下:
此外, Go 1.2 還有很多監(jiān)控指標 measurable HTTP performance gains
. 每次更新Go版本后都能看到性能方面的改進,真是讓人振奮!