Struct dvcompute::simulation::queue::stats::Queue [−][src]
pub struct Queue<SI, SM, SO, T> where
SI: QueueStrategy,
SM: QueueStrategy,
SO: QueueStrategy, { /* fields omitted */ }
Expand description
Represents a bounded queue by using the specified strategies for enqueueing (input), SI
,
internal storing (in memory), SM
, and dequeueing (output), SO
, where T
denotes
the type of items stored in the queue.
Implementations
impl<SI, SM, SO, T> Queue<SI, SM, SO, T> where
SI: QueueStrategy + 'static,
SM: QueueStrategy + 'static,
SO: QueueStrategy + 'static,
T: Clone + 'static,
impl<SI, SM, SO, T> Queue<SI, SM, SO, T> where
SI: QueueStrategy + 'static,
SM: QueueStrategy + 'static,
SO: QueueStrategy + 'static,
T: Clone + 'static,
Create a new bounded queue by the specified strategies and capacity.
Test whether the queue is empty.
Notifies when the is_empty
property changes.
Notifies when the is_empty
property changes.
Test whether the queue is full.
Notifies when the is_full
property changes.
Notifies when the is_full
property changes.
Return the current queue size.
Return the statistics for the queue size.
Notifies when the count
property changes.
Notifies when the count
property changes.
Return the total number of enqueue operations, including those ones that have failed due to full capacity.
Notifies when the enqueue_count
property changes.
Notifies when the enqueue_count
property changes.
Return the total number of items that could not be enqueued due to full capacity.
pub fn enqueue_lost_count_changed(
queue: Rc<Self>
) -> impl Observable<Message = isize> + Clone
pub fn enqueue_lost_count_changed(
queue: Rc<Self>
) -> impl Observable<Message = isize> + Clone
Notifies when the enqueue_lost_count
property changes.
Notifies when the enqueue_lost_count
property changes.
Return the total number of input items that were stored.
pub fn enqueue_store_count_changed(
queue: Rc<Self>
) -> impl Observable<Message = isize> + Clone
pub fn enqueue_store_count_changed(
queue: Rc<Self>
) -> impl Observable<Message = isize> + Clone
Notifies when the enqueue_store_count
property changes.
Notifies when the enqueue_store_count
property changes.
Return the total number of requests to dequeue the items.
Notifies when the dequeue_count
property changes.
Notifies when the dequeue_count
property changes.
Return the total number of items that were extracted from the queue with help of dequeue operations.
pub fn dequeue_extract_count_changed(
queue: Rc<Self>
) -> impl Observable<Message = isize> + Clone
pub fn dequeue_extract_count_changed(
queue: Rc<Self>
) -> impl Observable<Message = isize> + Clone
Notifies when the dequeue_extract_count
property changes.
Notifies when the dequeue_extract_count
property changes.
Return the load factor: the queue size divided by its capacity, i.e. maximum size.
Notifies when the load_factor
property changes.
Notifies when the load_factor
property changes.
Return the rate of input items that were enqueued: how many items per time.
Return the rate of input items that were stored: how many items per time.
Return the rate of requests for dequeueing the items: how many items per time. It does not include the failed attempts to dequeue immediately without suspension.
Return the rate of output items that were actually extracted from the queue: how many items per time.
Return the wait time from the time at which the item was stored in the queue to the time at which it was dequeued.
pub fn wait_time_changed(
queue: Rc<Self>
) -> impl Observable<Message = SamplingStats<f64>> + Clone
pub fn wait_time_changed(
queue: Rc<Self>
) -> impl Observable<Message = SamplingStats<f64>> + Clone
Notifies when the wait_time
property changes.
Notifies when the wait_time
property changes.
Return the total wait time from the time at which the enqueue operation was initiated to the time at which the item was dequeued.
In some sense, total_wait_time
== enqueue_wait_time
+ wait_time
.
pub fn total_wait_time_changed(
queue: Rc<Self>
) -> impl Observable<Message = SamplingStats<f64>> + Clone
pub fn total_wait_time_changed(
queue: Rc<Self>
) -> impl Observable<Message = SamplingStats<f64>> + Clone
Notifies when the total_wait_time
property changes.
Notifies when the total_wait_time
property changes.
Return the enqueue wait time from the time at which the enqueue operation was initiated to the time at which the item was stored in the queue.
pub fn enqueue_wait_time_changed(
queue: Rc<Self>
) -> impl Observable<Message = SamplingStats<f64>> + Clone
pub fn enqueue_wait_time_changed(
queue: Rc<Self>
) -> impl Observable<Message = SamplingStats<f64>> + Clone
Notifies when the enqueue_wait_time
property changes.
Notifies when the enqueue_wait_time
property changes.
Return the dequeue wait time from the time at which the dequeue request was made to the time at which the corresponding item was actually dequeued.
pub fn dequeue_wait_time_changed(
queue: Rc<Self>
) -> impl Observable<Message = SamplingStats<f64>> + Clone
pub fn dequeue_wait_time_changed(
queue: Rc<Self>
) -> impl Observable<Message = SamplingStats<f64>> + Clone
Notifies when the dequeue_wait_time
property changes.
Notifies when the dequeue_wait_time
property changes.
Return a long-term average queue rate calculated as the average queue size divided by the average wait time.
This value may be less than the actual arrival rate as the queue is bounded and new arrivals may be blocked while the queue remains full.
Notifies when the rate
property changes.
Notifies when the rate
property changes.
Dequeue by suspending the process if the queue is empty.
Dequeue with output prioerity by suspending the process if the queue is empty.
Try to dequeue immediately.
Remove the item from the queue and return a flag indicating whether the item was found and actually removed.
Remove the specified item from the queue.
Remove an item satisfying the specified predicate and return the item if found.
Test whether there is an item satisfying the specified predicate.
Find an item satisfying the specified predicate.
Enqueue the item by suspending the process if the queue is full.
Enqueue the item with input priority by suspending the process if the queue is full.
Enqueue the item with storing priority by suspending the process if the queue is full.
Enqueue the item with input and storing priorities by suspending the process if the queue is full.
Try to enqueue the item. Return false
within Event
computation if the queue is full.
Try to enqueue the item with storing priority. Return false
within Event
computation if the queue is full.
Try to enqueue the item. If the queue is full then
the item will be counted as lost and false
will be returned.
Try to enqueue the item with storing piority. If the queue is full then
the item will be counted as lost and false
will be returned.
Try to enqueue the item. If the queue is full then the item will be counted as lost.
Try to enqueue the item with storing priority. If the queue is full then the item will be counted as lost.
Notifies when the enqueue operation is initiated.
Notifies when the item to be enqueued is stored.
Notifies when the item that would have to be enqueued is lost.
Notifies when the dequeue operation is requested for.
Notifies when the item is dequeued.
Notifies whenever any property changes.
Wait while the queue is full.