diff --git a/client/src/actions/stats.js b/client/src/actions/stats.js index 65902e15..a24b3ec7 100644 --- a/client/src/actions/stats.js +++ b/client/src/actions/stats.js @@ -2,7 +2,7 @@ import { createAction } from 'redux-actions'; import Api from '../api/Api'; import { addErrorToast, addSuccessToast } from './index'; -import { normalizeTopStats } from '../helpers/helpers'; +import { normalizeTopStats, secondsToMilliseconds } from '../helpers/helpers'; const apiClient = new Api(); @@ -51,6 +51,7 @@ export const getStats = () => async (dispatch) => { top_blocked_domains: normalizeTopStats(stats.top_blocked_domains), top_clients: normalizeTopStats(stats.top_clients), top_queried_domains: normalizeTopStats(stats.top_queried_domains), + avg_processing_time: secondsToMilliseconds(stats.avg_processing_time), }; dispatch(getStatsSuccess(normalizedStats)); diff --git a/client/src/components/Dashboard/Counters.js b/client/src/components/Dashboard/Counters.js index 36ab78c6..95687d64 100644 --- a/client/src/components/Dashboard/Counters.js +++ b/client/src/components/Dashboard/Counters.js @@ -102,7 +102,7 @@ const Counters = (props) => { - {avgProcessingTime ? `${round(avgProcessingTime, 2)} ms` : 0} + {avgProcessingTime ? `${round(avgProcessingTime)} ms` : 0} diff --git a/client/src/helpers/helpers.js b/client/src/helpers/helpers.js index e84d2b27..ad0e94dd 100644 --- a/client/src/helpers/helpers.js +++ b/client/src/helpers/helpers.js @@ -233,3 +233,11 @@ export const sortClients = (clients) => { export const toggleAllServices = (services, change, isSelected) => { services.forEach(service => change(`blocked_services.${service.id}`, isSelected)); }; + +export const secondsToMilliseconds = (seconds) => { + if (seconds) { + return seconds * 1000; + } + + return seconds; +};