Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Commit

Permalink
Rename urlGroupingName to unexport it
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur22 committed Oct 3, 2024
1 parent 98026ef commit 3c8aa19
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion common/frame_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ func (fs *FrameSession) parseAndEmitWebVitalMetric(object string) error {
state := fs.vu.State()
tags := state.Tags.GetCurrentValues().Tags
if state.Options.SystemTags.Has(k6metrics.TagURL) {
if name, ok := fs.page.URLGroupingName(fs.ctx, wv.URL); ok {
if name, ok := fs.page.urlGroupingName(fs.ctx, wv.URL); ok {
tags = tags.With("url", name)
tags = tags.With("name", name)
} else {
Expand Down
6 changes: 3 additions & 3 deletions common/network_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (c *Credentials) Parse(ctx context.Context, credentials sobek.Value) error
}

type metricInterceptor interface {
URLGroupingName(ctx context.Context, urlTag string) (string, bool)
urlGroupingName(ctx context.Context, urlTag string) (string, bool)
}

// NetworkManager manages all frames in HTML document.
Expand Down Expand Up @@ -188,7 +188,7 @@ func (m *NetworkManager) emitRequestMetrics(req *Request) {
tags = tags.With("method", req.method)
}
if state.Options.SystemTags.Has(k6metrics.TagURL) {
if name, ok := m.mi.URLGroupingName(m.vu.Context(), req.URL()); ok {
if name, ok := m.mi.urlGroupingName(m.vu.Context(), req.URL()); ok {
tags = tags.With("url", name)
tags = tags.With("name", name)
} else {
Expand Down Expand Up @@ -247,7 +247,7 @@ func (m *NetworkManager) emitResponseMetrics(resp *Response, req *Request) {
tags = tags.With("method", req.method)
}
if state.Options.SystemTags.Has(k6metrics.TagURL) {
if name, ok := m.mi.URLGroupingName(m.vu.Context(), url); ok {
if name, ok := m.mi.urlGroupingName(m.vu.Context(), url); ok {
tags = tags.With("url", name)
tags = tags.With("name", name)
} else {
Expand Down
2 changes: 1 addition & 1 deletion common/network_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func TestOnRequestPausedBlockedIPs(t *testing.T) {

type MetricInterceptorMock struct{}

func (m *MetricInterceptorMock) URLGroupingName(ctx context.Context, urlTag string) (string, bool) {
func (m *MetricInterceptorMock) urlGroupingName(ctx context.Context, urlTag string) (string, bool) {
return "", false
}

Expand Down
2 changes: 1 addition & 1 deletion common/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ func (p *Page) initEvents() {
}()
}

func (p *Page) URLGroupingName(ctx context.Context, urlTag string) (string, bool) {
func (p *Page) urlGroupingName(ctx context.Context, urlTag string) (string, bool) {
p.eventHandlersMu.RLock()

// If there are no handlers for EventConsoleAPICalled.
Expand Down

0 comments on commit 3c8aa19

Please sign in to comment.