如何进行单位测试Newrelic GO代理

发布于 2025-02-01 03:19:12 字数 278 浏览 0 评论 0原文

我是Golang和Newrelic的新手。

作为工作的一部分,我将Newrelic GO代理迁移到V3版本。

但是我在以下情况下面临问题。

在进行单元测试时
现有的GO代理 1.我们能够伪造应用程序和伪造新的转移。 2.因此,我们能够计算启动序列的电话数量

,但是使用了新版本的GO代理,

  1. 我无法伪造交易,因此我无法计算起始段
  2. 如何模拟Newrelic GO代理以进行单位测试? 您能帮我帮助我使用Golang测试新事务

I am new to golang and newrelic.

as part of my work i am migrating newrelic go agent to V3 Version.

But I am facing the problem in the below situation.

while doing unit testing
existing go agent
1.we are able to fake application and fake newrelic transcation.
2.so we were able to count the number of calls to StartSegmentNow

but with the new version of the go agent

  1. I am unable to fake the transaction so I can't count on the StartSegment
  2. how to mock the newrelic go agent for unit-testing?
    could you please help me with how can I unit test the newrelic transaction using golang

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文