make-mp-data 3.0.3 → 3.0.5
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 +46 -0
- package/dungeons/array-of-object-lookup-schema.json +327 -0
- package/dungeons/array-of-object-lookup.js +29 -9
- package/dungeons/capstone/capstone-ic3.js +291 -0
- package/dungeons/capstone/capstone-ic4.js +598 -0
- package/dungeons/capstone/capstone-ic5.js +668 -0
- package/dungeons/capstone/generate-product-lookup.js +309 -0
- package/dungeons/ecommerce-schema.json +462 -0
- package/dungeons/{copilot.js → ecommerce.js} +79 -17
- package/dungeons/education-schema.json +2409 -0
- package/dungeons/education.js +226 -462
- package/dungeons/fintech-schema.json +14034 -0
- package/dungeons/fintech.js +134 -413
- package/dungeons/foobar-schema.json +403 -0
- package/dungeons/foobar.js +27 -4
- package/dungeons/food-delivery-schema.json +192 -0
- package/dungeons/food-delivery.js +602 -0
- package/dungeons/food-schema.json +1152 -0
- package/dungeons/food.js +173 -406
- package/dungeons/gaming-schema.json +1270 -0
- package/dungeons/gaming.js +182 -42
- package/dungeons/insurance-application-schema.json +204 -0
- package/dungeons/insurance-application.js +605 -0
- package/dungeons/media-schema.json +906 -0
- package/dungeons/media.js +250 -420
- package/dungeons/retention-cadence-schema.json +78 -0
- package/dungeons/retention-cadence.js +35 -1
- package/dungeons/rpg-schema.json +4526 -0
- package/dungeons/rpg.js +171 -429
- package/dungeons/sanity-schema.json +255 -0
- package/dungeons/sanity.js +21 -10
- package/dungeons/sass-schema.json +1291 -0
- package/dungeons/sass.js +241 -368
- package/dungeons/scd-schema.json +919 -0
- package/dungeons/scd.js +41 -13
- package/dungeons/simple-schema.json +608 -0
- package/dungeons/simple.js +52 -15
- package/dungeons/simplest-schema.json +1418 -0
- package/dungeons/simplest.js +392 -0
- package/dungeons/social-schema.json +1118 -0
- package/dungeons/social.js +150 -391
- package/dungeons/text-generation-schema.json +3096 -0
- package/dungeons/text-generation.js +71 -0
- package/index.js +8 -6
- package/lib/core/config-validator.js +28 -8
- package/lib/core/storage.js +5 -5
- package/lib/generators/events.js +4 -4
- package/lib/orchestrators/mixpanel-sender.js +16 -13
- package/lib/orchestrators/user-loop.js +14 -6
- package/lib/templates/soup-presets.js +188 -0
- package/lib/utils/utils.js +52 -6
- package/package.json +1 -1
- package/types.d.ts +20 -3
- package/dungeons/adspend.js +0 -130
- package/dungeons/anon.js +0 -128
- package/dungeons/benchmark-heavy.js +0 -240
- package/dungeons/benchmark-light.js +0 -140
- package/dungeons/big.js +0 -226
- package/dungeons/business.js +0 -391
- package/dungeons/complex.js +0 -428
- package/dungeons/experiments.js +0 -137
- package/dungeons/funnels.js +0 -309
- package/dungeons/mil.js +0 -323
- package/dungeons/mirror.js +0 -161
- package/dungeons/soup-test.js +0 -52
- package/dungeons/streaming.js +0 -372
- package/dungeons/strict-event-test.js +0 -30
- package/dungeons/student-teacher.js +0 -438
- package/dungeons/too-big-events.js +0 -203
- package/dungeons/user-agent.js +0 -209
package/types.d.ts
CHANGED
|
@@ -133,17 +133,34 @@ export type SCDProp = {
|
|
|
133
133
|
};
|
|
134
134
|
|
|
135
135
|
/**
|
|
136
|
-
*
|
|
136
|
+
* Soup preset names for common time distribution patterns
|
|
137
137
|
*/
|
|
138
|
-
type
|
|
138
|
+
export type SoupPreset = "steady" | "growth" | "spiky" | "seasonal" | "global" | "churny" | "chaotic";
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Soup configuration object for fine-grained control
|
|
142
|
+
*/
|
|
143
|
+
export type SoupConfig = {
|
|
144
|
+
/** Use a named preset as base, then override individual fields */
|
|
145
|
+
preset?: SoupPreset;
|
|
139
146
|
/** Controls clustering tightness. Higher = tighter peaks. Default: 2 */
|
|
140
147
|
deviation?: number;
|
|
141
|
-
/** Number of time clusters to distribute events across. Default:
|
|
148
|
+
/** Number of time clusters to distribute events across. Default: numDays*2 */
|
|
142
149
|
peaks?: number;
|
|
143
150
|
/** Offset for the normal distribution center within each peak. Default: 0 */
|
|
144
151
|
mean?: number;
|
|
152
|
+
/** Day-of-week weights (7 elements, index 0=Sunday). Normalized max=1.0. Set null to disable. */
|
|
153
|
+
dayOfWeekWeights?: number[] | null;
|
|
154
|
+
/** Hour-of-day weights (24 elements, index 0=midnight UTC). Normalized max=1.0. Set null to disable. */
|
|
155
|
+
hourOfDayWeights?: number[] | null;
|
|
145
156
|
};
|
|
146
157
|
|
|
158
|
+
/**
|
|
159
|
+
* the soup is a set of parameters that determine the distribution of events over time.
|
|
160
|
+
* Can be a preset name string, a config object, or a config object with a preset base.
|
|
161
|
+
*/
|
|
162
|
+
type soup = SoupPreset | SoupConfig;
|
|
163
|
+
|
|
147
164
|
/**
|
|
148
165
|
* Hook types and when they fire (in order per user):
|
|
149
166
|
* - "user" — user profile object (mutate in-place, return ignored)
|
package/dungeons/adspend.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
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
|
-
const 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 } from "../lib/utils/utils.js";
|
|
18
|
-
|
|
19
|
-
/** @type {import('../types').Dungeon} */
|
|
20
|
-
const config = {
|
|
21
|
-
token: "",
|
|
22
|
-
seed: "foo bar",
|
|
23
|
-
numDays: 365, //how many days worth of data
|
|
24
|
-
numEvents: 10000000, //how many events
|
|
25
|
-
numUsers: 25000, //how many users
|
|
26
|
-
format: 'json', //csv or json
|
|
27
|
-
region: "US",
|
|
28
|
-
hasAnonIds: true, //if true, anonymousIds are created for each user
|
|
29
|
-
hasSessionIds: false, //if true, hasSessionIds are created for each user
|
|
30
|
-
hasAdSpend: true,
|
|
31
|
-
events: [
|
|
32
|
-
{
|
|
33
|
-
event: "foo",
|
|
34
|
-
weight: 10,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
event: "bar",
|
|
38
|
-
weight: 9,
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
event: "baz",
|
|
42
|
-
weight: 8,
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
event: "qux",
|
|
46
|
-
weight: 7,
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
event: "garply",
|
|
50
|
-
weight: 6,
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
event: "durtle",
|
|
54
|
-
weight: 5,
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
event: "linny",
|
|
58
|
-
weight: 4,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
event: "fonk",
|
|
62
|
-
weight: 3,
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
event: "crumn",
|
|
66
|
-
weight: 2,
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
event: "yak",
|
|
70
|
-
weight: 1,
|
|
71
|
-
}
|
|
72
|
-
],
|
|
73
|
-
superProps: {
|
|
74
|
-
color: ["red", "orange", "yellow", "green", "blue", "indigo", "violet"],
|
|
75
|
-
number: integer,
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
userProps: {
|
|
79
|
-
title: chance.profession.bind(chance),
|
|
80
|
-
luckyNumber: weighNumRange(42, 420),
|
|
81
|
-
spiritAnimal: ["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"]
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
scdProps: {},
|
|
85
|
-
mirrorProps: {},
|
|
86
|
-
groupKeys: [],
|
|
87
|
-
groupProps: {},
|
|
88
|
-
lookupTables: [],
|
|
89
|
-
hook: function (record, type, meta) {
|
|
90
|
-
// user hook: segment users into tiers based on their lucky number
|
|
91
|
-
if (type === "user") {
|
|
92
|
-
if (record.luckyNumber > 300) {
|
|
93
|
-
record.tier = "gold";
|
|
94
|
-
} else if (record.luckyNumber > 150) {
|
|
95
|
-
record.tier = "silver";
|
|
96
|
-
} else {
|
|
97
|
-
record.tier = "bronze";
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// event hook: gold tier users get a "premium" color override 20% of the time
|
|
102
|
-
if (type === "event") {
|
|
103
|
-
if (record.color === "violet" || record.color === "indigo") {
|
|
104
|
-
record.is_rare_color = true;
|
|
105
|
-
record.number = (record.number || 0) * 2;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// everything hook: users with many events get a bonus "milestone" event
|
|
110
|
-
if (type === "everything") {
|
|
111
|
-
if (record.length > 50) {
|
|
112
|
-
const lastEvent = record[record.length - 1];
|
|
113
|
-
record.push({
|
|
114
|
-
event: "milestone reached",
|
|
115
|
-
time: lastEvent.time,
|
|
116
|
-
user_id: lastEvent.user_id,
|
|
117
|
-
milestone: record.length,
|
|
118
|
-
color: "gold",
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
return record;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return record;
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
export default config;
|
package/dungeons/anon.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
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
|
-
const 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 } from "../lib/utils/utils.js";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/** @type {import('../types').Dungeon} */
|
|
22
|
-
const config = {
|
|
23
|
-
token: "",
|
|
24
|
-
seed: "foo bar",
|
|
25
|
-
numDays: 365, //how many days worth of data
|
|
26
|
-
numEvents: 100000, //how many events
|
|
27
|
-
numUsers: 10000, //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: false, //if true, hasSessionIds are created for each user
|
|
32
|
-
isAnonymous: true,
|
|
33
|
-
hasLocation: true,
|
|
34
|
-
events: [
|
|
35
|
-
{
|
|
36
|
-
event: "foo",
|
|
37
|
-
weight: 10,
|
|
38
|
-
properties: {}
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
event: "bar",
|
|
42
|
-
weight: 9,
|
|
43
|
-
properties: {}
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
event: "baz",
|
|
47
|
-
weight: 8,
|
|
48
|
-
properties: {}
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
event: "qux",
|
|
52
|
-
weight: 7,
|
|
53
|
-
properties: {}
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
event: "garply",
|
|
57
|
-
weight: 6,
|
|
58
|
-
properties: {}
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
event: "durtle",
|
|
62
|
-
weight: 5,
|
|
63
|
-
properties: {}
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
event: "linny",
|
|
67
|
-
weight: 4,
|
|
68
|
-
properties: {}
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
event: "fonk",
|
|
72
|
-
weight: 3,
|
|
73
|
-
properties: {}
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
event: "crumn",
|
|
77
|
-
weight: 2,
|
|
78
|
-
properties: {}
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
event: "yak",
|
|
82
|
-
weight: 1,
|
|
83
|
-
properties: {}
|
|
84
|
-
}
|
|
85
|
-
],
|
|
86
|
-
superProps: {},
|
|
87
|
-
userProps: {
|
|
88
|
-
title: chance.profession.bind(chance),
|
|
89
|
-
luckyNumber: weighNumRange(42, 420),
|
|
90
|
-
spiritAnimal: ["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"]
|
|
91
|
-
},
|
|
92
|
-
scdProps: {},
|
|
93
|
-
mirrorProps: {},
|
|
94
|
-
groupKeys: [],
|
|
95
|
-
groupProps: {},
|
|
96
|
-
lookupTables: [],
|
|
97
|
-
hook: function (record, type, meta) {
|
|
98
|
-
// user hook: assign engagement tier based on lucky number
|
|
99
|
-
if (type === "user") {
|
|
100
|
-
record.engagement_tier = record.luckyNumber > 250 ? "high" : "low";
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// event hook: weight-1 events ("yak") are treated as error/rare signals
|
|
104
|
-
if (type === "event") {
|
|
105
|
-
if (record.event === "yak") {
|
|
106
|
-
record.is_error = true;
|
|
107
|
-
}
|
|
108
|
-
if (record.event === "foo") {
|
|
109
|
-
record.priority = "high";
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// everything hook: low-activity anonymous users churn — keep only first 60% of events
|
|
114
|
-
if (type === "everything") {
|
|
115
|
-
if (record.length < 8) {
|
|
116
|
-
const cutoff = Math.ceil(record.length * 0.6);
|
|
117
|
-
return record.slice(0, cutoff);
|
|
118
|
-
}
|
|
119
|
-
return record;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
return record;
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
export default config;
|
|
@@ -1,240 +0,0 @@
|
|
|
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: "",
|
|
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
|
-
hasLocation: true,
|
|
124
|
-
hasAndroidDevices: true,
|
|
125
|
-
hasIOSDevices: true,
|
|
126
|
-
hasDesktopDevices: true,
|
|
127
|
-
hasBrowser: true,
|
|
128
|
-
hasCampaigns: true,
|
|
129
|
-
isAnonymous: false,
|
|
130
|
-
alsoInferFunnels: true,
|
|
131
|
-
// concurrency automatically set to 1 when strictEventCount is enabled
|
|
132
|
-
writeToDisk: false,
|
|
133
|
-
batchSize: 2_500_000,
|
|
134
|
-
|
|
135
|
-
events: [
|
|
136
|
-
{
|
|
137
|
-
event: "Page View",
|
|
138
|
-
weight: 50,
|
|
139
|
-
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
event: "Product View",
|
|
143
|
-
weight: 30,
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
event: "Add to Cart",
|
|
147
|
-
weight: 10,
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
event: "Checkout Started",
|
|
151
|
-
weight: 5,
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
event: "Purchase",
|
|
155
|
-
weight: 1,
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
event: "Product Review",
|
|
159
|
-
weight: 3,
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
event: "Search",
|
|
163
|
-
weight: 17,
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
event: "Browse",
|
|
167
|
-
weight: 25,
|
|
168
|
-
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
event: "Save for Later",
|
|
172
|
-
weight: 4,
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
event: "Remove from Cart",
|
|
176
|
-
weight: 2,
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
event: "Empty Cart",
|
|
180
|
-
weight: 4,
|
|
181
|
-
}
|
|
182
|
-
],
|
|
183
|
-
funnels: [
|
|
184
|
-
{
|
|
185
|
-
"name": "Purchase Funnel",
|
|
186
|
-
"sequence": [
|
|
187
|
-
"Page View",
|
|
188
|
-
"Product View",
|
|
189
|
-
"Add to Cart",
|
|
190
|
-
"Checkout Started",
|
|
191
|
-
"Purchase"
|
|
192
|
-
],
|
|
193
|
-
requireRepeats: true,
|
|
194
|
-
"conversionRate": 30,
|
|
195
|
-
"order": "fixed",
|
|
196
|
-
"weight": 1,
|
|
197
|
-
"isFirstFunnel": false,
|
|
198
|
-
"timeToConvert": 5,
|
|
199
|
-
"experiment": true,
|
|
200
|
-
}
|
|
201
|
-
],
|
|
202
|
-
superProps: {
|
|
203
|
-
"theme (string)": pickAWinner(["light", "dark", "custom", "light", "dark"]),
|
|
204
|
-
"latency (number)": weighNumRange(20, 600, 0.7),
|
|
205
|
-
"beta user (boolean)": [true, false, false, false],
|
|
206
|
-
"birthdate (date)": date(30000, true, 'YYYY-MM-DD'),
|
|
207
|
-
"features (list)": buildListOfFeatures,
|
|
208
|
-
"config (object)": buildLocalConfig,
|
|
209
|
-
"cart (array of objects)": buildCart,
|
|
210
|
-
"comment (text)": commentGenerator,
|
|
211
|
-
},
|
|
212
|
-
/*
|
|
213
|
-
user properties work the same as event properties
|
|
214
|
-
each key should be an array or function reference
|
|
215
|
-
*/
|
|
216
|
-
userProps: {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
},
|
|
220
|
-
scdProps: {},
|
|
221
|
-
mirrorProps: {},
|
|
222
|
-
|
|
223
|
-
/*
|
|
224
|
-
for group analytics keys, we need an array of arrays [[],[],[]]
|
|
225
|
-
each pair represents a group_key and the number of profiles for that key
|
|
226
|
-
*/
|
|
227
|
-
groupKeys: [],
|
|
228
|
-
groupProps: {},
|
|
229
|
-
lookupTables: [],
|
|
230
|
-
hook: function (record, type, meta) {
|
|
231
|
-
// if (type === "everything") {
|
|
232
|
-
// debugger;
|
|
233
|
-
// }
|
|
234
|
-
return record;
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
export default config;
|
|
@@ -1,140 +0,0 @@
|
|
|
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: "",
|
|
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
|
-
hasLocation: false,
|
|
35
|
-
hasAndroidDevices: false,
|
|
36
|
-
hasIOSDevices: false,
|
|
37
|
-
hasDesktopDevices: false,
|
|
38
|
-
hasBrowser: false,
|
|
39
|
-
hasCampaigns: false,
|
|
40
|
-
isAnonymous: false,
|
|
41
|
-
alsoInferFunnels: true,
|
|
42
|
-
// concurrency automatically set to 1 when strictEventCount is enabled
|
|
43
|
-
writeToDisk: false,
|
|
44
|
-
batchSize: 12_500_000,
|
|
45
|
-
|
|
46
|
-
events: [
|
|
47
|
-
{
|
|
48
|
-
event: "Page View",
|
|
49
|
-
weight: 50,
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
event: "Product View",
|
|
54
|
-
weight: 30,
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
event: "Add to Cart",
|
|
58
|
-
weight: 10,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
event: "Checkout Started",
|
|
62
|
-
weight: 5,
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
event: "Purchase",
|
|
66
|
-
weight: 1,
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
event: "Product Review",
|
|
70
|
-
weight: 3,
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
event: "Search",
|
|
74
|
-
weight: 17,
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
event: "Browse",
|
|
78
|
-
weight: 25,
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
event: "Save for Later",
|
|
83
|
-
weight: 4,
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
event: "Remove from Cart",
|
|
87
|
-
weight: 2,
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
event: "Empty Cart",
|
|
91
|
-
weight: 4,
|
|
92
|
-
}
|
|
93
|
-
],
|
|
94
|
-
funnels: [
|
|
95
|
-
{
|
|
96
|
-
"name": "Purchase Funnel",
|
|
97
|
-
"sequence": [
|
|
98
|
-
"Page View",
|
|
99
|
-
"Product View",
|
|
100
|
-
"Add to Cart",
|
|
101
|
-
"Checkout Started",
|
|
102
|
-
"Purchase"
|
|
103
|
-
],
|
|
104
|
-
requireRepeats: true,
|
|
105
|
-
"conversionRate": 30,
|
|
106
|
-
"order": "fixed",
|
|
107
|
-
"weight": 1,
|
|
108
|
-
"isFirstFunnel": false,
|
|
109
|
-
"timeToConvert": 5,
|
|
110
|
-
"experiment": true,
|
|
111
|
-
}
|
|
112
|
-
],
|
|
113
|
-
superProps: {
|
|
114
|
-
},
|
|
115
|
-
/*
|
|
116
|
-
user properties work the same as event properties
|
|
117
|
-
each key should be an array or function reference
|
|
118
|
-
*/
|
|
119
|
-
userProps: {},
|
|
120
|
-
scdProps: {},
|
|
121
|
-
mirrorProps: {},
|
|
122
|
-
|
|
123
|
-
/*
|
|
124
|
-
for group analytics keys, we need an array of arrays [[],[],[]]
|
|
125
|
-
each pair represents a group_key and the number of profiles for that key
|
|
126
|
-
*/
|
|
127
|
-
groupKeys: [],
|
|
128
|
-
groupProps: {},
|
|
129
|
-
lookupTables: [],
|
|
130
|
-
hook: function (record, type, meta) {
|
|
131
|
-
// if (type === "everything") {
|
|
132
|
-
// debugger;
|
|
133
|
-
// }
|
|
134
|
-
return record;
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
export default config;
|