Skip to content

Commit 07a6ae1

Browse files
committed
feat(metrics): bucket md viewer edit volume into LTE500 / LTE1K / GT1K
Adds a session-cumulative edit-batch counter in _onIframeContentChanged that fires one-shot count events as the user crosses each bucket threshold: md/edits/LTE500 first time a session reaches >=500 edit batches md/edits/LTE1K first time a session reaches >=1000 edit batches md/edits/GT1K first time a session crosses 1001+ edit batches Each bucket fires at most once per session, so the funnel reads as LTE500 >= LTE1K >= GT1K — answering "what fraction of users edit heavily in the markdown live preview?" The counter only increments on iframe content changes (md viewer edit mode), not on direct CodeMirror edits, since CM bypasses _onIframeContentChanged. A "batch" is a 50ms-debounced burst of edits (set by the iframe's existing debounce), so the buckets are representative volumes rather than per-keystroke counts.
1 parent 3e171cd commit 07a6ae1

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/extensionsIntegrated/Phoenix-live-preview/MarkdownSync.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ define(function (require, exports, module) {
5353
// heavy markdown editors. Each iframe content change (already
5454
// 50ms-debounced upstream) increments this. When the count crosses
5555
// a bucket threshold we fire a one-shot count event so the analytics
56-
// funnel reads as: users-with-LTE5 ⊇ LTE25 ⊇ LTE100 ⊇ GT500.
56+
// funnel reads as: users-with-LTE500 ⊇ LTE1K ⊇ GT1K. A representative
57+
// sample, not a fine-grained histogram.
5758
let _mdEditCount = 0;
5859
const MD_EDIT_BUCKETS = [
59-
{ threshold: 5, label: "LTE5" },
60-
{ threshold: 25, label: "LTE25" },
61-
{ threshold: 100, label: "LTE100" },
62-
{ threshold: 500, label: "GT500" }
60+
{ threshold: 500, label: "LTE500" },
61+
{ threshold: 1000, label: "LTE1K" },
62+
{ threshold: 1001, label: "GT1K" }
6363
];
6464

6565
let _active = false;

0 commit comments

Comments
 (0)