#{extends 'RabbitMQStats/layout.html' /}
#{set title:'RabbitMQ' /}

<h1>Live Stats: ${queueName}</h1>

<section>

<h2>Producer</h2>
<p id="producerSuccess">
    <span>Successful: <strong>${producerSuccess}</strong> (average execution time: <strong>${producerSuccessAverageTime} milisecond(s)</strong>)</span>
</p>

<p id="producerFailed">
    <span>Failures: <strong>${producerFailed}</strong> (average execution time: <strong>${producerFailedAverageTime} milisecond(s)</strong>)</span>
</p>        

<h2>Consumer</h2>
<p id="consumerSuccess">
    <span>Successful: <strong>${consumerSuccess}</strong> (average execution time: <strong>${consumerSuccessAverageTime} milisecond(s)</strong>)</span>
</p>

<p id="consumerFailed">
    <span>Failures: <strong>${consumerFailed}</strong> (average execution time: <strong>${consumerFailedAverageTime} milisecond(s)</strong>)</span>
</p>  

</section>

<script type="text/javascript" charset="utf-8">
    setInterval(function() {
        $('section').load('@{queueStatsDetails(queueName)}')
    }, 1000)
</script>                 

<br><br>
<a href="@{RabbitMQStats.index()}">Return Main Page</a>