make-mp-data 2.1.6 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +31 -0
  2. package/dungeons/adspend.js +2 -2
  3. package/dungeons/ai-chat-analytics-ed.js +3 -2
  4. package/dungeons/anon.js +2 -2
  5. package/dungeons/array-of-object-loopup.js +181 -0
  6. package/dungeons/benchmark-heavy.js +241 -0
  7. package/dungeons/benchmark-light.js +141 -0
  8. package/dungeons/big.js +9 -8
  9. package/dungeons/business.js +2 -1
  10. package/dungeons/clinch-agi.js +632 -0
  11. package/dungeons/complex.js +3 -2
  12. package/dungeons/copilot.js +383 -0
  13. package/dungeons/ecommerce-store.js +0 -0
  14. package/dungeons/experiments.js +5 -4
  15. package/dungeons/foobar.js +101 -101
  16. package/dungeons/funnels.js +2 -2
  17. package/dungeons/gaming.js +3 -2
  18. package/dungeons/harness/harness-education.js +988 -0
  19. package/dungeons/harness/harness-fintech.js +976 -0
  20. package/dungeons/harness/harness-food.js +985 -0
  21. package/dungeons/harness/harness-gaming.js +1178 -0
  22. package/dungeons/harness/harness-media.js +961 -0
  23. package/dungeons/harness/harness-sass.js +923 -0
  24. package/dungeons/harness/harness-social.js +928 -0
  25. package/dungeons/kurby.js +211 -0
  26. package/dungeons/media.js +5 -4
  27. package/dungeons/mil.js +4 -3
  28. package/dungeons/mirror.js +2 -2
  29. package/dungeons/money2020-ed.js +8 -7
  30. package/dungeons/sanity.js +3 -2
  31. package/dungeons/scd.js +3 -2
  32. package/dungeons/simple.js +29 -14
  33. package/dungeons/strict-event-test.js +30 -0
  34. package/dungeons/student-teacher.js +3 -2
  35. package/dungeons/text-generation.js +84 -85
  36. package/dungeons/too-big-events.js +166 -0
  37. package/dungeons/uday-schema.json +220 -0
  38. package/dungeons/userAgent.js +4 -3
  39. package/index.js +41 -54
  40. package/lib/core/config-validator.js +122 -7
  41. package/lib/core/context.js +7 -14
  42. package/lib/core/storage.js +60 -30
  43. package/lib/generators/adspend.js +12 -27
  44. package/lib/generators/events.js +6 -7
  45. package/lib/generators/funnels.js +16 -5
  46. package/lib/generators/product-lookup.js +262 -0
  47. package/lib/generators/product-names.js +195 -0
  48. package/lib/generators/profiles.js +3 -3
  49. package/lib/generators/scd.js +13 -3
  50. package/lib/generators/text.js +17 -4
  51. package/lib/orchestrators/mixpanel-sender.js +251 -208
  52. package/lib/orchestrators/user-loop.js +57 -19
  53. package/lib/templates/funnels-instructions.txt +272 -0
  54. package/lib/templates/hook-examples.json +187 -0
  55. package/lib/templates/hooks-instructions.txt +295 -8
  56. package/lib/templates/phrases.js +473 -16
  57. package/lib/templates/refine-instructions.txt +485 -0
  58. package/lib/templates/schema-instructions.txt +239 -109
  59. package/lib/templates/schema.d.ts +173 -0
  60. package/lib/templates/verbose-schema.js +140 -206
  61. package/lib/utils/ai.js +853 -77
  62. package/lib/utils/chart.js +210 -0
  63. package/lib/utils/function-registry.js +285 -0
  64. package/lib/utils/json-evaluator.js +172 -0
  65. package/lib/utils/logger.js +38 -0
  66. package/lib/utils/mixpanel.js +101 -0
  67. package/lib/utils/project.js +3 -2
  68. package/lib/utils/utils.js +41 -4
  69. package/package.json +13 -19
  70. package/types.d.ts +15 -5
  71. package/lib/generators/text-bak-old.js +0 -1121
  72. package/lib/orchestrators/worker-manager.js +0 -203
  73. package/lib/templates/phrases-bak.js +0 -925
  74. package/lib/templates/prompt (old).txt +0 -98
  75. package/lib/templates/scratch-dungeon-template.js +0 -116
  76. package/lib/templates/textQuickTest.js +0 -172
