Performance testing
diff --git a/src/utils/database.ts b/src/utils/database.ts
index b14c5c4..ba1d89d 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -149,6 +149,33 @@
}
}
+export class PerformanceTest {
+ performanceData: Collection<PerformanceDataSchema>;
+
+ constructor() {
+ this.performanceData = database.collection<PerformanceDataSchema>("performance");
+ }
+
+ async record(data: PerformanceDataSchema) {
+ data.timestamp = new Date();
+ await this.performanceData.insertOne(data);
+ }
+ async read() {
+ return await this.performanceData.find({}).toArray();
+ }
+}
+
+export interface PerformanceDataSchema {
+ timestamp?: Date;
+ discord: number;
+ databaseRead: number;
+ resources: {
+ cpu: number;
+ memory: number;
+ temperature: number;
+ }
+}
+
export class ModNotes {
modNotes: Collection<ModNoteSchema>;
@@ -205,7 +232,11 @@
};
invite: {
enabled: boolean;
- channels: string[];
+ allowed: {
+ channels: string[];
+ roles: string[];
+ users: string[];
+ };
};
pings: {
mass: number;