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

Added basic Pdh API implementation #469

Merged
merged 1 commit into from
Jul 20, 2015

Conversation

lgoldstein
Copy link
Contributor

Added some (not all) of the API(s) in the pdh.dll - enough to enable using raw performance counters - as can be clearly demonstrated from the test.

@@ -47,6 +47,7 @@ Features
* [#432](https://github.com/twall/jna/pull/432): Added SetLocalTime definition to 'com.sun.jna.platform.win32.Kernel32' - [@lgoldstein](https://github.com/lgoldstein).
* [#434](https://github.com/twall/jna/pull/434): Added GetEnvironmentStrings to 'com.sun.jna.platform.win32.Kernel32' - [@lgoldstein](https://github.com/lgoldstein).
* Loosen OSGI OS name matching to accommodate Windows 8 family - Niels Bertram.
* [#436] (https://github.com/twall/jna/pull/469): Added basic Pdh API implementation to `com.sun.jna.platform.win32' - [@lgoldstein](https://github.com/lgoldstein).
Copy link
Member

Choose a reason for hiding this comment

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

The second quote should also be a back quote, this doesn't render right.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done - will post an update pull request

@dblock
Copy link
Member

dblock commented Jul 20, 2015

This is nice and clean, great work! Fix the typo in CHANGELOG please via --amend and we're good to go.

public int HeaderLength;
public int NumObjectTypes;
public int DefaultObject;
public SYSTEMTIME SystemTime=new SYSTEMTIME();
Copy link
Member

Choose a reason for hiding this comment

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

You might want to auto-format this file too, there should be a space around the =.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done - will post an updated pull request

@dblock
Copy link
Member

dblock commented Jul 20, 2015

FWIW performance counters are one of the best features of Windows and I have used it extensively. I encourage you to write up a blog post somewhere with an example of how to use this.

@dblock
Copy link
Member

dblock commented Jul 20, 2015

Merging this, thanks.

dblock added a commit that referenced this pull request Jul 20, 2015
Added basic Pdh API implementation
@dblock dblock merged commit 9f094c2 into java-native-access:master Jul 20, 2015
@lgoldstein lgoldstein deleted the pdh-request branch July 21, 2015 12:31
mstyura pushed a commit to mstyura/jna that referenced this pull request Sep 9, 2024
…se of the window (java-native-access#469)

Motivation:

We used a value of 1024 which was too big if we couldnt schedule the reads / writes in the right timely manner. This could lead to a deadlock.

Modifications:

Use a lower value which still provide the required testing but not put us in risk of deadlocks during tests

Result:

More stable builds on CI
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

Successfully merging this pull request may close these issues.

3 participants