Improve metrics to be more analytics friendly
See original GitHub issue@oscarotero and team, I have these suggestions for improving metrics:
- Increase granularity
- Allow “baggage” (in open telemetry terms) to be contributed by pages
Increasing granularity. Right now we have the following in metrics.json
where the “name” has event details that need to parsed in order to be consumable for analytics:
{
"name": "Load: /support/generate-static-build.sh",
"entryType": "measure",
"startTime": 1009.5581999999999,
"duration": 0.1815000000000282,
"detail": null
}
Instead, I suggest something like this:
{
"name": "Load: /home", // human-friendly, not useful for analytics
"nature": { category: "load" }, // analytics-friendly, nature can be like a URL with depth /load/X, /preprocess, /render/Z, etc. and can be merged with metrics contributed by pages being rendered
"target": { url: "/page/url", ...anything else we know about target... }, // analytics-friendly
"entryType": "measure", // "measure" is the only entry I see here -- is there anything else?
"startTime": 1007.8624, // analytics-friendly,
"duration": 2187.5929, // suggest removing "duration" and only including analytics-friendly "endTime"
"detail": null // suggest renaming to "baggage" using OpenTelemetry terminology; and allow this to be contributed/merged from generated pages (through filter.metrics({ nature: { }, baggage: {... anything ...}})
}
Allow metrics “contribution” by pages. Many of my pages run database calls or other expensive calls and I’d like to add my own metrics for those expensive items.
export default async function ( // for Lume
page: lumeAide.RenderablePage,
filters: lumeAide.Filters,
) {
// do something expensive
filter.metrics({ nature: { }, baggage: {... anything ...}}); // I can call my own metrics?
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
4 Metrics to Improve Customer Experience Analytics | CDW
4 Metrics to Improve Customer Experience Analytics · Market Efficacy · Logistics · Customer Sentiment · Omnichannel Pathways.
Read more >How to Use Google Analytics Data to Improve Your Website
You can boost your engagement rate by doing the following: Create easy-to-read content that users can scan and understand quickly.
Read more >How Can Data Analytics Improve the Measurement of ...
At the end of this post, you'll realize how much better it is to shoot for objective metrics and people analytics than to...
Read more >HR Must Make People Analytics More User-Friendly
On the “push” side, HR leaders can do a better job of presenting human capital metrics to the rest of the organization using...
Read more >KPIs vs. Metrics: 5 ways data analytics can help monitor ...
Metrics drive improvements and help businesses focus their people and resources on what counts. Data analytics can help establish KPIs and metrics related...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this is already implemented, so I’m closing it.
What you’re proposing is that, instead of returning a function, returns an Instrument object with a
measure
function? I mean:I see both are almost the same, but maybe I’m missing something. Maybe you’re planning to expand the
observe
object with more functionalities?My idea to make this extensible is that you could create your own class extending Metrics:
I guess what you’re proposing is creating an interface that you can use without extending the base class, right?
Anyway, I’ll release a new version in next days, but if you want to test it right now, just run
lume upgrade --dev
and this will install the last commit version.btw, feel free to create a pull request if you want to work on this.