Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose ProcessorQueueLength from Windows for use in metricbeats #107

Open
bran2k7 opened this issue Jul 5, 2018 · 0 comments
Open

Expose ProcessorQueueLength from Windows for use in metricbeats #107

bran2k7 opened this issue Jul 5, 2018 · 0 comments

Comments

@bran2k7
Copy link

bran2k7 commented Jul 5, 2018

Windows doesn't have a load but a very similar function could be derived from System\Processor Queue Length.
Per http://www.teamquest.com/pdfs/whitepaper/ldavg1.pdf and http://www.teamquest.com/pdfs/whitepaper/ldavg2.pdf Linux uses this exact metric and calculates load at the OS level.
This query should return information that contains the ProcessorQueueLength, and then it can be averaged over time or left to the user to do that if they want in elasticsearch/kibana

	var dst []Win32_PerfRawData_PerfOS_System
	q := wmi.CreateQuery(&dst, "")
	err := wmi.Query(q, &dst)
	if err != nil {
		return Win32_PerfRawData_PerfOS_System{}, errors.Wrap(err, "wmi query for Win32_PerfRawData_PerfOS_System failed")
	}
	if len(dst) != 1 {
		return Win32_PerfRawData_PerfOS_System{}, errors.New("wmi query for Win32_PerfRawData_PerfOS_System failed")
	}
	return dst[0], nil```
I could be wrong about this function but something like this should expose the queue length.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant