Skip to content

Commit

Permalink
Adding 4 pixels to track the content blocking rules lookup/fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
studiosutara committed Nov 21, 2024
1 parent 73ae54f commit 555d5a8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
11 changes: 7 additions & 4 deletions Core/ContentBlocking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,14 @@ public final class ContentBlocking {
case .contentBlockingLookupRulesSucceeded:
domainEvent = .contentBlockingLookupRulesSucceeded

case .contentBlockingFetchRulesSucceeded:
domainEvent = .contentBlockingFetchRulesSucceeded
case .contentBlockingFetchLRCSucceeded:
domainEvent = .contentBlockingFetchLRCSucceeded

case .contentBlockingLookupAndFetchFailed:
domainEvent = .contentBlockingLookupAndFetchFailed
case .contentBlockingNoMatchInLRC:
domainEvent = .contentBlockingNoMatchInLRC

case .contentBlockingLRCMissing:
domainEvent = .contentBlockingLRCMissing
}

if let error = error {
Expand Down
11 changes: 7 additions & 4 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,9 @@ extension Pixel {

case contentBlockingCompilationTime
case contentBlockingLookupRulesSucceeded
case contentBlockingFetchRulesSucceeded
case contentBlockingLookupAndFetchFailed
case contentBlockingFetchLRCSucceeded
case contentBlockingNoMatchInLRC
case contentBlockingLRCMissing

case ampBlockingRulesCompilationFailed

Expand Down Expand Up @@ -1358,8 +1359,10 @@ extension Pixel.Event {
case .contentBlockingCompilationTime: return "m_content_blocking_compilation_time"

case .contentBlockingLookupRulesSucceeded: return "m_content_blocking_lookup_rules_succeeded"
case .contentBlockingFetchRulesSucceeded: return "m_content_blocking_fetch_rules_succeeded"
case .contentBlockingLookupAndFetchFailed: return "m_content_blocking_lookup_and_fetch_failed"
case .contentBlockingFetchLRCSucceeded: return "m_content_blocking_fetch_lrc_succeeded"
case .contentBlockingNoMatchInLRC: return "m_content_blocking_no_match_in_lrc"
case .contentBlockingLRCMissing: return "m_content_blocking_lrc_missing"

case .ampBlockingRulesCompilationFailed: return "m_debug_amp_rules_compilation_failed"

case .webKitDidTerminate: return "m_d_wkt"
Expand Down

0 comments on commit 555d5a8

Please sign in to comment.