Sha256: 26f36eb1b6cf4a246fdee70c197ae12475401e307e4d7c8c68bf6a97975e279b
Contents?: true
Size: 1.33 KB
Versions: 21
Compression:
Stored size: 1.33 KB
Contents
/* eslint-disable class-methods-use-this */ const { analyzeQuery } = require('../../database'); const EventTree = require('./eventTree'); /** * At INFO level, the order of labeled function calls matters. SQL query strings * are collected, sorted and made unique. */ class Canonicalize extends EventTree { sql(event) { return { kind: 'sql', sql: { analyzed_query: analyzeQuery(event.sql), }, }; } httpClientRequest(event) { return { kind: 'http_client_request', route: event.route, parameter_names: event.message ? event.message.map((m) => m.name) : null, status_code: event.httpClientResponse ? event.httpClientResponse.status_code : null, }; } httpServerRequest(event) { return { kind: 'http_server_request', route: event.route, parameter_names: event.message ? event.message.map((m) => m.name) : null, status_code: event.httpServerResponse ? event.httpServerResponse.status || event.httpServerResponse.status_code : null, }; } functionCall(event) { const labels = this.whitelistedLabels(event.codeObject.labels); if (labels.length === 0) { return null; } return { kind: 'function', labels, }; } } module.exports = (appmap) => new Canonicalize(appmap).execute();
Version data entries
21 entries across 21 versions & 1 rubygems