master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
1
branch
0
tags
Code
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
go get github.com/niean/goperfcounter
package xxx import ( pfc "github.com/niean/goperfcounter" ) func foo() { if err := bar(); err != nil { pfc.Meter("bar.called.error", int64(1)) } } func bar() error { // do sth ... return nil }
{ "counterType": "GAUGE", "endpoint": "git", "metric": "rate", "step": 20, "tags": "module=perfcounter,name=bar.called.error", "timestamp": 1451397266, "value": 13.14 }, { "counterType": "GAUGE", "endpoint": "git", "metric": "sum", "step": 20, "tags": "module=perfcounter,name=bar.called.error", "timestamp": 1451397266, "value": 1023 }
{ "debug": false, // 是否开启调制,默认为false "hostname": "", // 机器名(也即endpoint名称),默认为本机名称 "tags": "", // tags标签,默认为空。一个tag形如"key=val",多个tag用逗号分隔;name为保留字段,因此不允许设置形如"name=xxx"的tag。eg. "cop=xiaomi,module=perfcounter" "step": 60, // 上报周期,单位s,默认为60s "bases":[], // gvm基础信息采集,可选值为"debug"、"runtime",默认不采集 "push": { // push数据到Open-Falcon "enabled":true, // 是否开启自动push,默认开启 "api": "" // Open-Falcon接收器地址,默认为本地agent,即"http:// 127.0.0.1:1988/v1/push" }, "http": { // http服务,为了安全考虑,当前只允许本地访问 "enabled": false, // 是否开启http服务,默认不开启 "listen": "" // http服务监听地址,默认为空。eg. "0.0.0.0:2015"表示在2015端口开启http监听 } }