elastic / elastic-transport-js

Transport classes and utilities shared among Node.js Elastic client libraries
Apache License 2.0
5 stars 25 forks source link

DiagnosticResult includes request duration #35

Open mshustov opened 2 years ago

mshustov commented 2 years ago

🚀 Feature Proposal

It might be really useful for debugging purposes to include response time as part of DiagnosticResult.

Motivation

Solving the problem in the user-land is not the best DX. We can start with something simple - a time between a request method was called and a response from ES is fully received. Later, we can introduce a more detailed explanation for different phases - DNS lookup, TLS handshake, etc.

Example

client.on('....', (error, event) => {
  console.log(`request to ${event.meta.request.path} took ${event.meta.took} ms`)'
});

await client.search(....)
ArchitGajjar commented 1 month ago

HI @JoshMock - Can I work on this issue ? this will be my first contribution to this project ? Thank you very much!

JoshMock commented 4 weeks ago

Absolutely @ArchitGajjar.