Skip to content

Commit

Permalink
Remove first contentful paint cdp metric
Browse files Browse the repository at this point in the history
We're now getting web vital metrics which are calculated by the JS
web vital script. It also contains first contentful paint FCP metric.
The metric coming from the JS lib also comes back with a rating. We
can't correlate that with the current CDP FCP. To keep web vital
metrics source consistent, we will remove the existing CDP FCP and opt
to work with the one coming from the JS lib.
  • Loading branch information
ankur22 committed Mar 27, 2023
1 parent 345ba58 commit c301a50
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion common/frame_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,6 @@ func (fs *FrameSession) onPageLifecycle(event *cdppage.EventLifecycleEvent) {
"load": fs.k6Metrics.BrowserLoaded,
"DOMContentLoaded": fs.k6Metrics.BrowserDOMContentLoaded,
"firstPaint": fs.k6Metrics.BrowserFirstPaint,
"firstContentfulPaint": fs.k6Metrics.BrowserFirstContentfulPaint,
"firstMeaningfulPaint": fs.k6Metrics.BrowserFirstMeaningfulPaint,
}

Expand Down
2 changes: 1 addition & 1 deletion examples/multiple-scenario.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const options = {
},
thresholds: {
browser_dom_content_loaded: ['p(90) < 1000'],
browser_first_contentful_paint: ['max < 1000'],
browser_first_meaningful_paint: ['max < 1000'],
checks: ["rate==1.0"]
}
}
Expand Down
3 changes: 0 additions & 3 deletions k6ext/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const (
type CustomMetrics struct {
BrowserDOMContentLoaded *k6metrics.Metric
BrowserFirstPaint *k6metrics.Metric
BrowserFirstContentfulPaint *k6metrics.Metric
BrowserFirstMeaningfulPaint *k6metrics.Metric
BrowserLoaded *k6metrics.Metric

Expand Down Expand Up @@ -60,8 +59,6 @@ func RegisterCustomMetrics(registry *k6metrics.Registry) *CustomMetrics {
"browser_dom_content_loaded", k6metrics.Trend, k6metrics.Time),
BrowserFirstPaint: registry.MustNewMetric(
"browser_first_paint", k6metrics.Trend, k6metrics.Time),
BrowserFirstContentfulPaint: registry.MustNewMetric(
"browser_first_contentful_paint", k6metrics.Trend, k6metrics.Time),
BrowserFirstMeaningfulPaint: registry.MustNewMetric(
"browser_first_meaningful_paint", k6metrics.Trend, k6metrics.Time),
BrowserLoaded: registry.MustNewMetric(
Expand Down

0 comments on commit c301a50

Please sign in to comment.