You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Jmeter HTTP Simple Server插件UNIQUE参数失效问题咨询

Troubleshooting the UNIQUE Parameter in the STS ADD API & Source Code Access

Let’s walk through this step by step—your observation that the LENGTH count matches the number of ADD calls is a clear red flag that the UNIQUE=TRUE constraint isn’t behaving as expected. First, let’s rule out common usage mistakes before diving into code fixes.

Common UNIQUE Parameter Pitfalls to Check

  • Verify the uniqueness identifier is correct
    The LINE value you’re passing (7ddb876ac39c485a) should be the key the API uses to check for duplicates. Double-check:

    • Are you using the exact same LINE value in every ADD call? If you are but still seeing the count climb, that’s a sign the check isn’t working.
    • Could there be hidden whitespace, case sensitivity, or encoding differences in the LINE string? For example, some APIs treat uppercase and lowercase strings as distinct, or might not trim leading/trailing spaces automatically. Try sanitizing the LINE value before sending (e.g., trimming whitespace, forcing consistent case) and test again.
  • Check if ADD_MODE=FIRST conflicts with UNIQUE=TRUE
    The ADD_MODE=FIRST setting tells the API to insert lines at the start of the file instead of the end—but it’s possible the implementation skips the uniqueness check when using this mode. Test with ADD_MODE=LAST (or omit the parameter to use the default) to see if the UNIQUE constraint kicks in. If it works with the default mode, the bug is likely in how FIRST mode interacts with uniqueness checks.

  • Confirm you’re targeting the same file every time
    Ensure every ADD call uses the exact file path /tmp/newEventsFlag.csv. A tiny typo (e.g., /tmp/neweventsflag.csv with lowercase) or path resolution quirk (like relative vs absolute paths) could mean you’re writing to multiple files without noticing. You can also manually inspect /tmp/newEventsFlag.csv directly to see if duplicate lines are actually present—maybe the LENGTH endpoint counts total requests instead of actual unique lines in the file?

If UNIQUE Is Definitely Broken: Source Code Access & Fixes

If you’ve eliminated all usage errors and confirmed the parameter is failing, accessing the source code is the way to resolve this. Here’s how to approach it:

  • Get the source code
    Since this is running on localhost, it’s almost certainly an internal tool or custom service. Reach out to the team or developer who built/maintains the STS API—they should be able to share the source code, or help debug the issue directly.
  • What to debug in the code
    Once you have the source, find the handler for the /sts/ADD endpoint and look for the UNIQUE parameter logic. Specifically:
    1. Is the UNIQUE parameter being parsed correctly? For example, is "TRUE" being converted to a boolean true, or is the code treating it as a string (which might fail equality checks)?
    2. Does the code actually read the existing file and check for the presence of the LINE value before adding it? If there’s no file read step for the uniqueness check, that’s the problem.
    3. Is the uniqueness check using the full LINE value, or only a portion of it?
    4. When ADD_MODE=FIRST is set, is the uniqueness check skipped entirely (a common oversight in conditional logic)?

内容的提问来源于stack exchange,提问作者user1946337

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 08:15:16