mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-06 01:15:28 +02:00
fix: when app count is zero because it just started (#3029)
## About the changes This fixes response time metrics with app names when the app just starts and has zero which is falsy. We want to compare against undefined (which means the snapshot is not yet ready)
This commit is contained in:
parent
afe01b5528
commit
896994d42f
@ -4,6 +4,8 @@ import { useInstanceMetrics } from 'hooks/api/getters/useInstanceMetrics/useInst
|
|||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import { Alert, styled } from '@mui/material';
|
import { Alert, styled } from '@mui/material';
|
||||||
import { unknownify } from 'utils/unknownify';
|
import { unknownify } from 'utils/unknownify';
|
||||||
|
import logoIcon from 'assets/icons/logoBg.svg';
|
||||||
|
import { formatAssetPath } from 'utils/formatPath';
|
||||||
|
|
||||||
const StyledMermaid = styled(Mermaid)(({ theme }) => ({
|
const StyledMermaid = styled(Mermaid)(({ theme }) => ({
|
||||||
'#mermaid .node rect': {
|
'#mermaid .node rect': {
|
||||||
@ -61,7 +63,9 @@ export const NetworkOverview = () => {
|
|||||||
graph TD
|
graph TD
|
||||||
subgraph _[ ]
|
subgraph _[ ]
|
||||||
direction BT
|
direction BT
|
||||||
Unleash(<img src='https://www.getunleash.io/logos/unleash_glyph_pos.svg' width='60' height='60' /><br/>Unleash)
|
Unleash(<img src='${formatAssetPath(
|
||||||
|
logoIcon
|
||||||
|
)}' width='60' height='60' /><br/>Unleash)
|
||||||
${apps
|
${apps
|
||||||
.map(
|
.map(
|
||||||
({ label, reqs, type }, i) =>
|
({ label, reqs, type }, i) =>
|
||||||
|
@ -21,7 +21,7 @@ export function responseTimeMetrics(
|
|||||||
let appName;
|
let appName;
|
||||||
if (
|
if (
|
||||||
flagResolver.isEnabled('responseTimeWithAppName') &&
|
flagResolver.isEnabled('responseTimeWithAppName') &&
|
||||||
(instanceStatsService.getAppCountSnapshot('7d') ||
|
(instanceStatsService.getAppCountSnapshot('7d') ??
|
||||||
appNameReportingThreshold) < appNameReportingThreshold
|
appNameReportingThreshold) < appNameReportingThreshold
|
||||||
) {
|
) {
|
||||||
appName = req.headers['unleash-appname'] ?? req.query.appName;
|
appName = req.headers['unleash-appname'] ?? req.query.appName;
|
||||||
|
Loading…
Reference in New Issue
Block a user