-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-24958][CORE] Add memory from procfs to executor metrics. #22612
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
Changes from 1 commit
3f8321a
cd16a75
94c2b04
062f5d7
245221d
c72be03
8f3c938
f2dca27
a9f924c
a11e3a2
34ad625
415f976
067b81d
18ee4ad
7f7ed2b
f3867ff
0f8f3e2
ea08c61
8f20857
6e65360
4659f4a
ef4be38
805741c
4c1f073
0a7402e
3d65b35
6eab315
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
(cherry picked from commit 3671427)
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,8 +37,12 @@ class ProcfsBasedSystems extends ProcessTreeMetrics with Logging { | |
| val ptree: scala.collection.mutable.Map[ Int, Set[Int]] = | ||
| scala.collection.mutable.Map[ Int, Set[Int]]() | ||
| val PROCFS_STAT_FILE = "stat" | ||
| var latestVmemTotal: Long = 0 | ||
| var latestRSSTotal: Long = 0 | ||
| var latestJVMVmemTotal: Long = 0 | ||
| var latestJVMRSSTotal: Long = 0 | ||
| var latestPythonVmemTotal: Long = 0 | ||
| var latestPythonRSSTotal: Long = 0 | ||
| var latestOtherVmemTotal: Long = 0 | ||
| var latestOtherRSSTotal: Long = 0 | ||
|
|
||
| createProcessTree | ||
|
|
||
|
|
@@ -155,37 +159,82 @@ class ProcfsBasedSystems extends ProcessTreeMetrics with Logging { | |
| fReader.close | ||
| val procInfoSplit = procInfo.split(" ") | ||
| if ( procInfoSplit != null ) { | ||
| latestVmemTotal += procInfoSplit(22).toLong | ||
| latestRSSTotal += procInfoSplit(23).toLong | ||
| if (procInfoSplit(1).toLowerCase.contains("java")) { | ||
|
||
| latestJVMVmemTotal += procInfoSplit(22).toLong | ||
| latestJVMRSSTotal += procInfoSplit(23).toLong | ||
|
||
| } | ||
| else if (procInfoSplit(1).toLowerCase.contains("python")) { | ||
| latestPythonVmemTotal += procInfoSplit(22).toLong | ||
| latestPythonRSSTotal += procInfoSplit(23).toLong | ||
| } | ||
| else { | ||
| latestOtherVmemTotal += procInfoSplit(22).toLong | ||
| latestOtherRSSTotal += procInfoSplit(23).toLong } | ||
| } | ||
| } catch { | ||
| case f: FileNotFoundException => return null | ||
| } | ||
| } | ||
|
|
||
|
|
||
| def getRSSInfo(): Long = { | ||
| def getOtherRSSInfo(): Long = { | ||
| if (!isAvailable) { | ||
| return -1 | ||
| } | ||
| updateProcessTree | ||
| val pids = ptree.keySet | ||
| latestRSSTotal = 0 | ||
| latestVmemTotal = 0 | ||
| latestJVMRSSTotal = 0 | ||
rezasafi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| latestJVMVmemTotal = 0 | ||
| latestPythonRSSTotal = 0 | ||
| latestPythonVmemTotal = 0 | ||
| latestOtherRSSTotal = 0 | ||
| latestOtherVmemTotal = 0 | ||
| for (p <- pids) { | ||
| getProcessInfo(p) | ||
| } | ||
| latestRSSTotal | ||
| latestOtherRSSTotal | ||
| } | ||
|
|
||
|
|
||
| def getVirtualMemInfo(): Long = { | ||
| def getOtherVirtualMemInfo(): Long = { | ||
| if (!isAvailable) { | ||
| return -1 | ||
| } | ||
| // We won't call updateProcessTree and also compute total virtual memory here | ||
| // since we already did all of this when we computed RSS info | ||
| latestVmemTotal | ||
| latestOtherVmemTotal | ||
| } | ||
|
|
||
|
|
||
| def getJVMRSSInfo(): Long = { | ||
| if (!isAvailable) { | ||
| return -1 | ||
| } | ||
| latestJVMRSSTotal | ||
| } | ||
|
|
||
|
|
||
| def getJVMVirtualMemInfo(): Long = { | ||
| if (!isAvailable) { | ||
| return -1 | ||
| } | ||
| latestJVMVmemTotal | ||
| } | ||
|
|
||
|
|
||
| def getPythonRSSInfo(): Long = { | ||
| if (!isAvailable) { | ||
| return -1 | ||
| } | ||
| latestPythonRSSTotal | ||
| } | ||
|
|
||
|
|
||
| def getPythonVirtualMemInfo(): Long = { | ||
| if (!isAvailable) { | ||
| return -1 | ||
| } | ||
| latestPythonVmemTotal | ||
| } | ||
|
|
||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.