gpt4 book ai didi

带有 StrongLoop 的 Meteor 应用程序

转载 作者:行者123 更新时间:2023-12-04 23:21:55 24 4
gpt4 key购买 nike

关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。












想改进这个问题?将问题更新为 on-topic对于堆栈溢出。

7年前关闭。




Improve this question




您是否已成功使用 StrongOps 检测 Meteor 应用程序并尝试了 CPU 分析功能。

使用
Meteor.require("strong-agent").profile()

代替

要求(“强代理”).profile();。

适用于除分析功能之外的所有其他内容。

最佳答案

普通的“require()”不适用于 Meteor,就像它在 Node.js 中一样。 Meteor 本身提供了“Npm.require()”用于 Meteor 智能包。 “Meteor.require()” 在安装了meteor-npm npm 模块以将npm 模块与Meteor 集成时使用。可以在 http://meteorpedia.com/read/npm 找到一个很好的引用。

我通过创建 Meteor 智能包并在包中使用 Npm.require() 将 StrongOps 代理与我的 Meteor 应用程序集成。运行包代码如下:

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

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

通过这个简单的包,我可以访问 CPU 和堆配置文件以及用于 CPU 使用、堆大小和事件循环的仪表板图表。我没有使用强 MQ,所以没有消息可看。值得注意的是,我还没有看到任何与 MongoDB 相关的数据。所有这些都基于 Ubuntu 12.04.4 LTS 服务器上的 strong-cli@2.5.1 和 strong-agent@0.3.2。

对于任何其他可能感兴趣的 Meteor/StrongOps 人员,可以在此处找到该软件包 https://github.com/dgtlife/dgtlife-strongops在这里 https://atmospherejs.com/package/dgtlife-strongops

关于带有 StrongLoop 的 Meteor 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23235590/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com