Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename config to spark.driver.metrics.pollingInterval
  • Loading branch information
ForVic committed Aug 26, 2025
commit ec588a051fdb8273743d8c5d0433294bbe157e47
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ class SparkContext(config: SparkConf) extends Logging {
_heartbeater = new Heartbeater(
() => SparkContext.this.reportHeartBeat(_executorMetricsSource),
"driver-heartbeater",
conf.get(DRIVER_HEARTBEAT_INTERVAL))
conf.get(DRIVER_METRICS_POLLING_INTERVAL))
_heartbeater.start()

// start TaskScheduler after taskScheduler sets DAGScheduler reference in DAGScheduler's
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ package object config {
.timeConf(TimeUnit.MILLISECONDS)
.createWithDefaultString("10s")

private[spark] val DRIVER_HEARTBEAT_INTERVAL =
ConfigBuilder("spark.driver.heartbeatInterval")
private[spark] val DRIVER_METRICS_POLLING_INTERVAL =
ConfigBuilder("spark.driver.metrics.pollingInterval")
.version("4.1.0")
.fallbackConf(EXECUTOR_HEARTBEAT_INTERVAL)
Copy link
Member

Choose a reason for hiding this comment

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

Could you add more fields like spark.executor.metrics.pollingInterval, e.g., .doc and .timeConf? In addition, it would be great if we can place this new configuration to somewhere near the driver configs live instead of here.

private[spark] val EXECUTOR_METRICS_POLLING_INTERVAL =
ConfigBuilder("spark.executor.metrics.pollingInterval")
.doc("How often to collect executor metrics (in milliseconds). " +
"If 0, the polling is done on executor heartbeats. " +
"If positive, the polling is done at this interval.")
.version("3.0.0")
.timeConf(TimeUnit.MILLISECONDS)
.createWithDefaultString("0")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added doc string, but we can't add both .timeConf and .fallbackConf and if user has non-default EXECUTOR_HEARTBEAT_INTERVAL, we should fallback to matching behavior, thoughts?


Expand Down