mirror of
https://github.com/yldio/copilot.git
synced 2024-11-28 06:00:06 +02:00
style(cp-frontend): format
This commit is contained in:
parent
d08a8b00a9
commit
0d659c94e8
@ -12,7 +12,7 @@ export const MetricNames = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const withServiceMetricsPolling = ({
|
export const withServiceMetricsPolling = ({
|
||||||
pollingInterval = 1000, // in milliseconds
|
pollingInterval = 1000, // In milliseconds
|
||||||
getPreviousEnd = () =>
|
getPreviousEnd = () =>
|
||||||
moment()
|
moment()
|
||||||
.utc()
|
.utc()
|
||||||
@ -55,14 +55,17 @@ export const withServiceMetricsGql = ({
|
|||||||
instanceId,
|
instanceId,
|
||||||
metricName
|
metricName
|
||||||
) => {
|
) => {
|
||||||
const service = find(get(previousResult, 'deploymentGroup.services', []), ['id', serviceId]);
|
const service = find(get(previousResult, 'deploymentGroup.services', []), [
|
||||||
|
'id',
|
||||||
|
serviceId
|
||||||
|
]);
|
||||||
|
|
||||||
if (!service) {
|
if (!service) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return service
|
return service.instances
|
||||||
.instances.find(i => i.id === instanceId)
|
.find(i => i.id === instanceId)
|
||||||
.metrics.find(m => m.name === metricName).metrics;
|
.metrics.find(m => m.name === metricName).metrics;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -99,7 +102,7 @@ export const withServiceMetricsGql = ({
|
|||||||
const params = props.match.params;
|
const params = props.match.params;
|
||||||
const deploymentGroupSlug = params.deploymentGroup;
|
const deploymentGroupSlug = params.deploymentGroup;
|
||||||
|
|
||||||
// this is potentially prone to overfetching if we already have data within timeframe and we leave the page then come back to it
|
// This is potentially prone to overfetching if we already have data within timeframe and we leave the page then come back to it
|
||||||
const end = moment();
|
const end = moment();
|
||||||
const start = moment(end).subtract(
|
const start = moment(end).subtract(
|
||||||
graphDurationSeconds + updateIntervalSeconds,
|
graphDurationSeconds + updateIntervalSeconds,
|
||||||
|
Loading…
Reference in New Issue
Block a user