Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor app with StrongLoop [closed]

Have you successfully instrumented a Meteor app with StrongOps and tried the CPU profiling feature.

Using Meteor.require("strong-agent").profile()

instead of

require("strong-agent").profile();.

works for everything else except the profiling features.

like image 464
snathan Avatar asked Feb 13 '23 03:02

snathan


1 Answers

Plain "require()" does not work with Meteor as it does with Node.js. Meteor itself provides "Npm.require()" for use in Meteor smart packages. "Meteor.require()" is used when one has installed the meteor-npm npm module for integrating npm modules with Meteor. A good reference can be found at http://meteorpedia.com/read/npm

I have integrated the StrongOps agent with my Meteor app by creating a Meteor smart package and using Npm.require() within the package. The operative package code is as follows:

// require strong-agent
StrongOps = function (key, appName) {
  Npm.require('strong-agent').profile(key, appName);
};

// initialize the agent
StrongOps('myKeyHere', 'myAppNameHere');

With this simple package I have access to CPU and Heap profiles as well as Dashboard charts for CPU Usage, Heap Size, and Event Loop. I'm not using Strong MQ, so no Messages to see. Notably, I don't see any MongoDB-related data ... yet. All this is based on [email protected] with [email protected] on a Ubuntu 12.04.4 LTS server.

For any other Meteor/StrongOps folks who might be interested, the package can be found here https://github.com/dgtlife/dgtlife-strongops and here https://atmospherejs.com/package/dgtlife-strongops

like image 105
dgtlife Avatar answered Feb 25 '23 14:02

dgtlife