projects
/
folly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d7c649a
)
Add accessor to estimate a FiberManager's run queue size
author
Brian Watling
<bwatling@fb.com>
Fri, 31 Jul 2015 15:52:36 +0000
(08:52 -0700)
committer
facebook-github-bot-1
<folly-bot@fb.com>
Fri, 31 Jul 2015 16:22:08 +0000
(09:22 -0700)
Summary: Add accessor to estimate a FiberManager's run queue size
Reviewed By: @sarangbh
Differential Revision:
D2293367
folly/experimental/fibers/FiberManager.h
patch
|
blob
|
history
diff --git
a/folly/experimental/fibers/FiberManager.h
b/folly/experimental/fibers/FiberManager.h
index 9c2ae7567fbd693e0fee9f17d9931ee3a9000f37..6f19b87ee2dd4add01fc11ba76ca68b67303dee2 100644
(file)
--- a/
folly/experimental/fibers/FiberManager.h
+++ b/
folly/experimental/fibers/FiberManager.h
@@
-252,6
+252,14
@@
class FiberManager : public ::folly::Executor {
*/
void setObserver(ExecutionObserver* observer);
+ /**
+ * Returns an estimate of the number of fibers which are waiting to run (does
+ * not include fibers or tasks scheduled remotely).
+ */
+ size_t runQueueSize() const {
+ return readyFibers_.size() + yieldedFibers_.size();
+ }
+
static FiberManager& getFiberManager();
static FiberManager* getFiberManagerUnsafe();