質問

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.

役に立ちましたか?

解決

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 strong-cli@2.5.1 with strong-agent@0.3.2 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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top