Zizzamia / perfume.js

Web performance library for measuring all performance vitals metrics
https://zizzamia.github.io/perfume/
MIT License
3.13k stars 112 forks source link

How can I get a http api time? #180

Closed jackchoumine closed 2 years ago

jackchoumine commented 3 years ago

I want to know all http api response time in my project, does it support it? How can I do it?

Zizzamia commented 2 years ago

Ciao @jackchoumine how you doing? That metric doesn't come for free, you probably want to use the perfume.start and perfume.end to manually annotate how long it will take each API.

Let me ask you a few questions:

jackchoumine commented 2 years ago

Ciao @jackchoumine how you doing? That metric doesn't come for free, you probably want to use the perfume.start and perfume.end to manually annotate how long it will take each API.

Let me ask you a few questions:

  • what's your goal in measuring this?
  • do you want to measure all APIs or just some?
  1. The goal it to know all api time
  2. All api in projects

I am try to improve a old project I wanna find what http api is slow so I wanna all api time

Zizzamia commented 2 years ago

Yeah, the best bet is to wrap all APIs with an utility that focus on measuring that time. As I mentioned, using Performance Marks is your best bet to get that data.