Skip to content

Commit 28a9752

Browse files
committed
fix(metrics): keep original md/edits buckets, add LTE500/LTE1K/GT1K
Restores the LTE5 / LTE25 / LTE100 / GT500 buckets dropped in the previous commit and adds the requested coarser buckets LTE500 / LTE1K / GT1K alongside. Drops the for-loop early-out so multiple labels at the same threshold all fire (GT500 and LTE500 both fire at 500 batches); preserves the per-session one-shot semantics.
1 parent 07a6ae1 commit 28a9752

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,14 @@ 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-LTE500LTE1KGT1K. A representative
57-
// sample, not a fine-grained histogram.
56+
// funnel reads as: users-with-LTE5LTE25LTE100 ⊇ GT500/LTE500
57+
// ⊇ LTE1K ⊇ GT1K — a coarse-to-fine view of edit volume per session.
5858
let _mdEditCount = 0;
5959
const MD_EDIT_BUCKETS = [
60+
{ threshold: 5, label: "LTE5" },
61+
{ threshold: 25, label: "LTE25" },
62+
{ threshold: 100, label: "LTE100" },
63+
{ threshold: 500, label: "GT500" },
6064
{ threshold: 500, label: "LTE500" },
6165
{ threshold: 1000, label: "LTE1K" },
6266
{ threshold: 1001, label: "GT1K" }
@@ -692,12 +696,13 @@ define(function (require, exports, module) {
692696
// Edit-volume bucket: fire once when the cumulative session
693697
// edit count first crosses each threshold. Each bucket fires
694698
// at most once per session, so the metric reads as a funnel.
699+
// No early-out: multiple labels at the same threshold all
700+
// fire (e.g. GT500 + LTE500 at 500 batches).
695701
_mdEditCount++;
696702
for (let i = 0; i < MD_EDIT_BUCKETS.length; i++) {
697703
if (_mdEditCount === MD_EDIT_BUCKETS[i].threshold) {
698704
Metrics.countEvent(Metrics.EVENT_TYPE.MD,
699705
"edits", MD_EDIT_BUCKETS[i].label);
700-
break;
701706
}
702707
}
703708

0 commit comments

Comments
 (0)