Page MenuHomePhabricator

Remove unused performance metrics from Vector search instrumentation.js and mediawiki.page.ready
Closed, ResolvedPublic2 Estimated Story Points

Description

Background

Remove unused code from instrumentation.js in Vector 22 to simplify maintenance and improve performance. We are logging multiple events against the event platform for every search that we never use. This is requiring unnecessary additional processing and downloaded bytes for the user.

The removal here has no visible impact on end users, but it'll make future updates easier for developers.

instrumentation.js

User Story

As a developer, I want to remove unused code from instrumentation.js, so that the file is cleaner and easier to work with.

  • Identify and remove unused code from instrumentation.js.
  • Ensure no other parts of the app are broken after removal.
  • Test to confirm everything works as expected.
  • Update docs if needed.

Requirement

Remove unused performance metrics from instrumentation.js in Vector 2022 and mediawiki.page.ready to simplify maintenance and improve performance. Ensure that this removal does not break existing functionality or impact other parts of the application.

BDD

Feature: Remove unused performance metrics from Vector search instrumentation.js  

  Scenario: Search functionality with unused performance metrics removed  
    Given I am on the beta site  
    When I perform a search using Vector 2022 skin  
    Then the search results should appear correctly  
    And I should be able to navigate to a page without errors in the developer console

Test Steps

Test Case 1: Verify Search Functionality in Vector 2022 After Code Removal

  1. Visit https://en.wikipedia.beta.wmflabs.org/w/index.php?title=T352930.
  2. Perform a search for any valid term in the search bar.
  3. AC1: Confirm that the search results appear correctly and allow navigation to a page.
  4. Open the browser’s developer console.
  5. AC2: Ensure no errors are logged in the console during the search workflow.

Test Case 2: Verify Search Functionality in Vector Skin

  1. Visit https://en.wikipedia.beta.wmflabs.org/w/index.php?title=T352930&useskin=vector.
  2. Perform a search for any valid term in the search bar.
  3. AC3: Confirm that the search results appear correctly and allow navigation to a page.
  4. Open the browser’s developer console.
  5. AC4: Ensure no errors are logged in the console during the search workflow.

Acceptance Criteria

  • Unused code is removed.
  • Everything still works.
  • No regressions.

QA

  1. Visit https://en.wikipedia.beta.wmflabs.org/w/index.php?title=T352930 and perform a search. You should be able to find a page and navigate to a page without seeing any errors in the developer console.
  2. Visit https://en.wikipedia.beta.wmflabs.org/w/index.php?title=T352930&useskin=vector and perform a search. You should be able to find a page and navigate to a page without seeing any errors in the developer console.

QA Results - Beta

Event Timeline

KSarabia-WMF renamed this task from Web Task Creation Form to Clean up instrumentation.js .Nov 14 2024, 1:26 AM
Reedy renamed this task from Clean up instrumentation.js to Clean up instrumentation.js.Nov 14 2024, 1:41 AM
Jdlrobson renamed this task from Clean up instrumentation.js to Remove unused performance metrics from Vector search instrumentation.js.Nov 15 2024, 1:47 AM
Jdlrobson triaged this task as Medium priority.Nov 19 2024, 10:18 PM
Jdlrobson renamed this task from Remove unused performance metrics from Vector search instrumentation.js to Remove unused performance metrics from Vector search instrumentation.js and mediawiki.page.ready.Nov 21 2024, 4:48 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson set the point value for this task to 2.Nov 21 2024, 5:30 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson moved this task from Product Backlog to Sprint Backlog on the Web-Team board.

Change #1100145 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[mediawiki/skins/Vector@master] Remove unused performance metrics

https://gerrit.wikimedia.org/r/1100145

Change #1100182 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[mediawiki/core@master] Remove performance tracking for search

https://gerrit.wikimedia.org/r/1100182

Change #1100182 merged by jenkins-bot:

[mediawiki/core@master] Remove performance tracking for search

https://gerrit.wikimedia.org/r/1100182

Change #1100145 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Remove unused performance metrics

https://gerrit.wikimedia.org/r/1100145

SToyofuku-WMF subscribed.

QA would likely be ensuring search is still working on the beta cluster

There was a small mistake in https://gerrit.wikimedia.org/r/1100145, search is now throwing the following error. Passing back to @KSarabia-WMF to fix:

TypeError: instrumentation.listeners.onFetchStart is not a function
    at Proxy.updateUIWithSearchClientResult (App.vue:165:30)
    at Proxy.onInput (App.vue:130:9)
    at jt (vue.js:7:16029)
    at Ht (vue.js:7:16099)
    at un (vue.js:7:18093)
    at c (CdxTypeaheadSearch.cjs:1:2561)
    at eval (CdxTypeaheadSearch.cjs:1:2599)

Change #1100518 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[mediawiki/skins/Vector@master] Searchbar bug

https://gerrit.wikimedia.org/r/1100518

Change #1100518 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Address searchbar bug in App.vue

https://gerrit.wikimedia.org/r/1100518

Edtadros subscribed.

Test Result - Beta

Status: ✅ PASS
Environment: Beta
OS: macOS
Browser: Chrome
Device: MS
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify Search Functionality in Vector 2022 After Code Removal

  1. Visit https://en.wikipedia.beta.wmflabs.org/w/index.php?title=T352930.
  2. Perform a search for any valid term in the search bar.
  3. ✅ AC1: Confirm that the search results appear correctly and allow navigation to a page.

See AC2.

  1. Open the browser’s developer console.
  2. ✅ AC2: Ensure no errors are logged in the console during the search workflow.
screenshot 34.mov.gif (1×1 px, 883 KB)
screenshot 33.mov.gif (1×1 px, 945 KB)

Test Case 2: Verify Search Functionality in Vector Skin

  1. Visit https://en.wikipedia.beta.wmflabs.org/w/index.php?title=T352930&useskin=vector.
  2. Perform a search for any valid term in the search bar.
  3. ✅AC3: Confirm that the search results appear correctly and allow navigation to a page.

See AC4.

  1. Open the browser’s developer console.
  2. ✅ AC4: Ensure no errors are logged in the console during the search workflow.
screenshot 35.mov.gif (1×1 px, 961 KB)
screenshot 36.mov.gif (1×1 px, 806 KB)

Looks good, resolving.