tidy comments

pull/977/head
AtakanColak 4 years ago
parent 2c98f69e11
commit 498a39984d

@ -94,7 +94,7 @@ func BytePtrToString(p *uint8) string {
return string(a[:i])
}
// CounterInfo XXX
// CounterInfo struct is used to track a windows performance counter
// copied from https://github.com/mackerelio/mackerel-agent/
type CounterInfo struct {
PostName string
@ -102,7 +102,7 @@ type CounterInfo struct {
Counter windows.Handle
}
// CreateQuery XXX
// CreateQuery with a PdhOpenQuery call
// copied from https://github.com/mackerelio/mackerel-agent/
func CreateQuery() (windows.Handle, error) {
var query windows.Handle
@ -113,7 +113,7 @@ func CreateQuery() (windows.Handle, error) {
return query, nil
}
// CreateCounter XXX
// CreateCounter with a PdhAddCounter call
func CreateCounter(query windows.Handle, pname, cname string) (*CounterInfo, error) {
var counter windows.Handle
r, _, err := PdhAddCounter.Call(

@ -22,9 +22,9 @@ var (
)
// loadAvgGoroutine updates avg data by fetching current load by interval
// TODO register callback rather than this
// TODO instead of this goroutine, we can register a Win32 counter just as psutil does
// see https://psutil.readthedocs.io/en/latest/#psutil.getloadavg
// code https://github.com/giampaolo/psutil/blob/master/psutil/arch/windows/wmi.c
// code https://github.com/giampaolo/psutil/blob/8415355c8badc9c94418b19bdf26e622f06f0cce/psutil/arch/windows/wmi.c
func loadAvgGoroutine() {
const (
loadAvgFactor1F = 0.9200444146293232478931553241

Loading…
Cancel
Save