Skip to content

Expose ProcessorQueueLength from Windows for use in metricbeats #107

Open

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions