Skip to content

Commit

Permalink
Updates to make mirage numbers more realistic
Browse files Browse the repository at this point in the history
  • Loading branch information
bp-cos committed Sep 20, 2024
1 parent 8052f7f commit ac605ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 30 deletions.
18 changes: 9 additions & 9 deletions mirage/factories/institution-summary-metric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@ export default Factory.extend<InstitutionSummaryMetricModel>({
return faker.random.number({ min: 10, max: 100 });
},
userCount() {
return faker.random.number({ min: 100, max: 1000 });
return faker.random.number({ min: 10, max: 50});
},
publicRegistrationCount() {
return faker.random.number({ min: 100, max: 1000 });
},
preprintCount() {
return faker.random.number({ min: 100, max: 1000 });
},
embargoedRegistrationCount() {
return faker.random.number({ min: 100, max: 1000 });
return faker.random.number({ min: 0, max: 25});
},
preprintCount() {
return faker.random.number({ min: 15, max: 175});
},
storageByteCount() {
return faker.random.number({ min: 100, max: 1000 });
return faker.random.number({ min: 1000 * 100, max: 1000 * 1000 * 100 });
},
publicFileCount() {
return faker.random.number({ min: 100, max: 1000 });
return faker.random.number({ min: 15, max: 1000 });
},
monthlyActiveUserCount() {
return faker.random.number({ min: 100, max: 1000 });
return faker.random.number({ min: 10, max: 100 * 10 });
},
monthlyLoggedInUserCount() {
return faker.random.number({ min: 100, max: 1000 });
return faker.random.number({ min: 10, max: 100 * 100 });
},
});

Expand Down
21 changes: 0 additions & 21 deletions mirage/factories/institution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,8 @@ export default Factory.extend<Institution & InstitutionTraits>({
const departmentMetrics = departmentNames.map(name =>
server.create('institution-department', { name }));

const userCount = userMetrics.length;
let publicProjectCount = 0;
let privateProjectCount = 0;
userMetrics.forEach(({ publicProjects, privateProjects }) => {
publicProjectCount += publicProjects;
privateProjectCount += privateProjects;
});

const summaryMetrics = server.create('institution-summary-metric', { id: institution.id });

summaryMetrics.update({
publicProjectCount,
privateProjectCount,
userCount,
publicRegistrationCount: 1250,
preprintCount: 11250,
embargoedRegistrationCount: 456,
storageByteCount: 47382032,
publicFileCount: 87,
monthlyLoggedInUserCount: 24563,
monthlyActiveUserCount:456,
});

institution.update({ userMetrics, departmentMetrics, summaryMetrics });
},
}),
Expand Down

0 comments on commit ac605ac

Please sign in to comment.