From 031c65cb0902cef504ebf22cf56264137f6e1869 Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Thu, 21 Jul 2022 16:28:41 +1000 Subject: [PATCH] Added simple response time measurement for grafana --- slowcord/{login => }/README.md | 0 slowcord/login/package.json | 6 +- slowcord/status/.env.template | 6 ++ slowcord/status/package-lock.json | Bin 0 -> 33113 bytes slowcord/status/package.json | 30 +++++++++ slowcord/status/src/index.ts | 91 +++++++++++++++++++++++++++ slowcord/status/tsconfig.json | 99 ++++++++++++++++++++++++++++++ 7 files changed, 229 insertions(+), 3 deletions(-) rename slowcord/{login => }/README.md (100%) create mode 100644 slowcord/status/.env.template create mode 100644 slowcord/status/package-lock.json create mode 100644 slowcord/status/package.json create mode 100644 slowcord/status/src/index.ts create mode 100644 slowcord/status/tsconfig.json diff --git a/slowcord/login/README.md b/slowcord/README.md similarity index 100% rename from slowcord/login/README.md rename to slowcord/README.md diff --git a/slowcord/login/package.json b/slowcord/login/package.json index 9ee62b2c..b458a875 100644 --- a/slowcord/login/package.json +++ b/slowcord/login/package.json @@ -1,7 +1,7 @@ { - "name": "slowcord", + "name": "slowcord-login", "version": "1.0.0", - "description": "Slowcord additional services", + "description": "Slowcord login service", "main": "build/index.js", "scripts": { "build": "tsc -b", @@ -11,7 +11,7 @@ "type": "git", "url": "git+https://github.com/maddyunderstars/fosscord-server.git" }, - "author": "", + "author": "MaddyUnderStars", "license": "AGPL-3.0-only", "bugs": { "url": "https://github.com/maddyunderstars/fosscord-server/issues" diff --git a/slowcord/status/.env.template b/slowcord/status/.env.template new file mode 100644 index 00000000..e15dc56a --- /dev/null +++ b/slowcord/status/.env.template @@ -0,0 +1,6 @@ +DATABASE= +INSTANCE_API= +INSTANCE_CDN= +INSTANCE_TOKEN= +MEASURE_INTERVAL=1000 +RETENTION_DAYS=30 \ No newline at end of file diff --git a/slowcord/status/package-lock.json b/slowcord/status/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..a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+E3KbrNqJ38L)xTL+vlZ*2Ze^D#Rjnt zGnjwgCGsrI6ZN`CBwW#eE-_8Fo9*m8xlD=st9kj|Zh0u3H_v%#4)}|=z_awaiNe83 zOH`h}C0O3NO~x+%&P(4}vZa=OLpg&2b1!E%jy6ND)JD>)B9;II(v|!HqLF|2j(3(q z>6uSRqWt~tIBL5kXogx5eLvMTN%MF=85+C$9&mOc^GbzuY3lc0HqNR;?8jhm2sZIyIVp4%k7gLsKMIZNtsJG6 zgu{yIOLgBE=8bc`TND03j=pwLIK&}a^^KRwLdvBgV<37TtP02V;E=fKZ{<)iweR&h z6|+ORA(*F{_?4T$Sxvm(&CORtIIsPwC?r!e1EQ3<_EP@;WqZJ}<4rmndC31>%dlCi zlkNCl%umd7@c-k9E41M~Sd{+6B5X|Pw3=oDz?9a$ngqn~fN;g1L!o-MZU6QAq<6`F z2HliNc@^C>Na*2H$Ho03E2QyeXPzR#RhdtoR}sU5=>B3`qrdf{XlhR&Be|)yfmbE> z3J$RG`tcXp4ZW^CWU%~A)=V%14++bydMM39h><2 zUCx^si46L`*ZO8Q-uW-DZvKwjnrSj6ZNa2+nURv8Xj5nNp%6%t59O-ES1&34@wY$z EFSGv(RsaA1 literal 0 HcmV?d00001 diff --git a/slowcord/status/package.json b/slowcord/status/package.json new file mode 100644 index 00000000..c6af6f65 --- /dev/null +++ b/slowcord/status/package.json @@ -0,0 +1,30 @@ +{ + "name": "slowcord-status", + "version": "1.0.0", + "description": "Slowcord status service", + "main": "build/index.js", + "scripts": { + "build": "tsc -b", + "start": "node build/index.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/maddyunderstars/fosscord-server.git" + }, + "bugs": { + "url": "https://github.com/maddyunderstars/fosscord-server/issues" + }, + "homepage": "https://github.com/maddyunderstars/fosscord-server#readme", + "author": "MaddyUnderStars", + "license": "AGPL-3.0-only", + "devDependencies": { + "@types/node": "^18.0.6" + }, + "dependencies": { + "dotenv": "^16.0.1", + "fosscord-gopnik": "^1.0.0", + "mysql2": "^2.3.3", + "node-fetch": "^3.2.9" + }, + "type": "module" +} diff --git a/slowcord/status/src/index.ts b/slowcord/status/src/index.ts new file mode 100644 index 00000000..a4d911ad --- /dev/null +++ b/slowcord/status/src/index.ts @@ -0,0 +1,91 @@ +import "dotenv/config"; +import fetch from "node-fetch"; +import Fosscord from "fosscord-gopnik"; +import mysql from "mysql2"; + +const dbConn = mysql.createConnection(process.env.DATABASE as string); +const executePromise = (sql: string, args: any[]) => new Promise((resolve, reject) => dbConn.execute(sql, args, (err, res) => { if (err) reject(err); else resolve(res); })); + +const instance = { + api: process.env.INSTANCE_API as string, + cdn: process.env.INSTANCE_CDN as string, + token: process.env.INSTANCE_TOKEN as string, +}; + +const client = new Fosscord.Client({ + intents: [], + http: { + api: instance.api, + cdn: instance.cdn + } +}); + +client.on("ready", () => { + console.log(`Ready on gateway as ${client.user!.tag}`); + + const gatewayMeasure = async (name: string) => { + const time = Math.max(client.ws.ping, 0); + await savePerf(time, name, null); + console.log(`${name} took ${time}ms`); + setTimeout(gatewayMeasure, parseInt(process.env.MEASURE_INTERVAL as string), name); + }; + + gatewayMeasure("websocketPing") +}); + +client.on("error", (error) => { + console.log(`Gateway error`, error); +}); + +client.on("warn", (msg) => { + console.log(`Gateway warning:`, msg); +}); + +const savePerf = async (time: number, name: string, error: string | null) => { + try { + await executePromise("INSERT INTO performance (value, endpoint, timestamp, error) VALUES (?, ?, ?, ?)", [time, name, new Date(), error]); + await executePromise("DELETE FROM performance WHERE DATE(timestamp) < now() - interval ? DAY", [process.env.RETENTION_DAYS]); + } + catch (e) { + console.error(e); + } +}; + +const measureApi = async (name: string, path: string, body?: object) => { + const start = Date.now(); + + let error: Error | null = null; + try { + const res = await fetch(path, { + headers: { + "Content-Type": "application/json", + "Authorization": instance.token, + }, + body: body ? JSON.stringify(body) : undefined, + }); + await res.json(); + } + catch (e) { + error = e as Error; + } + + const time = Date.now() - start; + console.log(`${name} took ${time}ms ${(error ? "with error" : "")}`, error ?? ""); + + await savePerf(time, name, error?.message ?? null); + + setTimeout(measureApi, parseInt(process.env.MEASURE_INTERVAL as string), name, path, body); +}; + +const app = async () => { + await new Promise((resolve) => dbConn.connect(resolve)); + console.log("Connected to db"); + await client.login(instance.token); + + console.log(`Monitoring performance for instance at ${new URL(instance.api).hostname}`); + + measureApi("ping", `${instance.api}/ping`); + measureApi("users/@me", `${instance.api}/users/@me`); +}; + +app(); \ No newline at end of file diff --git a/slowcord/status/tsconfig.json b/slowcord/status/tsconfig.json new file mode 100644 index 00000000..6d6ec56d --- /dev/null +++ b/slowcord/status/tsconfig.json @@ -0,0 +1,99 @@ +{ + "exclude": [ + "node_modules" + ], + "include": [ + "src/**/*.ts" + ], + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Projects */ + // "incremental": true, /* Enable incremental compilation */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + /* Language and Environment */ + "target": "ES6", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + "lib": ["ES2021"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */ + // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + /* Modules */ + "module": "ES2020", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ + "types": ["node"], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "resolveJsonModule": true, /* Enable importing .json files */ + // "noResolve": true, /* Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project. */ + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */ + "outDir": "./build", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */ + // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */ + "strictPropertyInitialization": false, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */ + // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +} \ No newline at end of file