Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
commit
0a9bbde6d0
|
@ -139,6 +139,23 @@ public abstract class SelectorManager extends ContainerLifeCycle implements Dump
|
|||
executor.execute(task);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get total number of keys from each selector.
|
||||
*
|
||||
* @return total number of selector keys
|
||||
*/
|
||||
@ManagedAttribute(value = "Total number of keys in all selectors", readonly = true)
|
||||
public int getTotalKeys()
|
||||
{
|
||||
int keys = 0;
|
||||
for (final ManagedSelector selector : _selectors)
|
||||
{
|
||||
keys += selector.getTotalKeys();
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the number of selectors in use
|
||||
*/
|
||||
|
@ -506,4 +523,10 @@ public abstract class SelectorManager extends ContainerLifeCycle implements Dump
|
|||
{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("%s@%x[keys=%d]", getClass().getSimpleName(), hashCode(), getTotalKeys());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue