Comments (3)
It's a good practice to have each metric with a unique name.
const domain = 'http://example.com/';
async function apiExample(url, metricName) {
perfume.start(`api.${metricName}`);
const response = await fetch(domain + url);
perfume.end(`api.${metricName}`);
return response.json();
}
const first = apiExample('movies.json', 'movies');
const second = apiExample('another.json'. 'another');
Let me know if this makes sense for you 😄, and thank you for the compliments.
Out of curiosity, can you share more on where do you use Perfume? Company name, use cases, city your team lives?
Grazie 🙏
from perfume.js.
Thanks. I understand this approach is better, but the example is rather simplified. We want to measure some user action where you start measuring in a file A and stop measuring in a file B and you can also do those actions in parallel. Eg. in our app, you can open a design or more design simultaneously and we are interested in "opening design" time. So what I think we are going do is to use Perfume inside of our custom Perf service where you can scope measures by some unique id, so measurement will not interfere with each other. Another approach would be to create a new instance of Perfume every time, but that seems odd to me.
Out of curiosity, can you share more on where do you use Perfume? Company name, use cases, city your team lives?
No problem, the company is called Avocode - it's a hand-off tool for designers and developers. We are based in Prague, Czech Republic. We wanted to start doing RUM as we have a lot of users from eastern countries and we are really not sure how well the app runs for them.
from perfume.js.
Amazing, if you want we can talk via google hangout next week 😄
Feel free to private DM me on https://twitter.com/Zizzamia
I will personally avoid creating a new instance for each metric but instead wrap an instance inside your custom Perf service. Do you guys use any framework in particular? I'm looking forward to documenting more different use cases.
from perfume.js.
Related Issues (20)
- IE11 support HOT 2
- Uncaught TypeError in PerformanceObserver HOT 1
- ios 14 compatity issue, and element timing is not working HOT 1
- Is it supported in Safari? HOT 2
- How can I get a http api time? HOT 3
- Resource timings buffer extension HOT 1
- CLS calculation HOT 4
- Question about Interaction to Next Paint (INP) implementation HOT 20
- how use it for Wordpress sites HOT 2
- required member entryTypes is undefined HOT 2
- metric name "navigationTiming" data abnormal HOT 1
- web-vitals navigationType support HOT 5
- Disable requestIdleCallback for CLS and INP reports HOT 6
- TotalBlockingTime wrong reports HOT 2
- Cannot read properties of undefined (reading 'requestStart') on navigation with bfcache HOT 12
- Coinbase website Allowlist bug
- Soft Navigations support HOT 1
- Inaccurate (zero) size reported for some images
- v9.0.0 TS2305: Module '"perfume.js"' has no exported member 'Perfume'. HOT 2
- 0c0d611819dccfbdf82f48c67715e2a02f52e3fe
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from perfume.js.