mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
19 lines
624 B
JavaScript
19 lines
624 B
JavaScript
import { Meteor } from 'meteor/meteor';
|
|
import { Instrumentation } from 'meteor/instrumentation';
|
|
|
|
const { TYPES, createInstrumentationSummary } = require('/server/lib/instrumentationSummary.cjs');
|
|
const summary = createInstrumentationSummary();
|
|
|
|
for (const type of TYPES) {
|
|
Instrumentation.on(type, event => summary.record(event));
|
|
}
|
|
|
|
Meteor.methods({
|
|
async getInstrumentationReport() {
|
|
const user = this.userId && await Meteor.users.findOneAsync(this.userId,
|
|
{ fields: { isAdmin: 1 } });
|
|
if (!user?.isAdmin) throw new Meteor.Error('not-authorized', 'Admin only');
|
|
return summary.snapshot();
|
|
},
|
|
});
|