Skip to content

Commit

Permalink
Update buckets for new tab page count parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
dus7 committed Nov 21, 2024
1 parent 07ea85f commit 3ed0685
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
8 changes: 3 additions & 5 deletions DuckDuckGo/TabSwitcherOpenDailyPixel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ struct TabSwitcherOpenDailyPixel {
let count = tabs.count { $0.link == nil }

switch count {
case 0: return "0"
case 1...5: return "1-5"
case 6...10: return "6-10"
case 11...50: return "11-50"
default: return "51+"
case 0...1: return "0-1"
case 2...10: return "2-10"
default: return "11+"
}
}

Expand Down
10 changes: 4 additions & 6 deletions DuckDuckGoTests/TabSwitcherDailyPixelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final class TabSwitcherDailyPixelTests: XCTestCase {
let parameters = pixel.parameters(with: tabs)

XCTAssertEqual(parameters[ParameterName.tabCount], "2-5")
XCTAssertEqual(parameters[ParameterName.newTabCount], "1-5")
XCTAssertEqual(parameters[ParameterName.newTabCount], "2-10")
}

func testBucketsAggregation() {
Expand Down Expand Up @@ -71,11 +71,9 @@ final class TabSwitcherDailyPixelTests: XCTestCase {

func testNewTabBucketsAggregation() {
let bucketValues = [
0...0: "0",
1...5: "1-5",
6...10: "6-10",
11...50: "11-50",
51...60: "51+"]
0...1: "0-1",
2...10: "2-10",
11...20: "11+"]

for bucket in bucketValues {
for value in bucket.key {
Expand Down

0 comments on commit 3ed0685

Please sign in to comment.