make-mp-data 2.1.11 → 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.
- package/README.md +31 -0
- package/dungeons/adspend.js +2 -2
- package/dungeons/ai-chat-analytics-ed.js +3 -2
- package/dungeons/anon.js +2 -2
- package/dungeons/array-of-object-loopup.js +181 -0
- package/dungeons/benchmark-heavy.js +241 -0
- package/dungeons/benchmark-light.js +141 -0
- package/dungeons/big.js +9 -8
- package/dungeons/business.js +2 -1
- package/dungeons/clinch-agi.js +632 -0
- package/dungeons/complex.js +3 -2
- package/dungeons/copilot.js +383 -0
- package/dungeons/ecommerce-store.js +0 -0
- package/dungeons/experiments.js +5 -4
- package/dungeons/foobar.js +1 -1
- package/dungeons/funnels.js +2 -2
- package/dungeons/gaming.js +3 -2
- package/dungeons/harness/harness-education.js +988 -0
- package/dungeons/harness/harness-fintech.js +976 -0
- package/dungeons/harness/harness-food.js +985 -0
- package/dungeons/harness/harness-gaming.js +1178 -0
- package/dungeons/harness/harness-media.js +961 -0
- package/dungeons/harness/harness-sass.js +923 -0
- package/dungeons/harness/harness-social.js +928 -0
- package/dungeons/kurby.js +211 -0
- package/dungeons/media.js +5 -4
- package/dungeons/mil.js +4 -3
- package/dungeons/mirror.js +2 -2
- package/dungeons/money2020-ed.js +8 -7
- package/dungeons/sanity.js +3 -2
- package/dungeons/scd.js +3 -2
- package/dungeons/simple.js +30 -15
- package/dungeons/strict-event-test.js +30 -0
- package/dungeons/student-teacher.js +3 -2
- package/dungeons/text-generation.js +84 -85
- package/dungeons/too-big-events.js +166 -0
- package/dungeons/uday-schema.json +220 -0
- package/dungeons/userAgent.js +4 -3
- package/index.js +41 -54
- package/lib/core/config-validator.js +122 -7
- package/lib/core/context.js +7 -14
- package/lib/core/storage.js +57 -25
- package/lib/generators/adspend.js +12 -12
- package/lib/generators/events.js +6 -5
- package/lib/generators/funnels.js +32 -10
- package/lib/generators/product-lookup.js +262 -0
- package/lib/generators/product-names.js +195 -0
- package/lib/generators/profiles.js +3 -3
- package/lib/generators/scd.js +13 -3
- package/lib/generators/text.js +17 -4
- package/lib/orchestrators/mixpanel-sender.js +244 -204
- package/lib/orchestrators/user-loop.js +54 -16
- package/lib/templates/funnels-instructions.txt +272 -0
- package/lib/templates/hook-examples.json +187 -0
- package/lib/templates/hooks-instructions.txt +295 -8
- package/lib/templates/phrases.js +473 -16
- package/lib/templates/refine-instructions.txt +485 -0
- package/lib/templates/schema-instructions.txt +239 -109
- package/lib/templates/schema.d.ts +173 -0
- package/lib/templates/verbose-schema.js +140 -206
- package/lib/utils/ai.js +853 -77
- package/lib/utils/chart.js +210 -0
- package/lib/utils/function-registry.js +285 -0
- package/lib/utils/json-evaluator.js +172 -0
- package/lib/utils/logger.js +38 -0
- package/lib/utils/mixpanel.js +101 -0
- package/lib/utils/project.js +3 -2
- package/lib/utils/utils.js +41 -4
- package/package.json +15 -21
- package/types.d.ts +15 -5
- package/lib/generators/text-bak-old.js +0 -1121
- package/lib/orchestrators/worker-manager.js +0 -203
- package/lib/templates/phrases-bak.js +0 -925
- package/lib/templates/prompt (old).txt +0 -98
- package/lib/templates/scratch-dungeon-template.js +0 -116
- package/lib/templates/textQuickTest.js +0 -172
|
@@ -0,0 +1,383 @@
|
|
|
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
|
+
|
|
10
|
+
|
|
11
|
+
import Chance from 'chance';
|
|
12
|
+
let chance = new Chance();
|
|
13
|
+
import dayjs from "dayjs";
|
|
14
|
+
import utc from "dayjs/plugin/utc.js";
|
|
15
|
+
dayjs.extend(utc);
|
|
16
|
+
import { uid, comma } from 'ak-tools';
|
|
17
|
+
import { pickAWinner, weighNumRange, date, integer, weighChoices, decimal } from "../lib/utils/utils.js";
|
|
18
|
+
|
|
19
|
+
const itemCategories = ["Books", "Movies", "Music", "Games", "Electronics", "Computers", "Smart Home", "Home", "Garden", "Pet", "Beauty", "Health", "Toys", "Kids", "Baby", "Handmade", "Sports", "Outdoors", "Automotive", "Industrial", "Entertainment", "Art", "Food", "Appliances", "Office", "Wedding", "Software"];
|
|
20
|
+
const videoCategories = ["funny", "educational", "inspirational", "music", "news", "sports", "cooking", "DIY", "travel", "gaming"];
|
|
21
|
+
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"];
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
function makeProducts(maxItems = 5) {
|
|
25
|
+
return function () {
|
|
26
|
+
const categories = ["electronics", "books", "clothing", "home", "garden", "toys", "sports", "automotive", "beauty", "health", "grocery", "jewelry", "shoes", "tools", "office supplies"];
|
|
27
|
+
const descriptors = ["brand new", "open box", "refurbished", "used", "like new", "vintage", "antique", "collectible"];
|
|
28
|
+
const suffix = ["item", "product", "good", "merchandise", "thing", "object", "widget", "gadget", "device", "apparatus", "contraption", "instrument", "tool", "implement", "utensil", "appliance", "machine", "equipment", "gear", "kit", "set", "package"];
|
|
29
|
+
const assetPreview = ['.png', '.jpg', '.jpeg', '.heic', '.mp4', '.mov', '.avi'];
|
|
30
|
+
const data = [];
|
|
31
|
+
const numOfItems = integer(1, maxItems);
|
|
32
|
+
|
|
33
|
+
for (var i = 0; i < numOfItems; i++) {
|
|
34
|
+
const category = chance.pickone(categories);
|
|
35
|
+
const descriptor = chance.pickone(descriptors);
|
|
36
|
+
const suffixWord = chance.pickone(suffix);
|
|
37
|
+
const slug = `${descriptor.replace(/\s+/g, '-').toLowerCase()}-${suffixWord.replace(/\s+/g, '-').toLowerCase()}`;
|
|
38
|
+
const asset = chance.pickone(assetPreview);
|
|
39
|
+
|
|
40
|
+
// const product_id = chance.guid();
|
|
41
|
+
const price = integer(1, 100);
|
|
42
|
+
const quantity = integer(1, 5);
|
|
43
|
+
|
|
44
|
+
const item = {
|
|
45
|
+
// product_id: product_id,
|
|
46
|
+
// sku: integer(11111, 99999),
|
|
47
|
+
amount: price,
|
|
48
|
+
quantity: quantity,
|
|
49
|
+
total_value: price * quantity,
|
|
50
|
+
featured: chance.pickone([true, false, false]),
|
|
51
|
+
category: category,
|
|
52
|
+
descriptor: descriptor,
|
|
53
|
+
slug: slug,
|
|
54
|
+
assetPreview: `https://example.com/assets/${slug}${asset}`,
|
|
55
|
+
assetType: asset
|
|
56
|
+
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
data.push(item);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return () => [data];
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
/** @type {import('../types').Dungeon} */
|
|
68
|
+
const config = {
|
|
69
|
+
token: "a4152b30c5276306151de1146321997e",
|
|
70
|
+
seed: "simple is best",
|
|
71
|
+
numDays: 108, //how many days worth1 of data
|
|
72
|
+
numEvents: 2_000_000, //how many events
|
|
73
|
+
numUsers: 50_000, //how many users
|
|
74
|
+
format: 'json', //csv or json
|
|
75
|
+
region: "US",
|
|
76
|
+
hasAnonIds: false, //if true, anonymousIds are created for each user
|
|
77
|
+
hasSessionIds: false, //if true, hasSessionIds are created for each user
|
|
78
|
+
hasAdSpend: false,
|
|
79
|
+
makeChart: false,
|
|
80
|
+
hasLocation: true,
|
|
81
|
+
hasAndroidDevices: true,
|
|
82
|
+
hasIOSDevices: true,
|
|
83
|
+
hasDesktopDevices: true,
|
|
84
|
+
hasBrowser: true,
|
|
85
|
+
hasCampaigns: false,
|
|
86
|
+
isAnonymous: false,
|
|
87
|
+
alsoInferFunnels: false,
|
|
88
|
+
concurrency: 1,
|
|
89
|
+
batchSize: 2_500_000,
|
|
90
|
+
percentUsersBornInDataset: 25,
|
|
91
|
+
events: [
|
|
92
|
+
{
|
|
93
|
+
event: "checkout",
|
|
94
|
+
weight: 2,
|
|
95
|
+
properties: {
|
|
96
|
+
currency: pickAWinner(["USD", "CAD", "EUR", "BTC", "ETH", "JPY"], 0),
|
|
97
|
+
coupon: weighChoices(["none", "none", "none", "none", "10%OFF", "20%OFF", "10%OFF", "20%OFF", "30%OFF", "40%OFF", "50%OFF"]),
|
|
98
|
+
cart: makeProducts()
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
event: "add to cart",
|
|
103
|
+
weight: 4,
|
|
104
|
+
properties: {
|
|
105
|
+
item: makeProducts(1),
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
event: "view item",
|
|
110
|
+
weight: 8,
|
|
111
|
+
properties: {
|
|
112
|
+
item: makeProducts(1)
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
event: "save item",
|
|
117
|
+
weight: 5,
|
|
118
|
+
properties: {
|
|
119
|
+
item: makeProducts(1),
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
event: "page view",
|
|
124
|
+
weight: 10,
|
|
125
|
+
properties: {
|
|
126
|
+
page: ["/", "/help", "/account", "/watch", "/listen", "/product", "/people", "/peace"],
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
event: "watch video",
|
|
131
|
+
weight: 8,
|
|
132
|
+
properties: {
|
|
133
|
+
watchTimeSec: weighNumRange(10, 600, .25),
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
event: "like video",
|
|
138
|
+
weight: 6,
|
|
139
|
+
properties: {
|
|
140
|
+
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
event: "dislike video",
|
|
145
|
+
weight: 4,
|
|
146
|
+
properties: {
|
|
147
|
+
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
event: "sign up",
|
|
152
|
+
weight: 1,
|
|
153
|
+
isFirstEvent: true,
|
|
154
|
+
properties: {
|
|
155
|
+
signupMethod: pickAWinner(["email", "google", "facebook", "twitter", "linkedin", "github"]),
|
|
156
|
+
referral: weighChoices(["none", "none", "none", "friend", "ad", "ad", "ad", "friend", "friend", "friend", "friend"]),
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
],
|
|
161
|
+
funnels: [
|
|
162
|
+
{
|
|
163
|
+
sequence: ["page view", "view item", "save item", "page view", "sign up"],
|
|
164
|
+
conversionRate: 50,
|
|
165
|
+
order: "first-and-last-fixed",
|
|
166
|
+
weight: 1,
|
|
167
|
+
isFirstFunnel: true,
|
|
168
|
+
timeToConvert: 2,
|
|
169
|
+
experiment: false,
|
|
170
|
+
name: "Signup Flow"
|
|
171
|
+
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
sequence: ["watch video", "like video", "watch video", "like video"],
|
|
175
|
+
name: "Video Likes",
|
|
176
|
+
conversionRate: 60,
|
|
177
|
+
props: {
|
|
178
|
+
videoCategory: videoCategories,
|
|
179
|
+
quality: ["2160p", "1440p", "1080p", "720p", "480p", "360p", "240p"],
|
|
180
|
+
format: ["mp4", "avi", "mov", "mpg"],
|
|
181
|
+
uploader_id: chance.guid.bind(chance)
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: "Video Dislikes",
|
|
186
|
+
sequence: ["watch video", "dislike video", "watch video", "dislike video"],
|
|
187
|
+
conversionRate: 20,
|
|
188
|
+
props: {
|
|
189
|
+
videoCategory: videoCategories,
|
|
190
|
+
quality: ["2160p", "1440p", "1080p", "720p", "480p", "360p", "240p"],
|
|
191
|
+
format: ["mp4", "avi", "mov", "mpg"],
|
|
192
|
+
uploader_id: chance.guid.bind(chance)
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: "eCommerce Purchase",
|
|
197
|
+
sequence: ["view item", "view item", "add to cart", "view item", "add to cart", "checkout"],
|
|
198
|
+
conversionRate: 15,
|
|
199
|
+
requireRepeats: true,
|
|
200
|
+
weight: 10,
|
|
201
|
+
order: "last-fixed",
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
],
|
|
205
|
+
superProps: {
|
|
206
|
+
theme: pickAWinner(["light", "dark", "custom", "light", "dark"]),
|
|
207
|
+
},
|
|
208
|
+
/*
|
|
209
|
+
user properties work the same as event properties
|
|
210
|
+
each key should be an array or function reference
|
|
211
|
+
*/
|
|
212
|
+
userProps: {
|
|
213
|
+
title: chance.profession.bind(chance),
|
|
214
|
+
luckyNumber: weighNumRange(42, 420, .3),
|
|
215
|
+
spiritAnimal: spiritAnimals
|
|
216
|
+
},
|
|
217
|
+
scdProps: {},
|
|
218
|
+
mirrorProps: {},
|
|
219
|
+
|
|
220
|
+
/*
|
|
221
|
+
for group analytics keys, we need an array of arrays [[],[],[]]
|
|
222
|
+
each pair represents a group_key and the number of profiles for that key
|
|
223
|
+
*/
|
|
224
|
+
groupKeys: [],
|
|
225
|
+
groupProps: {},
|
|
226
|
+
lookupTables: [],
|
|
227
|
+
hook: function (record, type, meta) {
|
|
228
|
+
|
|
229
|
+
if (type === "event") {
|
|
230
|
+
const NOW = dayjs();
|
|
231
|
+
const DAY_SIGNUPS_IMPROVED = NOW.subtract(7, 'day');
|
|
232
|
+
const DAY_WATCH_TIME_WENT_UP = NOW.subtract(30, 'day');
|
|
233
|
+
const eventTime = dayjs(record.time);
|
|
234
|
+
|
|
235
|
+
// unflattering 'items'
|
|
236
|
+
if (record.item && Array.isArray(record.item)) {
|
|
237
|
+
record = { ...record, ...record.item[0] };
|
|
238
|
+
delete record.item;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (record.event === 'sign up') {
|
|
242
|
+
record.signup_flow = "v1";
|
|
243
|
+
if (eventTime.isBefore(DAY_SIGNUPS_IMPROVED)) {
|
|
244
|
+
// 50% of the time kill the signup
|
|
245
|
+
if (chance.bool({ likelihood: 50 })) {
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (eventTime.isAfter(DAY_SIGNUPS_IMPROVED)) {
|
|
250
|
+
record.signup_flow = "v2";
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (record.event === 'watch video') {
|
|
255
|
+
const factor = decimal(0.25, 0.79);
|
|
256
|
+
if (eventTime.isBefore(DAY_WATCH_TIME_WENT_UP)) {
|
|
257
|
+
record.watchTimeSec = Math.round(record.watchTimeSec * (1 - factor));
|
|
258
|
+
}
|
|
259
|
+
if (eventTime.isAfter(DAY_WATCH_TIME_WENT_UP)) {
|
|
260
|
+
// increase watch time by 33%
|
|
261
|
+
record.watchTimeSec = Math.round(record.watchTimeSec * (1 + factor));
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// toys + shoes frequently purchases together (and are higher cart values)
|
|
267
|
+
if (record.event === 'checkout' && Array.isArray(record.cart)) {
|
|
268
|
+
const hasToys = record.cart.some(item => item.category === 'toys');
|
|
269
|
+
const hasShoes = record.cart.some(item => item.category === 'shoes');
|
|
270
|
+
if (hasToys && !hasShoes) {
|
|
271
|
+
const bigCart = makeProducts(20)()()[0];
|
|
272
|
+
const shoeItems = bigCart.filter(item => item.category === 'shoes');
|
|
273
|
+
if (shoeItems.length > 0) {
|
|
274
|
+
record.cart.push(shoeItems[0]);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (hasShoes && !hasToys) {
|
|
279
|
+
const bigCart = makeProducts(20)()()[0];
|
|
280
|
+
const toyItems = bigCart.filter(item => item.category === 'toys');
|
|
281
|
+
if (toyItems.length > 0) {
|
|
282
|
+
record.cart.push(toyItems[0]);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if (!hasToys && !hasShoes) {
|
|
287
|
+
const cheapFactor = decimal(.75, 0.9);
|
|
288
|
+
// make every item a bit cheaper
|
|
289
|
+
record.cart = record.cart.map(item => {
|
|
290
|
+
return {
|
|
291
|
+
...item,
|
|
292
|
+
amount: Math.round(item.amount * cheapFactor),
|
|
293
|
+
total_value: Math.round(item.total_value * cheapFactor)
|
|
294
|
+
};
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
// high quality video means longer watch times (lower quality shorter watch times)
|
|
299
|
+
if (record.event === 'watch video') {
|
|
300
|
+
const qualityFactors = {
|
|
301
|
+
"2160p": 1.5,
|
|
302
|
+
"1440p": 1.4,
|
|
303
|
+
"1080p": 1.3,
|
|
304
|
+
"720p": 1.15,
|
|
305
|
+
"480p": 1.0,
|
|
306
|
+
"360p": 0.85,
|
|
307
|
+
"240p": 0.7
|
|
308
|
+
};
|
|
309
|
+
const quality = record.quality || "480p";
|
|
310
|
+
const factor = qualityFactors[quality] || 1.0;
|
|
311
|
+
record.watchTimeSec = Math.round(record.watchTimeSec * factor);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
if (type === "everything") {
|
|
321
|
+
// big themes!
|
|
322
|
+
|
|
323
|
+
// users who view items in the home and garden category churn more frequently
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
// dark mode leads to faster purchase conversion
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
// people who pay in bitcoin tend to buy more electronics and gadgets
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
//custom themes purchase more:
|
|
334
|
+
// const numCustomMode = record.filter(a => a.theme === 'custom').length;
|
|
335
|
+
// const numLightMode = record.filter(a => a.theme === 'light').length;
|
|
336
|
+
// const numDarkMode = record.filter(a => a.theme === 'dark').length;
|
|
337
|
+
// if (numCustomMode > numLightMode || numCustomMode > numDarkMode) {
|
|
338
|
+
// //triple their checkout events
|
|
339
|
+
// const checkoutEvents = record.filter(a => a.event === 'checkout');
|
|
340
|
+
// const newCheckouts = checkoutEvents.map(a => {
|
|
341
|
+
// const randomInt = integer(-48, 48);
|
|
342
|
+
// const newCheckout = {
|
|
343
|
+
// ...a,
|
|
344
|
+
// time: dayjs(a.time).add(randomInt, 'hour').toISOString(),
|
|
345
|
+
// event: "checkout",
|
|
346
|
+
// amount: a.amount * 2,
|
|
347
|
+
// coupon: "50%OFF"
|
|
348
|
+
// };
|
|
349
|
+
// return newCheckout;
|
|
350
|
+
// });
|
|
351
|
+
// record.push(...newCheckouts);
|
|
352
|
+
// }
|
|
353
|
+
|
|
354
|
+
// //users who watch low quality videos churn more:
|
|
355
|
+
// const loQuality = ["480p", "360p", "240p"];
|
|
356
|
+
// const lowQualityWatches = record.filter(a => a.event === 'watch video' && loQuality.includes(a.quality));
|
|
357
|
+
// const highQualityWatches = record.filter(a => a.event === 'watch video' && !loQuality.includes(a.quality));
|
|
358
|
+
// if (lowQualityWatches.length > highQualityWatches.length) {
|
|
359
|
+
// if (flip()) {
|
|
360
|
+
// // find midpoint of records
|
|
361
|
+
// const midpoint = Math.floor(record.length / 2);
|
|
362
|
+
// record = record.slice(0, midpoint);
|
|
363
|
+
|
|
364
|
+
// }
|
|
365
|
+
// }
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
return record;
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
function flip(likelihood = 50) {
|
|
379
|
+
return chance.bool({ likelihood });
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
export default config;
|
|
File without changes
|
package/dungeons/experiments.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
|
-
import utc from 'dayjs/plugin/utc';
|
|
3
|
+
import utc from 'dayjs/plugin/utc.js';
|
|
4
4
|
import 'dotenv/config';
|
|
5
|
-
import * as u from
|
|
5
|
+
import * as u from "../lib/utils/utils.js";
|
|
6
6
|
import * as v from 'ak-tools';
|
|
7
7
|
|
|
8
8
|
const SEED = "my-seed";
|
|
@@ -15,7 +15,7 @@ const days = 100;
|
|
|
15
15
|
|
|
16
16
|
/** @type {Config} */
|
|
17
17
|
const config = {
|
|
18
|
-
token: "",
|
|
18
|
+
token: process.env.MASTER_PROJECT_TOKEN || "",
|
|
19
19
|
seed: SEED,
|
|
20
20
|
numDays: days,
|
|
21
21
|
numEvents: num_users * 100,
|
|
@@ -34,9 +34,10 @@ const config = {
|
|
|
34
34
|
hasAdSpend: false,
|
|
35
35
|
|
|
36
36
|
hasAvatar: true,
|
|
37
|
+
makeChart: false,
|
|
37
38
|
|
|
38
39
|
|
|
39
|
-
batchSize:
|
|
40
|
+
batchSize: 2_500_000,
|
|
40
41
|
concurrency: 1,
|
|
41
42
|
writeToDisk: false,
|
|
42
43
|
|
package/dungeons/foobar.js
CHANGED
|
@@ -136,7 +136,7 @@ const seed = Math.random().toString()
|
|
|
136
136
|
|
|
137
137
|
/** @type {import('../types').Dungeon} */
|
|
138
138
|
const config = {
|
|
139
|
-
token: "",
|
|
139
|
+
token: process.env.MASTER_PROJECT_TOKEN || "",
|
|
140
140
|
seed: seed,
|
|
141
141
|
numDays: 30, //how many days worth of data
|
|
142
142
|
numEvents: numEvents, //how many events
|
package/dungeons/funnels.js
CHANGED
|
@@ -14,7 +14,7 @@ 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
|
|
17
|
+
import { pickAWinner, weighNumRange, date, integer } from "../lib/utils/utils.js";
|
|
18
18
|
|
|
19
19
|
const itemCategories = ["Books", "Movies", "Music", "Games", "Electronics", "Computers", "Smart Home", "Home", "Garden", "Pet", "Beauty", "Health", "Toys", "Kids", "Baby", "Handmade", "Sports", "Outdoors", "Automotive", "Industrial", "Entertainment", "Art", "Food", "Appliances", "Office", "Wedding", "Software"];
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ const videoCategories = ["funny", "educational", "inspirational", "music", "news
|
|
|
22
22
|
|
|
23
23
|
/** @type {import('../types').Dungeon} */
|
|
24
24
|
const config = {
|
|
25
|
-
token: "",
|
|
25
|
+
token: process.env.MASTER_PROJECT_TOKEN || "",
|
|
26
26
|
seed: "simple is best",
|
|
27
27
|
numDays: 30, //how many days worth of data
|
|
28
28
|
numEvents: 50000, //how many events
|
package/dungeons/gaming.js
CHANGED
|
@@ -15,7 +15,7 @@ const days = 180;
|
|
|
15
15
|
|
|
16
16
|
/** @type {Config} */
|
|
17
17
|
const config = {
|
|
18
|
-
token: "",
|
|
18
|
+
token: process.env.MASTER_PROJECT_TOKEN || "",
|
|
19
19
|
seed: "i am gamer face",
|
|
20
20
|
numDays: days,
|
|
21
21
|
numEvents: num_users * 90,
|
|
@@ -35,8 +35,9 @@ const config = {
|
|
|
35
35
|
percentUsersBornInDataset: 25,
|
|
36
36
|
|
|
37
37
|
hasAvatar: true,
|
|
38
|
+
makeChart: false,
|
|
38
39
|
|
|
39
|
-
batchSize:
|
|
40
|
+
batchSize: 2_500_000,
|
|
40
41
|
concurrency: 1,
|
|
41
42
|
writeToDisk: true,
|
|
42
43
|
funnels: [
|