Skip to content

Add back Get-Counter cmdlet for Windows #10933

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

Merged
merged 8 commits into from
Nov 6, 2019

Conversation

SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Oct 29, 2019

PR Summary

Reviewed the APIs being used. Get-Counter can work with just public APIs published in pdh.h. Import-Counter and Export-Counter rely on undocumented APIs so those are removed. The PDH apis are really old so I don't believe there's any chance to get those APIs or the binary log format documented so removed that code. Get-Counter -ListSet has Description property as empty because it isn't supported by PDH apis.

PR Checklist

@SteveL-MSFT
Copy link
Member Author

@sdwheeler new fwlink for Get-Counter?

@sdwheeler
Copy link
Collaborator

sdwheeler commented Oct 29, 2019

@SteveL-MSFT https://go.microsoft.com/fwlink/?linkid=2109647

The Get-Counter cmdlet gets performance counter data directly from the performance monitoring instrumentation in the Windows family of operating systems. Get-Counter gets performance data from a local computer or remote computers. You can use the Get-Counter parameters to specify one or more computers, list the performance counter sets and the instances they contain, set the sample intervals, and specify the maximum number of samples. Without parameters, Get-Counter gets performance counter data for a set of system counters. Many counter sets are protected by access control lists (ACL). To see all counter sets, open PowerShell with the Run as administrator option.

Copy link
Collaborator

@iSazonov iSazonov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found https://github.com/microsoft/Tx. It seems work with blg.

@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Oct 30, 2019
@iSazonov iSazonov added this to the 7.0.0-preview.6 milestone Oct 30, 2019
@SteveL-MSFT
Copy link
Member Author

@iSazonov nice find, seems that Tx is using a different set of APIs to read the log, not sure if there is a different public api to write the binary log. I suggest we defer this for now.

@iSazonov
Copy link
Collaborator

I suggest we defer this for now.

Maybe open a tracking issue if you plan to investigate this?

@SteveL-MSFT
Copy link
Member Author

@iSazonov created #10946

@TravisEz13
Copy link
Member

@SteveL-MSFT Can you run a coordinated package build and send me a Direct Message with the build information? Let's verify this doesn't cause any new compliance issues.

@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Nov 5, 2019
@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Nov 5, 2019
@TravisEz13 TravisEz13 merged commit 7ddfb82 into PowerShell:master Nov 6, 2019
@SteveL-MSFT SteveL-MSFT deleted the perfcounters branch November 6, 2019 16:16
@ghost
Copy link

ghost commented Nov 21, 2019

🎉v7.0.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants