fixed analytics display
This commit is contained in:
parent
fe0d33846b
commit
88ec0d1070
2 changed files with 4 additions and 4 deletions
|
@ -10,7 +10,7 @@ module.exports = {
|
||||||
.findAll()
|
.findAll()
|
||||||
.then(data => {
|
.then(data => {
|
||||||
const resultHashTable = {};
|
const resultHashTable = {};
|
||||||
let totalRequests = 0;
|
let totalServe = 0;
|
||||||
let totalPublish = 0;
|
let totalPublish = 0;
|
||||||
let totalShow = 0;
|
let totalShow = 0;
|
||||||
let totalCount = 0;
|
let totalCount = 0;
|
||||||
|
@ -22,7 +22,7 @@ module.exports = {
|
||||||
totalCount += 1;
|
totalCount += 1;
|
||||||
switch (data[i].action) {
|
switch (data[i].action) {
|
||||||
case 'request':
|
case 'request':
|
||||||
totalRequests += 1;
|
totalServe += 1;
|
||||||
break;
|
break;
|
||||||
case 'publish':
|
case 'publish':
|
||||||
totalPublish += 1;
|
totalPublish += 1;
|
||||||
|
@ -60,7 +60,7 @@ module.exports = {
|
||||||
}
|
}
|
||||||
const percentSuccess = Math.round(totalSuccess / totalCount * 100);
|
const percentSuccess = Math.round(totalSuccess / totalCount * 100);
|
||||||
// return results
|
// 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 => {
|
.catch(error => {
|
||||||
logger.error('sequelize error', error);
|
logger.error('sequelize error', error);
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
<td class="totals-row center-text">{{ totals.totalFailure }}</td>
|
<td class="totals-row center-text">{{ totals.totalFailure }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<p>Requests: {{ totals.totalRequests }}</p>
|
<p>Serve: {{ totals.totalServe }}</p>
|
||||||
<p>Publish: {{ totals.totalPublish }}</p>
|
<p>Publish: {{ totals.totalPublish }}</p>
|
||||||
<p>Show: {{ totals.totalShow }}</p>
|
<p>Show: {{ totals.totalShow }}</p>
|
||||||
<p>Percent Success: {{ percentSuccess}}%</p>
|
<p>Percent Success: {{ percentSuccess}}%</p>
|
||||||
|
|
Loading…
Reference in a new issue