meteor-perf

v0.0.2Published yesterday

:construction: Work in progress! :construction:

Real-time performance optimization for Meteor apps.

Goal: Help detect oplog flooding and event loop blocking issues in Meteor apps, eventually providing easy to understand diagnostic messages users can act upon.

Installation

meteor add meteor-perf

Usage

Right now it will output a file called meteor-perf.json in the root of your project as your app is running.

This file can be inspected in any code editor that supports JSON.

The object contains the following keys;

bytes_sent:

The amount of data sent from the server to the client in bytes.

async_traces:

An array of objects containing traces for async resources that were created during Event Loop Lag, along with execution count.

observer_stats:

An array of objects containing stat objects for Observer Handles, the number of operations they performed, and a key to identify them. The key is composed of the collection and the selector separated by ::.

It groups the stats by selector, so you can see how many operations were performed on a specific query.

Example:

1{
2  "bytes_sent": 2661331,
3  "async_traces": [
4    {
5      "count": 60,
6      "types": [
7        "PROMISE"
8      ],
9      "stack": "    at Publication._getCursor (packages/reywood:publish-composite/lib/publication.js:95:36)\n    at Publication.publish (packages/reywood:publish-composite/lib/publication.js:26:30)\n    at packages/reywood:publish-composite/lib/publication.js:110:17\n    at Array.map (<anonymous>)\n    at Publication._publishChildrenOf (packages/reywood:publish-composite/lib/publication.js:106:32)\n    at Publication._handleAddedAsync (packages/reywood:publish-composite/lib/publication.js:77:18)\n    at packages/reywood:publish-composite/lib/publication.js:38:16\n    at new Promise (<anonymous>)\n    at packages/reywood:publish-composite/lib/publication.js:36:30\n    at packages/meteor.js:1399:24"
10    }
11  ],
12  "observer_stats": [
13    {
14      "key": "child::{\"parentId\":\"MBLMPnnYYCu3RC99p\"}",
15      "added": 5600,
16      "changed": 3234,
17      "removed": 0,
18      "started": 56,
19      "stopped": 42,
20      "lagging_added": 0,
21      "lagging_changed": 0,
22      "lagging_removed": 0,
23      "score": 14854
24    }
25  ]
26}

Downloading the stat file

You can call the following HTTP endpoint to download the stat file:

GET /meteor-perf.json

License

MIT