如何将提取的数据写入 Gatling 中的文件 [英] How to write Extracted Data in to A File In Gatling

查看:59
本文介绍了如何将提取的数据写入 Gatling 中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Gatling 进行负载测试.当我创建客户资料时,将生成客户 ID.我能够提取客户 ID 并保存到会话变量中.

I am using Gatling for load testing. When I am creating Customer profiles , Customer IDs will be generated. I am able to extract the customer ID and saving in to session variables.

但是如何将这些值存储到文本文件中.

But How to store these values in to a Text file.

请帮帮我.

推荐答案

有几种方法可以实现这一点.

There's several ways to achieve that.

如果您熟悉 Scala,您可以:

If you're familiar with Scala, you can:

如果这对你来说太复杂了,最简单的方法是使用 logback:

If this is too complex for you, the most simple way is to use logback:

  • 在您的模拟中使用特殊名称声明一个记录器
  • 配置 logback 以便此记录器在专用的 FileAppender 中输出
  • 使用只记录消息的模式

关于第二种解决方案,请查看 logback 文档:http://logback.qos.ch/documentation.html

Regarding the second solution, check the logback documentation: http://logback.qos.ch/documentation.html

这篇关于如何将提取的数据写入 Gatling 中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