Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Feature] Add sampleType to SampleResult

未关闭
#6,762 3 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
52/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
java

调研方向

首先阅读 SampleResult API 和 TransactionController.isFromTransactionController 入口点,然后跟踪 listener、后端 listener、plugin 以及其他消费者如何识别结果类型。当 SampleResult 暴露一个明确的 SAMPLE 或 TRANSACTION 类型,并且在 Transaction Controller 的 responseMessage 被自定义时仍然可靠,即视为完成。

由索引模型根据 Issue 内容生成。

描述

enhancement to-triage
Use case

There is currently no explicit/documented field in SampleResult that identifies the type of result, such as SAMPLE or TRANSACTION.

The current workaround is to use:

TransactionController.isFromTransactionController(sampleResult)

However, this approach is fragile because transaction detection depends on other SampleResult fields. In particular, it can break when a user redefines the responseMessage of the Transaction Controller with a custom value.

This behavior is also not documented, so users have no way to know that redefining the Transaction Controller's responseMessage can silently break transaction detection.

Possible solution

Add an explicit sampleType field to SampleResult, for example:

public enum SampleType {
    SAMPLE,
    TRANSACTION
}

Then consumers could use:

sampleResult.getSampleType() == SampleType.TRANSACTION

This would provide a reliable way for listeners, backend listeners, plugins, and other consumers to identify the type of a SampleResult.

Possible workarounds

No response

JMeter Version

5.6.3

Java Version

java 17.0.7

OS Version

No response

主要语言
Java
星标
9.6k
派生
2.3k
平均合并
18 小时 33 分钟
30 天内合并 PR
12

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/jmeter 的其他 Issue

查看 apache/jmeter 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。