-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-29720][CORE] Add linux condition to make ProcfsMetricsGetter more complete #26365
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
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,8 @@ import scala.collection.mutable | |
| import scala.collection.mutable.ArrayBuffer | ||
| import scala.util.Try | ||
|
|
||
| import org.apache.hadoop.util.Shell | ||
|
|
||
| import org.apache.spark.{SparkEnv, SparkException} | ||
| import org.apache.spark.internal.{config, Logging} | ||
| import org.apache.spark.util.Utils | ||
|
|
@@ -62,13 +64,14 @@ private[spark] class ProcfsMetricsGetter(procfsDir: String = "/proc/") extends L | |
| SparkEnv.get.conf.get(config.EVENT_LOG_STAGE_EXECUTOR_METRICS) | ||
| val shouldLogStageExecutorProcessTreeMetrics = | ||
| SparkEnv.get.conf.get(config.EVENT_LOG_PROCESS_TREE_METRICS) | ||
| procDirExists.get && shouldLogStageExecutorProcessTreeMetrics && shouldLogStageExecutorMetrics | ||
| procDirExists.get && shouldLogStageExecutorProcessTreeMetrics && | ||
| shouldLogStageExecutorMetrics && Shell.LINUX | ||
|
||
| } | ||
| } | ||
|
|
||
| private def computePid(): Int = { | ||
| if (!isAvailable || testing) { | ||
| return -1; | ||
| return -1 | ||
| } | ||
| try { | ||
| // This can be simplified in java9: | ||
|
|
@@ -88,7 +91,7 @@ private[spark] class ProcfsMetricsGetter(procfsDir: String = "/proc/") extends L | |
|
|
||
| private def computePageSize(): Long = { | ||
| if (testing) { | ||
| return 4096; | ||
| return 4096 | ||
| } | ||
| try { | ||
| val cmd = Array("getconf", "PAGESIZE") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about checking
os.nameinstead of using hadoop-commons?