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

Implement Performance Measurement APIs from Node.js in AuditTrail for HerbsJS Framework #64

Open
italojs opened this issue May 16, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@italojs
Copy link
Member

italojs commented May 16, 2023

In this issue I would like to discuss usage ideas before implement it

Feature affected: Audit trail feature

New Performance Measurement APIs introduced in Node.js These APIs provide insights into the performance of applications.

This issue proposes the implementation of the Performance Measurement APIs in the AuditTrail module of HerbsJS, enabling developers to seamlessly monitor and measure the performance of their applications.

Benefits:

  • Enhanced Performance Analysis: Developers gain access to detailed performance data (CPU utilization, memory usage, event loop latency, function execution times), facilitating identification of bottlenecks and code optimization.

  • Real-time Monitoring: Developers can monitor application performance in real-time, enabling timely detection of degradation or anomalies, particularly beneficial for high-performance and responsive applications.

  • Optimization Opportunities: Performance data empowers developers to pinpoint areas for code optimization, resulting in faster and more efficient applications.

Use Scenarios:

  • Identifying Slow Routes: Performance Measurement APIs help identify routes or endpoints with longer processing times, allowing optimization for improved response times.

  • Optimizing CPU-bound Operations: Measure CPU utilization, identify CPU-intensive operations, and optimize algorithms or consider parallelization strategies for improved performance.

  • Monitoring Memory Usage: Track memory consumption, detect memory leaks, and optimize memory allocation and deallocation for efficient memory management.

  • Analyzing Event Loop Performance: Gain insights into event loop latency and execution times of event loop handlers, optimizing event-driven applications and ensuring timely event processing.

In conclusion, implementing the Performance Measurement APIs from Node.js 20v in the AuditTrail module of HerbsJS will empower developers to analyze and optimize the performance of their applications more effectively.

Audit trail example:
json

{
    configuration:{output: {return: false, user: false}}
    description:'A use case'
    elapsedTime:362700n
    request: null
    steps: [ {
          type: 'step', 
          description: 'A step',
           return: {Ok: ''},
           metrics: {...}
    }, 
    metrics: {...} 
    elapsedTime: 76100n
    }],
    transactionId:'cfd88c2b-1d34-4c81-a07c-ac4ea5420d04'
    type:'use case'
}

Inside metrics we could collect everything we need from https://nodejs.org/api/perf_hooks.html

It could be activated by using an env var: APM=true npm run start
all the data could be provided in herbsshelf like this another issue requires #55

@italojs italojs added the enhancement New feature or request label May 16, 2023
@italojs italojs changed the title Implement Performance Measurement APIs from Node.js 20v in AuditTrail for HerbsJS Framework Implement Performance Measurement APIs from Node.js in AuditTrail for HerbsJS Framework May 16, 2023
@italojs
Copy link
Member Author

italojs commented May 25, 2023

We could add a page to herbsShelf like this
https://github.com/RafalWilinski/express-status-monitor

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

No branches or pull requests

1 participant