-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
32 lines (23 loc) · 993 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import './observer-monitor'
import { EventLoopMonitor } from './event-loop-monitor';
import { BandwidthMonitor } from './bandwidth-monitor';
import path from 'node:path';
import { saveOutput } from './save-output';
import { registerRoute } from './register-route';
export const ROOT_DIRECTORY = Meteor.isProduction ? process.cwd(): path.resolve(process.cwd().split('.meteor')[0]);
export const MeteorPerf = {
EventLoopMonitor: new EventLoopMonitor(10),
isWebSocketCompressionEnabled: Meteor.server.stream_server.server.options.faye_server_options.extensions.some(ext => ext.name === 'permessage-deflate'),
isUsingRedisOplog: false,
isOplogDisabled: false,
}
registerRoute();
Meteor.startup(() => {
MeteorPerf.isUsingRedisOplog = Package['cultofcoders:redis-oplog'] !== undefined;
MeteorPerf.isOplogDisabled = Package['disable-oplog'] !== undefined;
BandwidthMonitor.enable()
MeteorPerf.EventLoopMonitor.start();
setInterval(() => {
saveOutput();
}, 1000);
})