-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finagle-core: Track offload task delays at a given rate
Problem There is no visibility into how long tasks have been sitting in the offload queue. Knowing this could be useful for tuning and troubleshooting. Solution Add a new stat `finagle/offload_pool/delay_ms` that records a delay between when the task is submitted and when it's executed. For efficiency reasons, we're not instrumenting every task but do sample the offload queue at the given interval (1 second by default). The sampling interval can be set via the `com.twitter.finagle.offload.delaySampleInterval` flag. JIRA Issues: CSL-10315 Differential Revision: https://phabricator.twitter.biz/D571980
- Loading branch information
1 parent
af228ca
commit a7ebf2e
Showing
6 changed files
with
113 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
finagle-core/src/main/scala/com/twitter/finagle/offload/delaySampleInterval.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package scala.com.twitter.finagle.offload | ||
|
||
import com.twitter.app.GlobalFlag | ||
import com.twitter.util.Duration | ||
|
||
object delaySampleInterval | ||
extends GlobalFlag[Duration]( | ||
Duration.fromMilliseconds(100), | ||
"Sample offload filter queue at this interval and record task delay (in milliseconds) under " + | ||
"offload_pool/delay_ms stat (default: 100ms). Setting this flag to either 'duration.top', " + | ||
"'duration.bottom', or zero disables both the stat and sampling." | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters