fixed analytics display

This commit is contained in:
bill bittner 2017-06-27 23:11:51 -07:00
parent fe0d33846b
commit 88ec0d1070
2 changed files with 4 additions and 4 deletions

View file

@ -10,7 +10,7 @@ module.exports = {
.findAll()
.then(data => {
const resultHashTable = {};
let totalRequests = 0;
let totalServe = 0;
let totalPublish = 0;
let totalShow = 0;
let totalCount = 0;
@ -22,7 +22,7 @@ module.exports = {
totalCount += 1;
switch (data[i].action) {
case 'request':
totalRequests += 1;
totalServe += 1;
break;
case 'publish':
totalPublish += 1;
@ -60,7 +60,7 @@ module.exports = {
}
const percentSuccess = Math.round(totalSuccess / totalCount * 100);
// return results
resolve({ records: resultHashTable, totals: { totalRequests, totalPublish, totalShow, totalCount, totalSuccess, totalFailure }, percentSuccess });
resolve({ records: resultHashTable, totals: { totalServe, totalPublish, totalShow, totalCount, totalSuccess, totalFailure }, percentSuccess });
})
.catch(error => {
logger.error('sequelize error', error);

View file

@ -29,7 +29,7 @@
<td class="totals-row center-text">{{ totals.totalFailure }}</td>
</tr>
</table>
<p>Requests: {{ totals.totalRequests }}</p>
<p>Serve: {{ totals.totalServe }}</p>
<p>Publish: {{ totals.totalPublish }}</p>
<p>Show: {{ totals.totalShow }}</p>
<p>Percent Success: {{ percentSuccess}}%</p>