webapp: implemented cache hit stats into dashboard.

This commit is contained in:
Shreyas Zare
2018-12-09 17:07:27 +05:30
parent c26017755d
commit cd86ca5eb8
3 changed files with 16 additions and 2 deletions

View File

@@ -214,6 +214,11 @@ label {
color: #ffffff;
}
.stats-panel .cache-hit {
background-color: rgba(111, 84, 153, 0.7);
color: #ffffff;
}
.stats-panel .no-error {
background-color: rgba(92, 184, 92, 0.7);
color: #ffffff;
@@ -255,7 +260,7 @@ label {
}
.stats-panel .stats-item {
width: 120px;
width: 107px;
float: left;
padding: 6px;
margin-right: 3px;
@@ -263,7 +268,7 @@ label {
}
.stats-panel .stats-item .number {
font-size: 16px;
font-size: 15px;
font-weight: bold;
}

View File

@@ -131,6 +131,12 @@
<div class="title">Total Queries</div>
</div>
<div class="stats-item cache-hit">
<div class="number" id="divDashboardStatsTotalCacheHit">10</div>
<div class="percentage" id="divDashboardStatsTotalCacheHitPercentage">0%</div>
<div class="title">Cache Hit</div>
</div>
<div class="stats-item no-error">
<div class="number" id="divDashboardStatsTotalNoError">70</div>
<div class="percentage" id="divDashboardStatsTotalNoErrorPercentage">0%</div>

View File

@@ -687,6 +687,7 @@ function refreshDashboard(hideLoader) {
//stats
$("#divDashboardStatsTotalQueries").text(responseJSON.response.stats.totalQueries.toLocaleString());
$("#divDashboardStatsTotalCacheHit").text(responseJSON.response.stats.totalCacheHit.toLocaleString());
$("#divDashboardStatsTotalNoError").text(responseJSON.response.stats.totalNoError.toLocaleString());
$("#divDashboardStatsTotalServerFailure").text(responseJSON.response.stats.totalServerFailure.toLocaleString());
$("#divDashboardStatsTotalNameError").text(responseJSON.response.stats.totalNameError.toLocaleString());
@@ -697,6 +698,7 @@ function refreshDashboard(hideLoader) {
$("#divDashboardStatsBlockedZones").text(responseJSON.response.stats.blockedZones.toLocaleString());
if (responseJSON.response.stats.totalQueries > 0) {
$("#divDashboardStatsTotalCacheHitPercentage").text((responseJSON.response.stats.totalCacheHit * 100 / responseJSON.response.stats.totalQueries).toFixed(2) + "%");
$("#divDashboardStatsTotalNoErrorPercentage").text((responseJSON.response.stats.totalNoError * 100 / responseJSON.response.stats.totalQueries).toFixed(2) + "%");
$("#divDashboardStatsTotalServerFailurePercentage").text((responseJSON.response.stats.totalServerFailure * 100 / responseJSON.response.stats.totalQueries).toFixed(2) + "%");
$("#divDashboardStatsTotalNameErrorPercentage").text((responseJSON.response.stats.totalNameError * 100 / responseJSON.response.stats.totalQueries).toFixed(2) + "%");
@@ -704,6 +706,7 @@ function refreshDashboard(hideLoader) {
$("#divDashboardStatsTotalBlockedPercentage").text((responseJSON.response.stats.totalBlocked * 100 / responseJSON.response.stats.totalQueries).toFixed(2) + "%");
}
else {
$("#divDashboardStatsTotalCacheHitPercentage").text("0%");
$("#divDashboardStatsTotalNoErrorPercentage").text("0%");
$("#divDashboardStatsTotalServerFailurePercentage").text("0%");
$("#divDashboardStatsTotalNameErrorPercentage").text("0%");