Skip to content

Commit

Permalink
Bug 1731844 - Add scrolling metrics to nightly-only interaction metad…
Browse files Browse the repository at this point in the history
…ata viewer r=Standard8

Add columns for scrolling time and distance to the interactions view and also export these fields for analysis.

Differential Revision: https://phabricator.services.mozilla.com/D126261
  • Loading branch information
acreskeyMoz committed Sep 21, 2021
1 parent a8e7083 commit 3af0eaa
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions browser/components/places/metadataViewer/interactionsViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class TableViewer {
/* Sets the first row of elements to bold. The number is the number of columns */
#tableViewer > div:nth-child(-n+${numColumns}) {
font-weight: bold;
white-space: break-spaces;
}
/* Highlights every other row to make visual scanning of the table easier.
Expand Down Expand Up @@ -187,7 +188,7 @@ class TableViewer {
const metadataHandler = new (class extends TableViewer {
title = "Interactions";
cssGridTemplateColumns =
"max-content fit-content(100%) repeat(4, max-content) fit-content(100%);";
"max-content fit-content(100%) repeat(6, min-content) fit-content(100%);";

/**
* @see TableViewer.columnMap
Expand Down Expand Up @@ -217,6 +218,14 @@ const metadataHandler = new (class extends TableViewer {
},
],
["key_presses", { header: "Key Presses" }],
[
"scrolling_time",
{
header: "Scroll Time (s)",
modifier: scrollingTime => (scrollingTime / 1000).toFixed(2),
},
],
["scrolling_distance", { header: "Scroll Distance (pixels)" }],
["referrer", { header: "Referrer", includeTitle: true }],
]);

Expand Down Expand Up @@ -247,7 +256,7 @@ const metadataHandler = new (class extends TableViewer {
async updateDisplay() {
let rows = await this.#getRows(
`SELECT m.id AS id, h.url AS url, updated_at, total_view_time,
typing_time, key_presses, h2.url as referrer
typing_time, key_presses, scrolling_time, scrolling_distance, h2.url as referrer
FROM moz_places_metadata m
JOIN moz_places h ON h.id = m.place_id
LEFT JOIN moz_places h2 ON h2.id = m.referrer_place_id
Expand All @@ -272,6 +281,8 @@ const metadataHandler = new (class extends TableViewer {
h.frecency,
m.typing_time,
m.key_presses,
m.scrolling_time,
m.scrolling_distance,
vall.visit_dates,
vall.visit_types
FROM moz_places_metadata m
Expand All @@ -298,6 +309,8 @@ const metadataHandler = new (class extends TableViewer {
"frecency",
"typing_time",
"key_presses",
"scrolling_time",
"scrolling_distance",
"visit_dates",
"visit_types",
]
Expand Down

0 comments on commit 3af0eaa

Please sign in to comment.