1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01: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:
Gastón Fournier 2023-02-01 17:30:35 +01:00 committed by GitHub
parent afe01b5528
commit 896994d42f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -4,6 +4,8 @@ import { useInstanceMetrics } from 'hooks/api/getters/useInstanceMetrics/useInst
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import { Alert, styled } from '@mui/material';
import { unknownify } from 'utils/unknownify';
import logoIcon from 'assets/icons/logoBg.svg';
import { formatAssetPath } from 'utils/formatPath';
const StyledMermaid = styled(Mermaid)(({ theme }) => ({
'#mermaid .node rect': {
@ -61,7 +63,9 @@ export const NetworkOverview = () => {
graph TD
subgraph _[ ]
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
.map(
({ label, reqs, type }, i) =>

View File

@ -21,7 +21,7 @@ export function responseTimeMetrics(
let appName;
if (
flagResolver.isEnabled('responseTimeWithAppName') &&
(instanceStatsService.getAppCountSnapshot('7d') ||
(instanceStatsService.getAppCountSnapshot('7d') ??
appNameReportingThreshold) < appNameReportingThreshold
) {
appName = req.headers['unleash-appname'] ?? req.query.appName;