mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-18 01:18:23 +02:00
fix: disable networkView for dev, fail more gracefully (#2701)
Disables networkView for dev for now. Attempts to fail more gracefully both on the service and front-end.
This commit is contained in:
parent
dc8a369b7b
commit
90f0d665f9
@ -26,12 +26,13 @@ import theme from '../../../themes/theme';
|
|||||||
import { formatDateHM } from '../../../utils/formatDate';
|
import { formatDateHM } from '../../../utils/formatDate';
|
||||||
import { RequestsPerSecondSchema } from 'openapi';
|
import { RequestsPerSecondSchema } from 'openapi';
|
||||||
import 'chartjs-adapter-date-fns';
|
import 'chartjs-adapter-date-fns';
|
||||||
import { PaletteColor } from '@mui/material';
|
import { Alert, PaletteColor } from '@mui/material';
|
||||||
import { PageContent } from '../../common/PageContent/PageContent';
|
import { PageContent } from '../../common/PageContent/PageContent';
|
||||||
import { PageHeader } from '../../common/PageHeader/PageHeader';
|
import { PageHeader } from '../../common/PageHeader/PageHeader';
|
||||||
import { Box } from '@mui/system';
|
import { Box } from '@mui/system';
|
||||||
import { current } from 'immer';
|
import { current } from 'immer';
|
||||||
import { CyclicIterator } from 'utils/cyclicIterator';
|
import { CyclicIterator } from 'utils/cyclicIterator';
|
||||||
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
interface IPoint {
|
interface IPoint {
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
@ -184,6 +185,10 @@ export const InstanceMetricsChart: VFC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent header={<PageHeader title="Requests per second" />}>
|
<PageContent header={<PageHeader title="Requests per second" />}>
|
||||||
|
<ConditionallyRender
|
||||||
|
condition={data.datasets.length === 0}
|
||||||
|
show={<Alert severity="warning">No data available.</Alert>}
|
||||||
|
elseShow={
|
||||||
<Box sx={{ display: 'grid', gap: 4 }}>
|
<Box sx={{ display: 'grid', gap: 4 }}>
|
||||||
<div style={{ height: 400 }}>
|
<div style={{ height: 400 }}>
|
||||||
<Line
|
<Line
|
||||||
@ -193,6 +198,8 @@ export const InstanceMetricsChart: VFC = () => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Box>
|
</Box>
|
||||||
|
}
|
||||||
|
/>
|
||||||
</PageContent>
|
</PageContent>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -225,6 +225,10 @@ export default class ClientInstanceService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getRPSForPath(path: string, hoursToQuery: number): Promise<any> {
|
async getRPSForPath(path: string, hoursToQuery: number): Promise<any> {
|
||||||
|
if (!this.prometheusApi) {
|
||||||
|
this.logger.warn('Prometheus not configured');
|
||||||
|
return;
|
||||||
|
}
|
||||||
const timeoutSeconds = 5;
|
const timeoutSeconds = 5;
|
||||||
const basePath = this.serverOption.baseUriPath;
|
const basePath = this.serverOption.baseUriPath;
|
||||||
const compositePath = `${basePath}/${path}`.replaceAll('//', '/');
|
const compositePath = `${basePath}/${path}`.replaceAll('//', '/');
|
||||||
|
@ -42,7 +42,6 @@ process.nextTick(async () => {
|
|||||||
changeRequests: true,
|
changeRequests: true,
|
||||||
favorites: true,
|
favorites: true,
|
||||||
variantsPerEnvironment: true,
|
variantsPerEnvironment: true,
|
||||||
networkView: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
authentication: {
|
authentication: {
|
||||||
|
Loading…
Reference in New Issue
Block a user