Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rework Task Manager Real Data #1483

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Stijnus
Copy link
Collaborator

@Stijnus Stijnus commented Mar 8, 2025

Bugfix for : #1455

TaskManager Tab Changes

Core Functionality Updates

  • Removed JavaScript heap memory monitoring in favor of system memory metrics
  • Added real system memory monitoring via /api/system/memory-info endpoint
  • Implemented swap memory monitoring and visualization
  • Enhanced network latency monitoring with real measurements
  • Added historical data tracking for metrics (last 30 measurements)

Performance Improvements

  • Reduced update interval from 1s to 2.5s to decrease overhead
  • Added tab visibility detection to pause updates when tab is not visible
  • Implemented proper cleanup of Chart.js instances
  • Limited metrics history to prevent memory buildup
  • Optimized chart rendering with React.useMemo

UI/UX Enhancements

  • Added separate cards for System Memory and Swap Memory
  • Improved memory usage visualization with color-coded indicators
  • Enhanced network metrics display (current, min, max, average latency)
  • Added tooltips for technical terms
  • Implemented responsive progress bars for memory usage

Alert System

  • Implemented smart alert system that only triggers on state changes
  • Added critical memory usage notifications (>95% threshold)
  • Limited alerts history to last 10 entries
  • Added toast notifications with 5s auto-close
  • Implemented "Clear All" functionality for alerts

Type Safety

  • Added proper TypeScript interfaces for all metrics
  • Implemented proper type checking for system memory info
  • Added proper error handling for API calls
  • Enhanced type safety for Chart.js references

Code Organization

  • Separated metric collection logic into discrete functions
  • Implemented proper cleanup patterns
  • Added comprehensive error handling
  • Improved code readability with proper spacing and organization

Screenshots

screencapture-localhost-5173-2025-03-08-23_12_47

@leex279
Copy link
Collaborator

leex279 commented Mar 9, 2025

I am not sure if is correct. For me, at least with pnpm run dev, it spawns 2 nodejs nodes, and you show only the usage of the lower one
image

@EXELANCE-LLC
Copy link

40 kb seems to be total Memory. Where can we raise this?

@thecodacus
Copy link
Collaborator

I would like to make this feature enabled/disabled based on environment variables.
for infra like netlify cloudflare these metrics will not be available. so this should be by default disabled and only if the user wants and running in a VM or server then should enable from environment vars

@Stijnus
Copy link
Collaborator Author

Stijnus commented Mar 10, 2025

I would like to make this feature enabled/disabled based on environment variables. for infra like netlify cloudflare these metrics will not be available. so this should be by default disabled and only if the user wants and running in a VM or server then should enable from environment vars

I will check it out if we can implement it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants