{
  "repo": "pingcap/tidb-operator",
  "binary": "testing-workload",
  "binary_path": "cmd/testing-workload/main.go",
  "surface_kind": "worker_service",
  "type": "worker_service",
  "services": [
    {
      "name": "TestingWorkloadLifecycle",
      "package": "cmd/testing-workload",
      "methods": [
        {
          "name": "ParseFlagsAndConnect",
          "name_key": "Runtime TestingWorkloadLifecycle.ParseFlagsAndConnect",
          "input": "host, duration, max-connections, sleep-interval, and long-txn-sleep",
          "output": "MySQL connection pool to root@(<host>:4000)/test",
          "type": "local"
        },
        {
          "name": "PrepareSchema",
          "name_key": "Runtime TestingWorkloadLifecycle.PrepareSchema",
          "input": "active MySQL connection",
          "output": "test.e2e_test table created if absent",
          "type": "local"
        },
        {
          "name": "RunConcurrentWorkload",
          "name_key": "Runtime TestingWorkloadLifecycle.RunConcurrentWorkload",
          "input": "connection pool plus timeout-driven worker settings",
          "output": "concurrent transaction workers execute until duration expires",
          "type": "background_worker"
        },
        {
          "name": "ExecuteSimpleTransaction",
          "name_key": "Runtime TestingWorkloadLifecycle.ExecuteSimpleTransaction",
          "input": "connection pool, worker id, and table name",
          "output": "single transaction with REPLACE, UPDATE, optional long sleep, and COMMIT",
          "type": "local"
        }
      ]
    }
  ],
  "extensions": {
    "notes": [
      "This binary is a test load generator against TiDB's MySQL port, not a deployed production service.",
      "Every third worker intentionally turns into a long transaction by sleeping before commit."
    ]
  }
}
