sitespeedio / plugin-lighthouse

Lighthouse plugin for sitespeed.io
MIT License
28 stars 18 forks source link

Plugin uses wrong field when writing metrics to InfluxDB #91

Open dammg opened 2 years ago

dammg commented 2 years ago

Hi there. I noticed that the plugin writes its metrics to InfluxDB differently than the core sitespeed app. This way you have to query the data in very unorthodox ways. See difference in sitespeed verbose log:

Sitespeed core: (correctly uses series name for the measurement)

{
"tags": {
"device": "desktop",
"stage": "produktion",
"origin": "browsertime",
"summaryType": "summary",
"connectivity": "native",
"browser": "chrome",
"group": "www_enbw_com",
"testName": "www_enbw_com"
},
"seriesName": "firstPaint",
"point": {
"time": 1630409179532,
"median": 483
}
},

Lighthouse plugin: (uses extra "audit" tag for the actual series name...and the series name is the unit???)

{
"tags": {
"audit": "first-contentful-paint",
"device": "desktop",
"stage": "produktion",
"origin": "lighthouse",
"summaryType": "pageSummary",
"page": "_unternehmen_",
"group": "www_enbw_com",
"testName": "www_enbw_com"
},
"seriesName": "numericValue",
"point": {
"time": 1630409179532,
"value": 1454.0010000000002
}
},

Also see the difference in Grafana query:

image

Any chance, this will be fixed in the future? Cheers!

soulgalore commented 2 years ago

Hi @dammg thanks for creating the issue. I'm no Lighthouse user andI guessed we missed that. There are some special handling of converting the Lighthouse structure to Influx so a fix need to happen there: https://github.com/sitespeedio/sitespeed.io/blob/main/lib/plugins/influxdb/data-generator.js#L197-L205

shrutiseth commented 5 months ago

Hello @dammg -

I am setting up Sitespeedio to test the sites in my project. However, since Docker is not allowed, I am installing the NPM package on windows. Influx DB+Grafana setup isnt available, so I am trying to build the dashboard specially for Lighthouse reports similar to Plus1 dashboard of Docker setup.

1) Can you please help me understand, where can I see the data that is written to Influx DB? (similar to what you have posted)

image

2) If you already have a setup of Sitespeedio(NPM on windows)+InfluxDB+Grafana, please do share, as it would be very helpful. Am from testing background and not a developer.

Thanks!