Skip to content

fix: update performance tests counter to use camelCase API Key#7870

Open
Sumedh-6504 wants to merge 3 commits into
layer5io:masterfrom
Sumedh-6504:fix/performance-runs-counter
Open

fix: update performance tests counter to use camelCase API Key#7870
Sumedh-6504 wants to merge 3 commits into
layer5io:masterfrom
Sumedh-6504:fix/performance-runs-counter

Conversation

@Sumedh-6504

@Sumedh-6504 Sumedh-6504 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes #7860

Notes for Reviewers

Description

Fixes the performance test run counters displaying as 0 across several pages (Meshery page, Nighthawk page, etc.) due to an API response key mismatch. Additionally resolves an ESLint warning in sistent-component.js that was blocking the pre-commit checks.

Root Cause

  1. API Key Mismatch: The API endpoint at https://cloud.layer5.io/api/performance/results/total returns {"totalRuns": 160375}. However, the components were expecting result.total_runs (snake_case) instead of result.totalRuns (camelCase). Since the snake_case key was undefined, the counter fell back to the initial state of 0.
  2. Husky Pre-commit Block: There was an unused variable warning (isDark declared but never used in sistent-component.js) which blocked the pre-commit hooks due to --max-warnings=0 constraints.

Changes Made

  • src/sections/Counters/index.js — Updated key parsing to support totalRuns || total_runs and added a .catch() block with error logging.
  • src/sections/Meshery/How-meshery-works/specs/data-card.js — Updated key parsing and added error handling (rendered on /cloud-native-management/meshery).
  • src/sections/Projects/Nighthawk/index.js — Updated key parsing and added error handling (rendered on /projects/nighthawk).
  • src/sections/Meshery/Features-Col/index.js — Updated key parsing and changed console.log to console.error in the catch block for consistency.
  • src/templates/sistent-component.js — Removed the unused isDark variable and its unused import to satisfy ESLint constraints and allow pre-commit hooks to pass successfully.

Local Testing & CORS Restriction

Important

The performance test run count will still show 0 (or log a CORS warning) on localhost:8000. The API endpoint restricts CORS requests to the production origin (layer5.io), meaning the browser blocks network requests originating from localhost. The fix is verified to match the production API payload structure and will render correctly once deployed to the production or preview environment.

Screenshots

Screenshot 2026-07-15 014909

Signed commits

  • Yes, I signed my commits.

Signed-off-by: Sumedh-6504 <sumedhrmundewadi@gmail.com>
@Sumedh-6504

Sumedh-6504 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

@rishiraj38 @KatalKavya96 The reason behind that I could not make a video is this, http://localhost:8000 is restricted from the CORS. So now you can actually review the code change.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Preview deployment: https://layer5.io/pr-preview/pr-7870/

Note: Preview may take a moment (GitHub Pages deployment in progress). Please wait and refresh. Track deployment here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inaccurate: "0" performance tests results being reported

1 participant