package/README.md CHANGED
@@ -87,6 +87,37 @@ Here's a breakdown of the CLI options you can use with `make-mp-data`:
87
87
  - `--complex`: create a complex set models including groups, SCD, and lookup tables.
88
88
  - `--simple`: create a simple dataset including events, and users
89
89
 
90
+ ## 🎯 Hooks — Engineering Trends in Data
91
+
92
+ Hooks let you engineer deliberate, discoverable patterns into your generated data — things like "premium users convert 2x better" or "there was a service outage during days 40-47." A hook is a single transform function on your dungeon config:
93
+
94
+ ```javascript
95
+ const config = {
96
+ // ...events, funnels, etc.
97
+ hook: function(record, type, meta) {
98
+ // Modify events based on type
99
+ if (type === "event" && record.event === "purchase") {
100
+ record.amount = record.amount * 2; // boost purchase amounts
101
+ }
102
+
103
+ // Use "everything" to correlate across a user's full event stream
104
+ if (type === "everything") {
105
+ const hasPurchase = record.some(e => e.event === "purchase");
106
+ for (const event of record) {
107
+ event.is_buyer = hasPurchase; // tag all events for this user
108
+ }
109
+ return record;
110
+ }
111
+
112
+ return record;
113
+ }
114
+ };
115
+ ```
116
+
117
+ Hook types: `event`, `user`, `everything`, `funnel-pre`, `funnel-post`, `scd-pre`, `ad-spend`, `group`, `mirror`, `lookup`.
118
+
119
+ See `dungeons/harness/` for comprehensive examples with 8 hooks each across gaming, fintech, education, food delivery, media, social, and SaaS verticals.
120
+
90
121
  ## 📄 Examples
91
122
 
92
123
  Check out the examples directory for sample data models:
@@ -14,11 +14,11 @@ import dayjs from "dayjs";
14
14
  import utc from "dayjs/plugin/utc.js";
15
15
  dayjs.extend(utc);
16
16
  import { uid, comma } from 'ak-tools';
17
- import { pickAWinner, weighNumRange, date, integer } from '../lib/utils/utils.js';
17
+ import { pickAWinner, weighNumRange, date, integer } from "../lib/utils/utils.js";
18
18
 
19
19
  /** @type {import('../types').Dungeon} */
