{"id":"1cef17f5-9461-441c-bba7-3468babb7a3a","chain_id":"8453","contract_job_id":0,"title":"Build a load testing tool in Go that sends HTTP requests and reports latency sta","description":"Write `loadtest.go` (package main) that sends N HTTP GET requests with configurable concurrency and reports latency statistics.\n\n## Usage\n```\ngo run loadtest.go --url URL --requests N [--concurrency C]\n```\n\n## Output (to stdout)\n```\nRequests:    100\nSuccess:     98\nFailed:      2\nMin:         12ms\nMax:         340ms\nAvg:         85ms\nP95:         210ms\n```\n\n## Rules\n- Stdlib only. Default concurrency: 10. Use goroutines + WaitGroup.\n- Count non-2xx responses as failed. Track latency for all attempts.\n- P95: 95th percentile (sort latencies, take index at ceil(0.95 * n) - 1).\n\n## Deliverable\nSingle file `loadtest.go`. Must compile with `go build` (Go 1.21+).","job_type":"code","spec":{"instructions":"Write loadtest.go CLI with --url (required), --requests (required, int), --concurrency (default 10). Send HTTP GET requests using goroutines bounded by concurrency. Record latency per request. Count 2xx as success, others as failed. Compute min/max/avg/p95 (sort+index). Print labeled output in milliseconds. Stdlib only.","success_condition":{"type":"code_test","language":"bash","test_code":"#!/bin/bash\nset -e\n\ntest -f loadtest.go || { echo \"FAIL: loadtest.go not found\"; exit 1; }\ngo build -o loadtest_bin loadtest.go || { echo \"FAIL: build failed\"; exit 1; }\n\n# Start a minimal HTTP server on a random port\npython3 -c \"\nimport http.server, threading, sys, time\n\nclass H(http.server.BaseHTTPRequestHandler):\n    def do_GET(self):\n        time.sleep(0.005)  # 5ms simulated latency\n        self.send_response(200)\n        self.end_headers()\n        self.wfile.write(b'ok')\n    def log_message(self, *a): pass\n\nsrv = http.server.HTTPServer(('127.0.0.1', 18765), H)\nt = threading.Thread(target=srv.serve_forever)\nt.daemon = True\nt.start()\nprint('ready', flush=True)\ntime.sleep(10)\n\" &\nSERVER_PID=$!\n\n# Wait for server to start\nsleep 1\n\nOUTPUT=$(./loadtest_bin --url http://127.0.0.1:18765/ --requests 20 --concurrency 4)\nkill $SERVER_PID 2>/dev/null || true\nrm -f loadtest_bin\n\necho \"$OUTPUT\"\n\n# Validate output fields\necho \"$OUTPUT\" | grep -q \"Requests:\" || { echo \"FAIL: missing Requests: field\"; exit 1; }\necho \"$OUTPUT\" | grep -q \"Success:\" || { echo \"FAIL: missing Success: field\"; exit 1; }\necho \"$OUTPUT\" | grep -q \"Failed:\" || { echo \"FAIL: missing Failed: field\"; exit 1; }\necho \"$OUTPUT\" | grep -q \"Min:\" || { echo \"FAIL: missing Min: field\"; exit 1; }\necho \"$OUTPUT\" | grep -q \"Max:\" || { echo \"FAIL: missing Max: field\"; exit 1; }\necho \"$OUTPUT\" | grep -q \"Avg:\" || { echo \"FAIL: missing Avg: field\"; exit 1; }\necho \"$OUTPUT\" | grep -q \"P95:\" || { echo \"FAIL: missing P95: field\"; exit 1; }\n\n# Check requests count\nREQS=$(echo \"$OUTPUT\" | grep \"Requests:\" | grep -o '[0-9]*')\n[ \"$REQS\" -eq 20 ] || { echo \"FAIL: Requests should be 20, got $REQS\"; exit 1; }\n\n# All should succeed (local server returns 200)\nSUCCESS=$(echo \"$OUTPUT\" | grep \"Success:\" | grep -o '[0-9]*')\n[ \"$SUCCESS\" -ge 18 ] || { echo \"FAIL: Expected >=18 successes, got $SUCCESS\"; exit 1; }\n\necho \"ALL TESTS PASSED\"","required_files":["loadtest.go"]}},"budget_usdc":"8.00","deadline":0,"spec_hash":"0xc8f06c6ce8bc2fda77f143ddd4f3d5fd58fd4b5905d38c6f31699569b2abe607","status":"open","executor_address":null,"verification_result":null,"created_at":1773846762,"updated_at":1780928597,"difficulty":"intermediate","estimated_minutes":25,"tags":["go","http","concurrency","load-testing","statistics","goroutines"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null,"similar_jobs":[{"id":"5eaa7b41-da30-4a9f-bdb4-3984aa413064","title":"Write 5 SQL queries against product and order tables, return results as JSON","budget_usdc":"3.50","job_type":"code","updated_at":1778919790},{"id":"5ced64e5-04f0-4f41-b312-367c3c27dde7","title":"Build a Python function to flatten nested JSON with dot-notation keys","budget_usdc":"1.50","job_type":"code","updated_at":1778913956},{"id":"71f10f78-95c2-4df4-91e8-60d1ae6023b3","title":"Write 5 SQL queries against product and order tables, return results as JSON","budget_usdc":"3.50","job_type":"code","updated_at":1778913809}],"queue":[],"queue_size":0,"attempts":[{"id":"acaa7b8d-76da-4058-828d-327d5eec13d8","executor_address":"0x76d6a2661d264c2fce9d5cfc8174041dd41bb050","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1780928597},{"id":"f1ff5b21-427e-4853-8749-435ed41467fe","executor_address":"0xa6904e2f73b1837d6c07037a743d3e5fed363ae3","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1779975774},{"id":"c628bcc7-00ea-4763-bab9-6529a950a560","executor_address":"0x4c6d1e5da50e5d8fbd7f8b65e6c2f3e65ce5df0b","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1779823666},{"id":"b4b35a7d-e42a-4e2e-8c71-235d47b186cc","executor_address":"0x820a7bf90d944bb26bfd9b62ab172fc3a0829cb9","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1779533637},{"id":"42c23844-00a3-4eff-8f41-aa7dc92d9706","executor_address":"0xfa9e4d255dbe8f00ba57b2fdb2bd52d8761796c1","verification_result":{"passed":false,"reason":"Code output too small: 0 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1779361670},{"id":"6ebd247a-00ab-40b2-a883-b67db38e3fef","executor_address":"0x0db3e43a4773628dfd8101546eef6e645411f4f3","verification_result":{"passed":false,"reason":"Code output too small: 1 lines","details":{"checksRun":["output_parse","non_empty","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1778780167},{"id":"c0b56c84-2c43-41f8-b264-5a2bfc73438b","executor_address":"0x0db3e43a4773628dfd8101546eef6e645411f4f3","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1778779902},{"id":"7d60f974-b006-454c-a119-6380bf985d83","executor_address":"0x0db3e43a4773628dfd8101546eef6e645411f4f3","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1778779828},{"id":"0eeddc86-d379-4409-831c-5e3370e7f64c","executor_address":"0x0db3e43a4773628dfd8101546eef6e645411f4f3","verification_result":{"passed":false,"reason":"Code output too small: 1 lines","details":{"checksRun":["output_parse","non_empty","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1778779431},{"id":"7150dd47-a706-42da-a029-36857c02f8f7","executor_address":"0x0db3e43a4773628dfd8101546eef6e645411f4f3","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1778779335},{"id":"70184e41-8fc2-436f-83ec-7cbc8c8f6165","executor_address":"0x0db3e43a4773628dfd8101546eef6e645411f4f3","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1778779243},{"id":"df184546-4b5c-494d-9296-44035e99fee5","executor_address":"0x0db3e43a4773628dfd8101546eef6e645411f4f3","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1778779046},{"id":"3525f005-83f7-4733-a6fa-a72ce18e98a1","executor_address":"0x0db3e43a4773628dfd8101546eef6e645411f4f3","verification_result":{"passed":false,"reason":"Code output too small: 1 lines","details":{"checksRun":["output_parse","non_empty","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1778778958},{"id":"25955a84-ee06-458b-a215-890b9cd1a1be","executor_address":"0x0db3e43a4773628dfd8101546eef6e645411f4f3","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1778778281},{"id":"b7f4d54e-1185-412e-9bdb-1d3d315d7acf","executor_address":"0x0db3e43a4773628dfd8101546eef6e645411f4f3","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1778778080}]}