Adding Additional Measurements
You can add custom measurements using the start
and stop
methods. If not explicitly stopped, the event will be measured until the middleware receives the response.
Basic
Alternatively, set a known duration using the setDuration
method (in milliseconds):
Or pass a callable for measurement:
Adding Textual Information
You can add textual information to the Server-Timing header without specifying a duration.
Advance
Below is a comprehensive example demonstrating the usage of the Server Timing middleware, including adding custom measurements and textual information:
Additional APM Features
While server timing is a significant component, our APM package includes other features designed to provide a holistic view of your application's performance.
By leveraging the APM features, you can gain valuable insights into your application's performance, enabling you to make informed optimizations and ensure a smooth user experience. The Server Timing headers provide a clear and detailed view of how long different parts of your request handling take, directly within your browser's developer tools. This makes it easier to identify performance bottlenecks and optimize your application's performance effectively.
Last updated
Was this helpful?