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

feat: add memory to app.getAppMetrics() #18831

Merged
merged 1 commit into from
Jul 23, 2019
Merged

Conversation

miniak
Copy link
Contributor

@miniak miniak commented Jun 16, 2019

Description of Change

Bring back memory info per process returned by app.getAppMetrics(). Follow-up to #18718.
It does not depend on Chromium internals, it’s calling the OS API directly.

Checklist

Release Notes

Notes: Added memory to app.getAppMetrics().

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jun 16, 2019
@miniak miniak marked this pull request as ready for review June 16, 2019 22:37
Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

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

Just gonna have to ask the hard question here, what dependencies does this API have on Chromium internals / content APIs. We've been hurt twice now by memory APIs being removed internally in Chromium, if this one could potentially have the same issue we should seriously consider not adding it.

@miniak miniak self-assigned this Jun 17, 2019
@miniak
Copy link
Contributor Author

miniak commented Jun 17, 2019

Just gonna have to ask the hard question here, what dependencies does this API have on Chromium internals / content APIs. We've been hurt twice now by memory APIs being removed internally in Chromium, if this one could potentially have the same issue we should seriously consider not adding it.

@MarshallOfSound Added more details to the description. We've been affected by the removal of memory info due to the Chromium changes as our telemetry depends on it heavily.

@zcbenz
Copy link
Member

zcbenz commented Jun 17, 2019

Compilation on Windows fails:

../../electron/atom/browser/api/process_metric.cc(73,34): error: out-of-line definition of 'K32GetProcessMemoryInfo' does not match any declaration in 'atom::ProcessMetric'; did you mean 'GetProcessMemoryInfo'?
17375ProcessMemoryInfo ProcessMetric::GetProcessMemoryInfo() const {
17376                                 ^~~~~~~~~~~~~~~~~~~~
17377                                 GetProcessMemoryInfo
17378

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jun 17, 2019
Copy link
Member

@ckerr ckerr left a comment

Choose a reason for hiding this comment

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

It would be preferable to support this on Linux, too.

docs/api/structures/process-metric.md Outdated Show resolved Hide resolved
@miniak miniak force-pushed the miniak/memory-info branch 2 times, most recently from f938938 to 1fea3a7 Compare July 9, 2019 20:00
@miniak miniak requested a review from ckerr July 9, 2019 20:02
@miniak miniak force-pushed the miniak/memory-info branch 2 times, most recently from 4e2f51c to c19dd24 Compare July 9, 2019 20:20
@miniak
Copy link
Contributor Author

miniak commented Jul 17, 2019

@ckerr can you please check the Linux version?

@miniak
Copy link
Contributor Author

miniak commented Jul 17, 2019

@zcbenz can you please check again?

@miniak miniak requested a review from codebytere July 23, 2019 07:13
Copy link
Member

@ckerr ckerr left a comment

Choose a reason for hiding this comment

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

The scaffolding, tests, doc changes, and Linux code all LGTM. Tested on Ubuntu 17.04 👍

The Mac and Windows changes look sane too but I haven't tested them personally. If someone else wants to also give this a pass, that would be great.

@codebytere
Copy link
Member

(approval given that all of the issues i would have raised have all been addressed)

@codebytere codebytere merged commit 103b386 into master Jul 23, 2019
@release-clerk
Copy link

release-clerk bot commented Jul 23, 2019

Release Notes Persisted

Added memory to app.getAppMetrics().

@codebytere codebytere deleted the miniak/memory-info branch July 23, 2019 20:42
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.

None yet

5 participants