레이턴시플러그인

구성된 범위에서 난수(밀리초)로 응답을 지연합니다. HTTP 요청과 STDIO 통신을 모두 지원합니다.

API 요청에 대한 대기 시간을 시뮬레이션하는 개발자 프록시를 .

구성 예제

{
  "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v4.0.0/rc.schema.json",
  "plugins": [
    {
      "name": "LatencyPlugin",
      "enabled": true,
      "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
      "configSection": "latencyPlugin"
    }
  ],
  "latencyPlugin": {
    "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v4.0.0/latencyplugin.schema.json",
    "minMs": 200,
    "maxMs": 10000
  }
}

구성 속성

재산 묘사 기본값
minMs 요청에 추가된 최소 지연 시간(밀리초)입니다. 보다 작거나 같아야 합니다 maxMs. 0
maxMs 요청에 추가된 최대 지연 시간(밀리초)입니다. 5,000

명령줄 옵션

없음

설명

개발자 프록시는 시작할 때 플러그 인의 구성의 유효성을 검사합니다. 보다 maxMs큰 경우 minMs 개발자 프록시가 시작되지 않고 오류가 표시됩니다. 예를 들면 다음과 같습니다.

LatencyPlugin: minMs (500) must be less than or equal to maxMs (100).

고정 지연을 추가하려면 동일한 값으로 설정합니다 minMsmaxMs .

STDIO 지원

명령과 LatencyPlugin 함께 stdio사용하는 경우 플러그 인은 stdout 응답에 인위적인 대기 시간을 추가합니다. 대기 시간 시뮬레이션은 애플리케이션이 느린 MCP(모델 컨텍스트 프로토콜) 서버 응답 또는 기타 STDIO 기반 도구를 처리하는 방법을 테스트하는 데 유용합니다.

STDIO에 대한 구성 예제

{
  "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v4.0.0/rc.schema.json",
  "plugins": [
    {
      "name": "LatencyPlugin",
      "enabled": true,
      "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
      "configSection": "latencyPlugin"
    },
    {
      "name": "MockStdioResponsePlugin",
      "enabled": true,
      "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
      "configSection": "mockStdioResponsePlugin"
    }
  ],
  "latencyPlugin": {
    "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v4.0.0/latencyplugin.schema.json",
    "minMs": 100,
    "maxMs": 500
  },
  "mockStdioResponsePlugin": {
    "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v4.0.0/mockstdioresponseplugin.schema.json",
    "mocksFile": "stdio-mocks.json"
  }
}

다음을 실행합니다.

devproxy stdio npx -y @modelcontextprotocol/server-filesystem

다음 단계