Page MenuHomePhabricator

HtmlInputTransformHelper: collect statistics on selser context
Closed, ResolvedPublic

Description

To determine if we are correctly and effectively providing context for SelSer, we should collect statistics for the different, mutually exclusive cases laid out in the parent task (T318393):

  1. Page creation. SelSer does not apply since there is no previous content.
  2. The page exists, but no base revision ID provided. Selser is not possible.
  3. No render ID (etag) provided by the client, falling back to the latest rendering for context.
  4. Render ID (etag) provided by the client, found in stash.
  5. Render ID (etag) provided by the client, found in parser cache.
  6. Render ID (etag) provided by the client, but not found (edit fails with a 412).

Keys:

htmlinputtransformhelper.no-original.*
htmlinputtransformhelper.no-original.page-exists
htmlinputtransformhelper.no-original.page-not-exists

htmlinputtransformhelper.get-original.*
htmlinputtransformhelper.get-original.in-body

htmlinputtransformhelper.get-original.with-renderid.*
htmlinputtransformhelper.get-original.with-renderid.not-found
htmlinputtransformhelper.get-original.with-renderid.found

htmlinputtransformhelper.get-original.with-revid (may be a cache hit or we parse on demand, we can't tell)

Later, we want to break up the with-renderid.not-found and with-renderid.found keys:

htmlinputtransformhelper.get-original.with-renderid.* (number of requests with a render id)
htmlinputtransformhelper.get-original.with-renderid.*.not-found.* (original data could not be found based on render id)
htmlinputtransformhelper.get-original.with-renderid.*.found.* (original data found based on render id)
htmlinputtransformhelper.get-original.with-renderid.stash-hit.found.hit (found in stash)
htmlinputtransformhelper.get-original.with-renderid.stash-miss-pc-fallback.found.hit (found in PC and render id matches)
htmlinputtransformhelper.get-original.with-renderid.stash-miss-pc-fallback.not-found.miss (not found in PC)
htmlinputtransformhelper.get-original.with-renderid.stash-miss-pc-fallback.not-found.mismatch (found, but the render id doesn't match)
NOTE: This should be covered by a test case that asserts that for each request, exactly one of the above keys gets set.

Event Timeline

daniel updated the task description. (Show Details)
daniel raised the priority of this task from Medium to High.Oct 18 2022, 2:56 PM

Change 844495 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[mediawiki/core@master] HtmlInputTransformHelper: Capture metrics for SelSer context

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

@daniel, I think the below keys:

htmlinputtransformhelper.get-original.with-renderid.stash-miss.paser-cache-miss
htmlinputtransformhelper.get-original.with-renderid.stash-miss.paser-cache-hit.match
htmlinputtransformhelper.get-original.with-renderid.stash-miss.paser-cache-hit.mismatch

are equivalent to:

htmlinputtransformhelper.get-original.with-revid.parsercache-hit
htmlinputtransformhelper.get-original.with-revid.parsercache-miss

since when we don't have a render ID, we fall back to revID? Should we track both or ignore the stash-miss part?

since when we don't have a render ID, we fall back to revID? Should we track both or ignore the stash-miss part?

No, they are not equivalent. We have to modes of accessing the parser cache, they need to be tracked separately.

No, they are not equivalent. We have to modes of accessing the parser cache, they need to be tracked separately.

I see what you mean. The second one is buried in getParserOutput(), I forgot about that.

daniel updated the task description. (Show Details)

Change 844495 merged by jenkins-bot:

[mediawiki/core@master] HtmlInputTransformHelper: Capture metrics for SelSer context

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

daniel claimed this task.