Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smodi/compilation time tracking #3685

Merged
merged 15 commits into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Core/ContentBlocking.swift
Original file line number Diff line number Diff line change
@@ -116,9 +116,6 @@ public final class ContentBlocking {

domainEvent = .contentBlockingCompilationFailed(listType: listType, component: component)

case .contentBlockingCompilationTime:
domainEvent = .contentBlockingCompilationTime

case .contentBlockingLookupRulesSucceeded:
domainEvent = .contentBlockingLookupRulesSucceeded

@@ -130,6 +127,10 @@ public final class ContentBlocking {

case .contentBlockingLRCMissing:
domainEvent = .contentBlockingLRCMissing

case .contentBlockingCompilationTaskPerformance(let retryCount, let timeBucketAggregation):
domainEvent = .contentBlockingCompilationTaskPerformance(iterationCount: retryCount,
timeBucketAggregation: Pixel.Event.CompileTimeBucketAggregation(number: timeBucketAggregation))
}

if let error = error {
51 changes: 48 additions & 3 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
@@ -535,12 +535,12 @@ extension Pixel {
case contentBlockingCompilationFailed(listType: CompileRulesListType,
component: ContentBlockerDebugEvents.Component)

case contentBlockingCompilationTime
case contentBlockingLookupRulesSucceeded
case contentBlockingFetchLRCSucceeded
case contentBlockingNoMatchInLRC
case contentBlockingLRCMissing

case contentBlockingCompilationTaskPerformance(iterationCount: Int, timeBucketAggregation: CompileTimeBucketAggregation)
case ampBlockingRulesCompilationFailed

case webKitDidTerminate
@@ -1408,13 +1408,14 @@ extension Pixel.Event {
case .contentBlockingCompilationFailed(let listType, let component):
return "m_d_content_blocking_\(listType)_\(component)_compilation_failed"

case .contentBlockingCompilationTime: return "m_content_blocking_compilation_time"

case .contentBlockingLookupRulesSucceeded: return "m_content_blocking_lookup_rules_succeeded"
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 .contentBlockingCompilationTaskPerformance(let iterationCount, let timeBucketAggregation):
return "m_content_blocking_compilation_loops_\(iterationCount)_time_\(timeBucketAggregation)"
case .ampBlockingRulesCompilationFailed: return "m_debug_amp_rules_compilation_failed"

case .webKitDidTerminate: return "m_d_wkt"
@@ -1880,6 +1881,50 @@ extension Pixel.Event {
case blockingAttribution
case attributed
case unknown


}

public enum CompileTimeBucketAggregation: String, CustomStringConvertible {

public var description: String { rawValue }

case lessThan1 = "1"
case lessThan2 = "2"
case lessThan3 = "3"
case lessThan4 = "4"
case lessThan5 = "5"
case lessThan6 = "6"
case lessThan7 = "7"
case lessThan8 = "8"
case lessThan9 = "9"
case lessThan10 = "10"
case more

public init(number: Double) {
switch number {
case ...1:
self = .lessThan1
case ...2:
self = .lessThan2
case ...3:
self = .lessThan3
case ...4:
self = .lessThan4
case ...5:
self = .lessThan5
case ...6:
self = .lessThan6
case ...7:
self = .lessThan7
case ...8:
self = .lessThan8
case ...9:
self = .lessThan9
case ...10:
self = .lessThan10
default:
self = .more
}
}
}
}
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -11570,7 +11570,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 219.1.0;
version = 220.0.0;
};
};
9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Original file line number Diff line number Diff line change
@@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"revision" : "6c335fb4355e7128dd9fb9fd25ac3de8942846ad",
"version" : "219.1.0"
"revision" : "55e7de13a99793329993367169c9b6bafbd07bac",
"version" : "220.0.0"
}
},
{
Loading