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,211 @@
|
|
|
1
|
+
|
|
2
|
+
const SEED = "kurby-retention";
|
|
3
|
+
import dayjs from 'dayjs';
|
|
4
|
+
import utc from 'dayjs/plugin/utc.js';
|
|
5
|
+
dayjs.extend(utc);
|
|
6
|
+
import * as u from "../lib/utils/utils.js";
|
|
7
|
+
import * as v from 'ak-tools';
|
|
8
|
+
const chance = u.initChance(SEED);
|
|
9
|
+
|
|
10
|
+
const num_users = 100;
|
|
11
|
+
const days = 360;
|
|
12
|
+
|
|
13
|
+
/** @typedef {import("../types.js").Dungeon} Config */
|
|
14
|
+
|
|
15
|
+
// Churn rates by favorite color per behavior type (percentage likelihood)
|
|
16
|
+
const CHURN_RATES = {
|
|
17
|
+
red: { hourly: 15, daily: 40, weekly: 15, monthly: 10 },
|
|
18
|
+
blue: { hourly: 15, daily: 15, weekly: 40, monthly: 10 },
|
|
19
|
+
green: { hourly: 5, daily: 5, weekly: 5, monthly: 5 },
|
|
20
|
+
yellow: { hourly: 15, daily: 15, weekly: 15, monthly: 40 },
|
|
21
|
+
purple: { hourly: 40, daily: 15, weekly: 15, monthly: 10 },
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// Behavior cadence definitions: [intervalAmount, intervalUnit, jitterMax, jitterUnit]
|
|
25
|
+
const BEHAVIORS = {
|
|
26
|
+
hourly: { interval: 1, unit: 'hour', jitterMax: 10, jitterUnit: 'minute' },
|
|
27
|
+
daily: { interval: 1, unit: 'day', jitterMax: 2, jitterUnit: 'hour' },
|
|
28
|
+
weekly: { interval: 7, unit: 'day', jitterMax: 12, jitterUnit: 'hour' },
|
|
29
|
+
monthly: { interval: 30, unit: 'day', jitterMax: 2, jitterUnit: 'day' },
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
function generateCadencedEvents(behaviorName, cadence, startTime, endTime, churnTime, userId) {
|
|
33
|
+
const events = [];
|
|
34
|
+
let cursor = dayjs(startTime);
|
|
35
|
+
const end = dayjs(endTime);
|
|
36
|
+
|
|
37
|
+
while (cursor.isBefore(end)) {
|
|
38
|
+
if (churnTime && cursor.isAfter(churnTime)) break;
|
|
39
|
+
|
|
40
|
+
const jitter = chance.integer({ min: -cadence.jitterMax, max: cadence.jitterMax });
|
|
41
|
+
const eventTime = cursor.add(jitter, cadence.jitterUnit);
|
|
42
|
+
|
|
43
|
+
if (eventTime.isBefore(end) && eventTime.isAfter(startTime)) {
|
|
44
|
+
events.push({
|
|
45
|
+
event: `${behaviorName} behavior`,
|
|
46
|
+
time: eventTime.toISOString(),
|
|
47
|
+
user_id: userId,
|
|
48
|
+
insert_id: v.uid(12),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
cursor = cursor.add(cadence.interval, cadence.unit);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Insert churn event if user churns on this behavior
|
|
56
|
+
if (churnTime && dayjs(churnTime).isBefore(end)) {
|
|
57
|
+
events.push({
|
|
58
|
+
event: `churn - ${behaviorName} behavior`,
|
|
59
|
+
time: dayjs(churnTime).toISOString(),
|
|
60
|
+
user_id: userId,
|
|
61
|
+
insert_id: v.uid(12),
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return events;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** @type {Config} */
|
|
69
|
+
const config = {
|
|
70
|
+
token: "ed63e7c6227b1990d2b1b847d7d8e0d9",
|
|
71
|
+
seed: "lets go",
|
|
72
|
+
numDays: days,
|
|
73
|
+
numEvents: num_users * 50,
|
|
74
|
+
numUsers: num_users,
|
|
75
|
+
hasAnonIds: false,
|
|
76
|
+
hasSessionIds: false,
|
|
77
|
+
format: "json",
|
|
78
|
+
alsoInferFunnels: false,
|
|
79
|
+
hasLocation: false,
|
|
80
|
+
hasAndroidDevices: false,
|
|
81
|
+
hasIOSDevices: false,
|
|
82
|
+
hasDesktopDevices: false,
|
|
83
|
+
hasBrowser: false,
|
|
84
|
+
hasCampaigns: false,
|
|
85
|
+
isAnonymous: false,
|
|
86
|
+
hasAdSpend: false,
|
|
87
|
+
hasAvatar: false,
|
|
88
|
+
makeChart: false,
|
|
89
|
+
batchSize: 5_500_000,
|
|
90
|
+
concurrency: 10,
|
|
91
|
+
writeToDisk: false,
|
|
92
|
+
percentUsersBornInDataset: 100,
|
|
93
|
+
|
|
94
|
+
funnels: [],
|
|
95
|
+
|
|
96
|
+
events: [
|
|
97
|
+
{
|
|
98
|
+
event: "first behavior",
|
|
99
|
+
weight: 1,
|
|
100
|
+
isFirstEvent: true,
|
|
101
|
+
properties: {},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
event: "hourly behavior",
|
|
105
|
+
weight: 40,
|
|
106
|
+
properties: {},
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
event: "daily behavior",
|
|
110
|
+
weight: 30,
|
|
111
|
+
properties: {},
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
event: "weekly behavior",
|
|
115
|
+
weight: 15,
|
|
116
|
+
properties: {},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
event: "monthly behavior",
|
|
120
|
+
weight: 10,
|
|
121
|
+
properties: {},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
event: "placeholder",
|
|
125
|
+
weight: 50,
|
|
126
|
+
properties: {},
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
|
|
130
|
+
superProps: {},
|
|
131
|
+
|
|
132
|
+
userProps: {
|
|
133
|
+
"favorite color": ["red", "blue", "green", "yellow", "purple"],
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
scdProps: {},
|
|
137
|
+
mirrorProps: {},
|
|
138
|
+
groupKeys: [],
|
|
139
|
+
groupProps: {},
|
|
140
|
+
lookupTables: [],
|
|
141
|
+
|
|
142
|
+
hook: function (record, type, meta) {
|
|
143
|
+
if (type === "everything") {
|
|
144
|
+
if (!record.length) return record;
|
|
145
|
+
|
|
146
|
+
const userId = record[0].user_id || record[0].device_id;
|
|
147
|
+
if (!userId) return record;
|
|
148
|
+
|
|
149
|
+
const favoriteColor = meta.profile?.["favorite color"] || "green";
|
|
150
|
+
const colorChurnRates = CHURN_RATES[favoriteColor] || CHURN_RATES.green;
|
|
151
|
+
|
|
152
|
+
// Find the time range from the raw events
|
|
153
|
+
const times = record.map(e => new Date(e.time).getTime()).filter(t => !isNaN(t));
|
|
154
|
+
if (!times.length) return record;
|
|
155
|
+
const startTime = dayjs(Math.min(...times));
|
|
156
|
+
const endTime = dayjs(Math.max(...times));
|
|
157
|
+
const totalSpanHours = endTime.diff(startTime, 'hour');
|
|
158
|
+
|
|
159
|
+
if (totalSpanHours < 1) return record;
|
|
160
|
+
|
|
161
|
+
// Keep the "first behavior" event from the original stream
|
|
162
|
+
const firstBehavior = record.find(e => e.event === "first behavior");
|
|
163
|
+
const newEvents = [];
|
|
164
|
+
|
|
165
|
+
if (firstBehavior) {
|
|
166
|
+
newEvents.push(firstBehavior);
|
|
167
|
+
} else {
|
|
168
|
+
// Create a first behavior event at the start
|
|
169
|
+
newEvents.push({
|
|
170
|
+
event: "first behavior",
|
|
171
|
+
time: startTime.toISOString(),
|
|
172
|
+
user_id: userId,
|
|
173
|
+
insert_id: v.uid(12),
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// For each behavior type, determine churn and generate cadenced events
|
|
178
|
+
for (const [behaviorKey, cadence] of Object.entries(BEHAVIORS)) {
|
|
179
|
+
const churnRate = colorChurnRates[behaviorKey];
|
|
180
|
+
let churnTime = null;
|
|
181
|
+
|
|
182
|
+
if (chance.bool({ likelihood: churnRate })) {
|
|
183
|
+
// Pick churn time between 20% and 80% into the active period
|
|
184
|
+
const churnOffsetHours = chance.integer({
|
|
185
|
+
min: Math.floor(totalSpanHours * 0.2),
|
|
186
|
+
max: Math.floor(totalSpanHours * 0.8),
|
|
187
|
+
});
|
|
188
|
+
churnTime = startTime.add(churnOffsetHours, 'hour');
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const behaviorEvents = generateCadencedEvents(
|
|
192
|
+
behaviorKey,
|
|
193
|
+
cadence,
|
|
194
|
+
startTime,
|
|
195
|
+
endTime,
|
|
196
|
+
churnTime,
|
|
197
|
+
userId
|
|
198
|
+
);
|
|
199
|
+
newEvents.push(...behaviorEvents);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Sort all events by time
|
|
203
|
+
newEvents.sort((a, b) => new Date(a.time) - new Date(b.time));
|
|
204
|
+
return newEvents;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return record;
|
|
208
|
+
},
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
export default config;
|
package/dungeons/media.js
CHANGED
|
@@ -4,7 +4,7 @@ import dayjs from 'dayjs';
|
|
|
4
4
|
import utc from 'dayjs/plugin/utc.js';
|
|
5
5
|
dayjs.extend(utc);
|
|
6
6
|
import 'dotenv/config';
|
|
7
|
-
import * as u from
|
|
7
|
+
import * as u from "../lib/utils/utils.js";
|
|
8
8
|
import * as v from 'ak-tools';
|
|
9
9
|
const chance = u.initChance(SEED);
|
|
10
10
|
const num_users = 10_000;
|
|
@@ -25,14 +25,14 @@ const channelIds = genIds(100);
|
|
|
25
25
|
|
|
26
26
|
/** @type {Config} */
|
|
27
27
|
const config = {
|
|
28
|
-
token: "",
|
|
28
|
+
// token: process.env.MASTER_PROJECT_TOKEN || "",
|
|
29
29
|
seed: `LFG!`, //,
|
|
30
30
|
numDays: days,
|
|
31
31
|
numEvents: num_users * 63,
|
|
32
32
|
numUsers: num_users,
|
|
33
33
|
hasAnonIds: false,
|
|
34
34
|
hasSessionIds: false,
|
|
35
|
-
format: "
|
|
35
|
+
format: "csv",
|
|
36
36
|
alsoInferFunnels: false,
|
|
37
37
|
hasLocation: false,
|
|
38
38
|
hasAndroidDevices: true,
|
|
@@ -44,8 +44,9 @@ const config = {
|
|
|
44
44
|
hasAdSpend: false,
|
|
45
45
|
|
|
46
46
|
hasAvatar: false,
|
|
47
|
+
makeChart: false,
|
|
47
48
|
|
|
48
|
-
batchSize:
|
|
49
|
+
batchSize: 2_500_000,
|
|
49
50
|
concurrency: 10,
|
|
50
51
|
writeToDisk: true,
|
|
51
52
|
|
package/dungeons/mil.js
CHANGED
|
@@ -4,7 +4,7 @@ import dayjs from 'dayjs';
|
|
|
4
4
|
import utc from 'dayjs/plugin/utc.js';
|
|
5
5
|
dayjs.extend(utc);
|
|
6
6
|
import 'dotenv/config';
|
|
7
|
-
import * as u from
|
|
7
|
+
import * as u from "../lib/utils/utils.js";
|
|
8
8
|
import * as v from 'ak-tools';
|
|
9
9
|
const chance = u.initChance(SEED);
|
|
10
10
|
const num_users = 10_000;
|
|
@@ -25,7 +25,7 @@ const channelIds = genIds(100);
|
|
|
25
25
|
|
|
26
26
|
/** @type {Config} */
|
|
27
27
|
const config = {
|
|
28
|
-
token: "",
|
|
28
|
+
token: process.env.MASTER_PROJECT_TOKEN || "",
|
|
29
29
|
seed: `LFG!`, //,
|
|
30
30
|
numDays: days,
|
|
31
31
|
numEvents: num_users * 62,
|
|
@@ -44,8 +44,9 @@ const config = {
|
|
|
44
44
|
hasAdSpend: false,
|
|
45
45
|
|
|
46
46
|
hasAvatar: false,
|
|
47
|
+
makeChart: false,
|
|
47
48
|
|
|
48
|
-
batchSize:
|
|
49
|
+
batchSize: 2_500_000,
|
|
49
50
|
concurrency: 10,
|
|
50
51
|
writeToDisk: true,
|
|
51
52
|
|
package/dungeons/mirror.js
CHANGED
|
@@ -14,12 +14,12 @@ 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
|
|
|
20
20
|
/** @type {import('../types').Dungeon} */
|
|
21
21
|
const config = {
|
|
22
|
-
token: "",
|
|
22
|
+
token: process.env.MASTER_PROJECT_TOKEN || "",
|
|
23
23
|
seed: "mirror me",
|
|
24
24
|
numDays: 30, //how many days worth of data
|
|
25
25
|
numEvents: 10000, //how many events
|
package/dungeons/money2020-ed.js
CHANGED
|
@@ -5,17 +5,17 @@ import utc from "dayjs/plugin/utc.js";
|
|
|
5
5
|
import "dotenv/config";
|
|
6
6
|
import { weighNumRange, range, date, initChance, exhaust, choose, integer, decimal } from "../lib/utils/utils.js";
|
|
7
7
|
|
|
8
|
-
const SEED = "
|
|
8
|
+
const SEED = "thank sup hello 2020 money!!!";
|
|
9
9
|
dayjs.extend(utc);
|
|
10
10
|
const chance = initChance(SEED);
|
|
11
|
-
const num_users =
|
|
12
|
-
const days =
|
|
11
|
+
const num_users = 10;
|
|
12
|
+
const days = 100;
|
|
13
13
|
|
|
14
14
|
/** @typedef {import("../types.js").Dungeon} Dungeon */
|
|
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 * 120,
|
|
@@ -31,11 +31,12 @@ const dungeon = {
|
|
|
31
31
|
hasBrowser: true,
|
|
32
32
|
hasCampaigns: true,
|
|
33
33
|
isAnonymous: false,
|
|
34
|
-
hasAdSpend:
|
|
35
|
-
|
|
34
|
+
hasAdSpend: true,
|
|
35
|
+
|
|
36
36
|
hasAvatar: true,
|
|
37
|
+
makeChart: false,
|
|
37
38
|
|
|
38
|
-
batchSize:
|
|
39
|
+
batchSize: 2_500_000,
|
|
39
40
|
concurrency: 1,
|
|
40
41
|
writeToDisk: false,
|
|
41
42
|
superProps: {
|
package/dungeons/sanity.js
CHANGED
|
@@ -13,12 +13,12 @@ const chance = new Chance();
|
|
|
13
13
|
import dayjs from 'dayjs';
|
|
14
14
|
import utc from 'dayjs/plugin/utc.js';
|
|
15
15
|
dayjs.extend(utc);
|
|
16
|
-
import { weighNumRange, integer } from
|
|
16
|
+
import { weighNumRange, integer } from "../lib/utils/utils.js";
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
/** @type {import('../types.js').Dungeon} */
|
|
20
20
|
const config = {
|
|
21
|
-
token: "",
|
|
21
|
+
token: process.env.MASTER_PROJECT_TOKEN || "",
|
|
22
22
|
seed: "foo bar",
|
|
23
23
|
numDays: 90, //how many days worth of data
|
|
24
24
|
numEvents: 50_000, //how many events
|
|
@@ -28,6 +28,7 @@ const config = {
|
|
|
28
28
|
hasAnonIds: false, //if true, anonymousIds are created for each user
|
|
29
29
|
hasSessionIds: false, //if true, hasSessionIds are created for each user
|
|
30
30
|
alsoInferFunnels: true, //if true, infer funnels from events
|
|
31
|
+
makeChart: true,
|
|
31
32
|
writeToDisk: true,
|
|
32
33
|
concurrency: 25,
|
|
33
34
|
funnels: [
|
package/dungeons/scd.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, weighChoices } from
|
|
17
|
+
import { pickAWinner, weighNumRange, date, integer, weighChoices } 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 worth1 of data
|
|
28
28
|
numEvents: 50000, //how many events
|
|
@@ -32,6 +32,7 @@ const config = {
|
|
|
32
32
|
hasAnonIds: false, //if true, anonymousIds are created for each user
|
|
33
33
|
hasSessionIds: false, //if true, hasSessionIds are created for each user
|
|
34
34
|
hasAdSpend: false,
|
|
35
|
+
makeChart: false,
|
|
35
36
|
hasLocation: true,
|
|
36
37
|
hasAndroidDevices: true,
|
|
37
38
|
hasIOSDevices: true,
|
package/dungeons/simple.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, weighChoices } from
|
|
17
|
+
import { pickAWinner, weighNumRange, date, integer, weighChoices } 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,29 +22,44 @@ const videoCategories = ["funny", "educational", "inspirational", "music", "news
|
|
|
22
22
|
|
|
23
23
|
/** @type {import('../types').Dungeon} */
|
|
24
24
|
const config = {
|
|
25
|
-
token: "",
|
|
26
|
-
seed: "simple is best
|
|
25
|
+
token: process.env.MASTER_PROJECT_TOKEN || "",
|
|
26
|
+
seed: "simple is best",
|
|
27
27
|
numDays: 100, //how many days worth1 of data
|
|
28
|
-
numEvents:
|
|
29
|
-
numUsers:
|
|
30
|
-
format: '
|
|
28
|
+
numEvents: 1_000_000, //how many events
|
|
29
|
+
numUsers: 10_000, //how many users
|
|
30
|
+
format: 'json', //csv or json
|
|
31
31
|
region: "US",
|
|
32
|
-
hasAnonIds:
|
|
33
|
-
hasSessionIds:
|
|
34
|
-
hasAdSpend:
|
|
32
|
+
hasAnonIds: true, //if true, anonymousIds are created for each user
|
|
33
|
+
hasSessionIds: true, //if true, hasSessionIds are created for each user
|
|
34
|
+
hasAdSpend: true,
|
|
35
|
+
makeChart: false,
|
|
35
36
|
hasLocation: true,
|
|
36
|
-
hasAndroidDevices:
|
|
37
|
-
hasIOSDevices:
|
|
38
|
-
hasDesktopDevices:
|
|
39
|
-
hasBrowser:
|
|
37
|
+
hasAndroidDevices: true,
|
|
38
|
+
hasIOSDevices: true,
|
|
39
|
+
hasDesktopDevices: true,
|
|
40
|
+
hasBrowser: true,
|
|
40
41
|
hasCampaigns: true,
|
|
41
42
|
isAnonymous: false,
|
|
42
43
|
alsoInferFunnels: true,
|
|
43
|
-
concurrency:
|
|
44
|
+
concurrency: 10,
|
|
44
45
|
batchSize: 2_500_000,
|
|
45
46
|
|
|
46
47
|
|
|
47
48
|
events: [
|
|
49
|
+
{
|
|
50
|
+
event: "ad impression",
|
|
51
|
+
weight: 15,
|
|
52
|
+
properties: {
|
|
53
|
+
partner: pickAWinner(["google", "facebook", "twitter", "linkedin", "bing", "taboola", "outbrain", "quora", "pinterest"]),
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
event: "ad click",
|
|
58
|
+
weight: 10,
|
|
59
|
+
properties: {
|
|
60
|
+
partner: pickAWinner(["google", "facebook", "twitter", "linkedin", "bing", "taboola", "outbrain", "quora", "pinterest"]),
|
|
61
|
+
}
|
|
62
|
+
},
|
|
48
63
|
{
|
|
49
64
|
event: "checkout",
|
|
50
65
|
weight: 2,
|
|
@@ -184,7 +199,7 @@ const config = {
|
|
|
184
199
|
|
|
185
200
|
if (type === "everything") {
|
|
186
201
|
|
|
187
|
-
//custom
|
|
202
|
+
//custom themes purchase more:
|
|
188
203
|
const numCustomMode = record.filter(a => a.theme === 'custom').length;
|
|
189
204
|
const numLightMode = record.filter(a => a.theme === 'light').length;
|
|
190
205
|
const numDarkMode = record.filter(a => a.theme === 'dark').length;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
name: "strict-event-count-test",
|
|
3
|
+
seed: "test-123",
|
|
4
|
+
|
|
5
|
+
// We want exactly 1000 events
|
|
6
|
+
numEvents: 1000,
|
|
7
|
+
|
|
8
|
+
// Even though we specify 500 users, we should stop early when we hit 1000 events
|
|
9
|
+
numUsers: 500,
|
|
10
|
+
|
|
11
|
+
numDays: 7,
|
|
12
|
+
|
|
13
|
+
// Enable strict event count - this will bail out at exactly numEvents
|
|
14
|
+
strictEventCount: true,
|
|
15
|
+
|
|
16
|
+
verbose: true,
|
|
17
|
+
writeToDisk: true,
|
|
18
|
+
format: 'json',
|
|
19
|
+
|
|
20
|
+
events: [
|
|
21
|
+
{ event: "page_view", weight: 5 },
|
|
22
|
+
{ event: "click", weight: 3 },
|
|
23
|
+
{ event: "purchase", weight: 1 }
|
|
24
|
+
],
|
|
25
|
+
|
|
26
|
+
userProps: {
|
|
27
|
+
plan: ["free", "pro", "enterprise"],
|
|
28
|
+
region: ["US", "EU", "APAC"]
|
|
29
|
+
}
|
|
30
|
+
};
|
|
@@ -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,8 +34,9 @@ const config = {
|
|
|
34
34
|
hasAdSpend: true,
|
|
35
35
|
|
|
36
36
|
hasAvatar: true,
|
|
37
|
+
makeChart: false,
|
|
37
38
|
|
|
38
|
-
batchSize:
|
|
39
|
+
batchSize: 2_500_000,
|
|
39
40
|
concurrency: 1,
|
|
40
41
|
writeToDisk: false,
|
|
41
42
|
|