20
20
  const config = {
21
- token: "",
21
+ token: process.env.MASTER_PROJECT_TOKEN || "",
22
22
  seed: "foo bar",
23
23
  numDays: 365, //how many days worth of data
24
24
  numEvents: 10000000, //how many events
@@ -15,7 +15,7 @@ const days = 100;
15
15
 
16
16
  /** @type {Dungeon} */
17
17
  const dungeon = {
18
- token: "",
18
+ token: process.env.MASTER_PROJECT_TOKEN || "",
19
19
  seed: SEED,
20
20
  numDays: days,
21
21
  numEvents: num_users * 100,
@@ -34,8 +34,9 @@ const dungeon = {
34
34
  hasAdSpend: true,
35
35
 
36
36
  hasAvatar: true,
37
+ makeChart: false,
37
38
 
38
- batchSize: 1_500_000,
39
+ batchSize: 2_500_000,
39
40
  concurrency: 50,
40
41
  writeToDisk: false,
41
42
 
package/dungeons/anon.js CHANGED
@@ -14,13 +14,13 @@ import dayjs from "dayjs";
14
14
  import utc from "dayjs/plugin/utc.js";
15
15
  dayjs.extend(utc);
16
16
  import { uid, comma } from 'ak-tools';
17
- import { pickAWinner, weighNumRange, date, integer } from '../lib/utils/utils.js';
17
+ import { pickAWinner, weighNumRange, date, integer } from "../lib/utils/utils.js";
18
18
 
19
19
 
20
20
 
21
21
  /** @type {import('../types').Dungeon} */
22
22
  const config = {
23
- token: "",
23
+ token: process.env.MASTER_PROJECT_TOKEN || "",
24
24
  seed: "foo bar",
25
25
  numDays: 365, //how many days worth of data
26
26
  numEvents: 100000, //how many events
@@ -0,0 +1,181 @@
1
+ /**
2
+ * This is the default configuration file for the data generator in SIMPLE mode
3
+ * notice how the config object is structured, and see it's type definition in ./types.d.ts
4
+ * feel free to modify this file to customize the data you generate
5
+ * see helper functions in utils.js for more ways to generate data
6
+ */
7
+
8
+
9
+ import Chance from 'chance';
10
+ let chance = new Chance();
11
+ import dayjs from "dayjs";
12
+ import utc from "dayjs/plugin/utc.js";
13
+ dayjs.extend(utc);
14
+ import { uid, comma } from 'ak-tools';
15
+ import { pickAWinner, weighNumRange, date, integer, weighChoices } from "../lib/utils/utils.js";
16
+
17
+ const videoCategories = ["funny", "educational", "inspirational", "music", "news", "sports", "cooking", "DIY", "travel", "gaming"];
18
+ const spiritAnimals = ["duck", "dog", "otter", "penguin", "cat", "elephant", "lion", "cheetah", "giraffe", "zebra", "rhino", "hippo", "whale", "dolphin", "shark", "octopus", "squid", "jellyfish", "starfish", "seahorse", "crab", "lobster", "shrimp", "clam", "snail", "slug", "butterfly", "moth", "bee", "wasp", "ant", "beetle", "ladybug", "caterpillar", "centipede", "millipede", "scorpion", "spider", "tarantula", "tick", "mite", "mosquito", "fly", "dragonfly", "damselfly", "grasshopper", "cricket", "locust", "mantis", "cockroach", "termite", "praying mantis", "walking stick", "stick bug", "leaf insect", "lacewing", "aphid", "cicada", "thrips", "psyllid", "scale insect", "whitefly", "mealybug", "planthopper", "leafhopper", "treehopper", "flea", "louse", "bedbug", "flea beetle", "weevil", "longhorn beetle", "leaf beetle", "tiger beetle", "ground beetle", "lady beetle", "firefly", "click beetle", "rove beetle", "scarab beetle", "dung beetle", "stag beetle", "rhinoceros beetle", "hercules beetle", "goliath beetle", "jewel beetle", "tortoise beetle"];
19
+
20
+ /** @type {import('../types.js').Dungeon} */
21
+ const config = {
22
+ // token: "0a3e6aa01225ed03856dca545c2b5b3d",
23
+ seed: "test array of objects lookup",
24
+ name: "array-of-object-lookup",
25
+ numDays: 60, //how many days worth1 of data
26
+ numEvents: 100_000, //how many events
27
+ numUsers: 1_000, //how many users
28
+ format: 'json', //csv or json
29
+ region: "US",
30
+ hasAnonIds: true, //if true, anonymousIds are created for each user
31
+ hasSessionIds: true, //if true, hasSessionIds are created for each user
32
+ hasAdSpend: false,
33
+ makeChart: false,
34
+ hasLocation: true,
35
+ hasAndroidDevices: false,
36
+ hasIOSDevices: false,
37
+ hasDesktopDevices: true,
38
+ hasBrowser: true,
39
+ hasCampaigns: false,
40
+ isAnonymous: false,
41
+ alsoInferFunnels: true,
42
+ concurrency: 1,
43
+ batchSize: 250_000,
44
+ writeToDisk: true,
45
+ events: [
46
+ {
47
+ event: "checkout",
48
+ weight: 2,
49
+ properties: {
50
+ currency: pickAWinner(["USD", "CAD", "EUR", "BTC", "ETH", "JPY"], 0),
51
+ coupon: weighChoices(["none", "none", "none", "none", "10%OFF", "20%OFF", "10%OFF", "20%OFF", "30%OFF", "40%OFF", "50%OFF"]),
52
+ cart: makeProducts()
53
+ }
54
+ },
55
+ {
56
+ event: "add to cart",
57
+ weight: 4,
58
+ properties: {
59
+ item: makeProducts(1),
60
+ }
61
+ },
62
+ {
63
+ event: "view item",
64
+ weight: 8,
65
+ properties: {
66
+ item: makeProducts(1)
67
+ }
68
+ },
69
+ {
70
+ event: "save item",
71
+ weight: 5,
72
+ properties: {
73
+ item: makeProducts(1),
74
+ }
75
+ }
76
+ ],
77
+ funnels: [ ],
78
+ superProps: {
79
+ theme: pickAWinner(["light", "dark", "custom", "light", "dark"]),
80
+ },
81
+ /*
82
+ user properties work the same as event properties
83
+ each key should be an array or function reference
84
+ */
85
+ userProps: {
86
+ // title: chance.profession.bind(chance),
87
+ // luckyNumber: weighNumRange(1, 500, .3),
88
+ spiritAnimal: spiritAnimals
89
+ },
90
+ scdProps: {},
91
+ mirrorProps: {},
92
+ /*
93
+ for group analytics keys, we need an array of arrays [[],[],[]]
94
+ each pair represents a group_key and the number of profiles for that key
95
+ */
96
+ groupKeys: [],
97
+ groupProps: {},
98
+ lookupTables: [{
99
+ key: "product_id",
100
+ entries: 1000,
101
+ attributes: {
102
+ amount: weighNumRange(1, 1000, .3),
103
+ quantity: weighNumRange(1, 10, .3),
104
+ featured: flip,
105
+ category: ["electronics", "books", "clothing", "home", "garden", "toys", "sports", "automotive", "beauty", "health", "grocery", "jewelry", "shoes", "tools", "office supplies"],
106
+ descriptor: ["brand new", "open box", "refurbished", "used", "like new", "vintage", "antique", "collectible"]
107
+
108
+ }
109
+
110
+ }],
111
+ hook: function (record, type, meta) {
112
+
113
+ const NOW = dayjs();
114
+
115
+
116
+ if (type === "event") {
117
+
118
+ }
119
+
120
+ if (type === "everything") {
121
+
122
+
123
+ }
124
+
125
+
126
+
127
+ return record;
128
+ }
129
+ };
130
+
131
+ function makeProducts(maxItems = 5) {
132
+ return function () {
133
+ const categories = ["electronics", "books", "clothing", "home", "garden", "toys", "sports", "automotive", "beauty", "health", "grocery", "jewelry", "shoes", "tools", "office supplies"];
134
+ const descriptors = ["brand new", "open box", "refurbished", "used", "like new", "vintage", "antique", "collectible"];
135
+ const suffix = ["item", "product", "good", "merchandise", "thing", "object", "widget", "gadget", "device", "apparatus", "contraption", "instrument", "tool", "implement", "utensil", "appliance", "machine", "equipment", "gear", "kit", "set", "package"];
136
+ const assetPreview = ['.png', '.jpg', '.jpeg', '.heic', '.mp4', '.mov', '.avi'];
137
+ const data = [];
138
+ const numOfItems = integer(1, maxItems);
139
+
140
+ for (var i = 0; i < numOfItems; i++) {
141
+ const category = chance.pickone(categories);
142
+ const descriptor = chance.pickone(descriptors);
143
+ const suffixWord = chance.pickone(suffix);
144
+ const slug = `${descriptor.replace(/\s+/g, '-').toLowerCase()}-${suffixWord.replace(/\s+/g, '-').toLowerCase()}`;
145
+ const asset = chance.pickone(assetPreview);
146
+
147
+ // const product_id = chance.guid();
148
+ const price = integer(1, 100);
149
+ const quantity = integer(1, 5);
150
+ const product_id = integer(1, 1_000);
151
+
152
+ const item = {
153
+ product_id: product_id,
154
+ product_url: `https://example.com/assets/${product_id}`,
155
+ // sku: integer(11111, 99999),
156
+ // amount: price,
157
+ // quantity: quantity,
158
+ // total_value: price * quantity,
159
+ // featured: chance.pickone([true, false, false]),
160
+ // category: category,
161
+ // descriptor: descriptor,
162
+ // slug: slug,
163
+
164
+ // assetType: asset
165
+
166
+ };
167
+
168
+ data.push(item);
169
+ }
170
+
171
+ return () => [data];
172
+ };
173
+ };
174
+
175
+
176
+ function flip(likelihood = 50) {
177
+ return chance.bool({ likelihood });
178
+ }
179
+
180
+
181
+ export default config;
@@ -0,0 +1,241 @@
1
+ /**
2
+ * Benchmark Dungeon Configuration
3
+ * Generates one million events across 10,000 users
4
+ * ensure we have multiple property types and distributions
5
+ */
6
+
7
+
8
+
9
+
10
+ import Chance from 'chance';
11
+ let chance = new Chance();
12
+ import dayjs from "dayjs";
13
+ import utc from "dayjs/plugin/utc.js";
14
+ dayjs.extend(utc);
15
+ import { uid, comma } from 'ak-tools';
16
+ import { pickAWinner, weighNumRange, date, integer, weighChoices } from "../lib/utils/utils.js";
17
+ import { createTextGenerator } from '../lib/generators/text.js';
18
+
19
+ // list of strings use case
20
+ function buildListOfFeatures() {
21
+ const fullFeatureList = ["beta flags", "alpha flags", "custom themes", "API access", "webhooks", "data export", "data import", "external integrations", "private cloud", "multi factor auth", "audit logs", "custom domain", "personalized landing"];
22
+ const numFeatures = integer(3, 7);
23
+ const selectedFeatures = chance.pickset(fullFeatureList, numFeatures);
24
+ return [selectedFeatures];
25
+ }
26
+
27
+ // object use case
28
+ function buildLocalConfig() {
29
+ const allPossibleConfigs = {
30
+ "theme": pickAWinner(["light", "dark", "custom"]),
31
+ "notifications": pickAWinner(["all", "mentions", "none"]),
32
+ "itemsPerPage": pickAWinner([10, 25, 50, 100]),
33
+ "language": pickAWinner(["en", "es", "fr", "de", "zh", "jp", "ru"]),
34
+ "timezone": pickAWinner(["UTC", "PST", "EST", "CST", "MST", "GMT", "CET", "IST", "JST", "AEST"]),
35
+ "privacyLevel": pickAWinner(["public", "friends only", "private"]),
36
+ "dataSharing": [true, false],
37
+ "autoSave": [true, false],
38
+ "fontSize": ["small", "medium", "large"],
39
+ "layout": ["grid", "list", "compact"]
40
+ };
41
+ const config = {};
42
+
43
+ for (const [key, values] of Object.entries(allPossibleConfigs)) {
44
+ let value;
45
+ if (typeof values === 'function') {
46
+ value = values();
47
+ } else if (Array.isArray(values)) {
48
+ value = values;
49
+ } else {
50
+ value = values;
51
+ }
52
+ config[key] = chance.pickone(value);
53
+ }
54
+ return config;
55
+ }
56
+
57
+
58
+ // array of object use case
59
+ function buildCart() {
60
+ const allPossibleItems = [
61
+ { itemId: uid(), name: "widget foo", price: 9.99, category: "Gadgets", isPremium: false, stock: 150 },
62
+ { itemId: uid(), name: "poker bar", price: 14.99, category: "Gizmos", isPremium: true, stock: 100 },
63
+ { itemId: uid(), name: "limited baz", price: 4.99, category: "Toys", isPremium: false, stock: 200 },
64
+ { itemId: uid(), name: "foolish qux", price: 19.99, category: "Tools", isPremium: false, stock: 50 },
65
+ { itemId: uid(), name: "topical mux", price: 29.99, category: "Components", isPremium: true, stock: 75 },
66
+ { itemId: uid(), name: "random garply", price: 24.99, category: "Gadgets", isPremium: false, stock: 30 },
67
+ { itemId: uid(), name: "helpful waldo", price: 39.99, category: "Gizmos", isPremium: true, stock: 20 },
68
+ { itemId: uid(), name: "hillarious defcon", price: 11.99, category: "Toys", isPremium: false, stock: 120 },
69
+ { itemId: uid(), name: "final radiator", price: 7.99, category: "Tools", isPremium: false, stock: 80 },
70
+ { itemId: uid(), name: "leaning wholesome", price: 49.99, category: "Components", isPremium: true, stock: 10 },
71
+ { itemId: uid(), name: "whose friends", price: 17.99, category: "Gadgets", isPremium: false, stock: 60 },
72
+ ];
73
+ const numItems = integer(1, 20);
74
+ const selectedItems = chance.pickset(allPossibleItems, numItems);
75
+ // add quantity to each item
76
+ for (const item of selectedItems) {
77
+ item.quantity = integer(1, 8);
78
+ item.totalPrice = item.price * item.quantity;
79
+ }
80
+ return [...selectedItems];
81
+
82
+ }
83
+
84
+
85
+
86
+ const commentGenerator = createTextGenerator({
87
+ authenticityLevel: 0.8,
88
+ enableDeduplication: true,
89
+ includeMetadata: false,
90
+ style: "comments",
91
+ formality: "casual",
92
+ mixedSentiment: true,
93
+ keywords: {
94
+ "brands": ["Nike", "Adidas", "Puma", "Reebok", "Under Armour", "New Balance", "Asics", "Skechers", "Converse", "Vans"],
95
+ "categories": ["shoes", "sneakers", "running shoes", "basketball shoes", "casual shoes", "formal shoes", "boots", "sandals", "heels", "flats"],
96
+ "credibility": ["verified purchase", "top reviewer", "frequent buyer", "long-time customer", "new customer"],
97
+ "features": ["comfort", "durability", "style", "fit", "value for money", "design", "color options", "material quality", "breathability", "support"],
98
+ "issues": ["size runs small", "poor arch support", "slippery sole", "uncomfortable", "not true to color", "weak laces", "easily scuffed", "bad odor", "heavy weight", "limited stock"],
99
+ },
100
+ typos: false,
101
+ min: 20,
102
+ max: 255,
103
+
104
+ });
105
+
106
+
107
+
108
+ /** @type {import('../types.js').Dungeon} */
109
+ const config = {
110
+ // token: process.env.MASTER_PROJECT_TOKEN || "",
111
+ name: "300k-Events-Heavy",
112
+ format: 'json', //csv or json
113
+ seed: "one million events",
114
+ numDays: 92, //how many days worth of data
115
+ numEvents: 300_000, //how many events
116
+ numUsers: 10_000, //how many users
117
+ strictEventCount: true,
118
+
119
+ region: "US",
120
+ hasAnonIds: true, //if true, anonymousIds are created for each user
121
+ hasSessionIds: true, //if true, hasSessionIds are created for each user
122
+ hasAdSpend: false,
123
+ makeChart: false,
124
+ hasLocation: true,
125
+ hasAndroidDevices: true,
126
+ hasIOSDevices: true,
127
+ hasDesktopDevices: true,
128
+ hasBrowser: true,
129
+ hasCampaigns: true,
130
+ isAnonymous: false,
131
+ alsoInferFunnels: true,
132
+ // concurrency automatically set to 1 when strictEventCount is enabled
133
+ writeToDisk: true,
134
+ batchSize: 2_500_000,
135
+
136
+ events: [
137
+ {
138
+ event: "Page View",
139
+ weight: 50,
140
+
141
+ },
142
+ {
143
+ event: "Product View",
144
+ weight: 30,
145
+ },
146
+ {
147
+ event: "Add to Cart",
148
+ weight: 10,
149
+ },
150
+ {
151
+ event: "Checkout Started",
152
+ weight: 5,
153
+ },
154
+ {
155
+ event: "Purchase",
156
+ weight: 1,
157
+ },
158
+ {
159
+ event: "Product Review",
160
+ weight: 3,
161
+ },
162
+ {
163
+ event: "Search",
164
+ weight: 17,
165
+ },
166
+ {
167
+ event: "Browse",
168
+ weight: 25,
169
+
170
+ },
171
+ {
172
+ event: "Save for Later",
173
+ weight: 4,
174
+ },
175
+ {
176
+ event: "Remove from Cart",
177
+ weight: 2,
178
+ },
179
+ {
180
+ event: "Empty Cart",
181
+ weight: 4,
182
+ }
183
+ ],
184
+ funnels: [
185
+ {
186
+ "name": "Purchase Funnel",
187
+ "sequence": [
188
+ "Page View",
189
+ "Product View",
190
+ "Add to Cart",
191
+ "Checkout Started",
192
+ "Purchase"
193
+ ],
194
+ requireRepeats: true,
195
+ "conversionRate": 30,
196
+ "order": "fixed",
197
+ "weight": 1,
198
+ "isFirstFunnel": false,
199
+ "timeToConvert": 5,
200
+ "experiment": true,
201
+ }
202
+ ],
203
+ superProps: {
204
+ "theme (string)": pickAWinner(["light", "dark", "custom", "light", "dark"]),
205
+ "latency (number)": weighNumRange(20, 600, 0.7),
206
+ "beta user (boolean)": [true, false, false, false],
207
+ "birthdate (date)": date(30000, true, 'YYYY-MM-DD'),
208
+ "features (list)": buildListOfFeatures,
209
+ "config (object)": buildLocalConfig,
210
+ "cart (array of objects)": buildCart,
211
+ "comment (text)": commentGenerator,
212
+ },
213
+ /*
214
+ user properties work the same as event properties
215
+ each key should be an array or function reference
216
+ */
217
+ userProps: {
218
+
219
+
220
+ },
221
+ scdProps: {},
222
+ mirrorProps: {},
223
+
224
+ /*
225
+ for group analytics keys, we need an array of arrays [[],[],[]]
226
+ each pair represents a group_key and the number of profiles for that key
227
+ */
228
+ groupKeys: [],
229
+ groupProps: {},
230
+ lookupTables: [],
231
+ hook: function (record, type, meta) {
232
+ // if (type === "everything") {
233
+ // debugger;
234
+ // }
235
+ return record;
236
+ }
237
+ };
238
+
239
+
240
+
241
+ export default config;
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Benchmark Dungeon Configuration
3
+ * Generates one million events across 10,000 users
4
+ * ensure we have multiple property types and distributions
5
+ */
6
+
7
+
8
+
9
+
10
+ import Chance from 'chance';
11
+ let chance = new Chance();
12
+ import dayjs from "dayjs";
13
+ import utc from "dayjs/plugin/utc.js";
14
+ dayjs.extend(utc);
15
+ import { uid, comma } from 'ak-tools';
16
+ import { pickAWinner, weighNumRange, date, integer, weighChoices } from "../lib/utils/utils.js";
17
+ import { createTextGenerator } from '../lib/generators/text.js';
18
+
19
+ /** @type {import('../types.js').Dungeon} */
20
+ const config = {
21
+ // token: process.env.MASTER_PROJECT_TOKEN || "",
22
+ name: "5M-Events-Light",
23
+ format: 'json', //csv or json
24
+ seed: "one million events",
25
+ numDays: 92, //how many days worth of data
26
+ numEvents: 5_000_000, //how many events
27
+ numUsers: 10_000, //how many users
28
+ strictEventCount: true,
29
+
30
+ region: "US",
31
+ hasAnonIds: false, //if true, anonymousIds are created for each user
32
+ hasSessionIds: false, //if true, hasSessionIds are created for each user
33
+ hasAdSpend: false,
34
+ makeChart: false,
35
+ hasLocation: false,
36
+ hasAndroidDevices: false,
37
+ hasIOSDevices: false,
38
+ hasDesktopDevices: false,
39
+ hasBrowser: false,
40
+ hasCampaigns: false,
41
+ isAnonymous: false,
42
+ alsoInferFunnels: true,
43
+ // concurrency automatically set to 1 when strictEventCount is enabled
44
+ writeToDisk: true,
45
+ batchSize: 12_500_000,
46
+
47
+ events: [
48
+ {
49
+ event: "Page View",
50
+ weight: 50,
51
+
52
+ },
53
+ {
54
+ event: "Product View",
55
+ weight: 30,
56
+ },
57
+ {
58
+ event: "Add to Cart",
59
+ weight: 10,
60
+ },
61
+ {
62
+ event: "Checkout Started",
63
+ weight: 5,
64
+ },
65
+ {
66
+ event: "Purchase",
67
+ weight: 1,
68
+ },
69
+ {
70
+ event: "Product Review",
71
+ weight: 3,
72
+ },
73
+ {
74
+ event: "Search",
75
+ weight: 17,
76
+ },
77
+ {
78
+ event: "Browse",
79
+ weight: 25,
80
+
81
+ },
82
+ {
83
+ event: "Save for Later",
84
+ weight: 4,
85
+ },
86
+ {
87
+ event: "Remove from Cart",
88
+ weight: 2,
89
+ },
90
+ {
91
+ event: "Empty Cart",
92
+ weight: 4,
93
+ }
94
+ ],
95
+ funnels: [
96
+ {
97
+ "name": "Purchase Funnel",
98
+ "sequence": [
99
+ "Page View",
100
+ "Product View",
101
+ "Add to Cart",
102
+ "Checkout Started",
103
+ "Purchase"
104
+ ],
105
+ requireRepeats: true,
106
+ "conversionRate": 30,
107
+ "order": "fixed",
108
+ "weight": 1,
109
+ "isFirstFunnel": false,
110
+ "timeToConvert": 5,
111
+ "experiment": true,
112
+ }
113
+ ],
114
+ superProps: {
115
+ },
116
+ /*
117
+ user properties work the same as event properties
118
+ each key should be an array or function reference
119
+ */
120
+ userProps: {},
121
+ scdProps: {},
122
+ mirrorProps: {},
123
+
124
+ /*
125
+ for group analytics keys, we need an array of arrays [[],[],[]]
126
+ each pair represents a group_key and the number of profiles for that key
127
+ */
128
+ groupKeys: [],
129
+ groupProps: {},
130
+ lookupTables: [],
131
+ hook: function (record, type, meta) {
132
+ // if (type === "everything") {
133
+ // debugger;
134
+ // }
135
+ return record;
136
+ }
137
+ };
138
+
139
+
140
+
141
+ export default config;