toxiproxy-setup.td 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. $ http-request method=POST url=http://toxiproxy:8474/proxies content-type=application/json
  10. {
  11. "name": "pg_1",
  12. "listen": "0.0.0.0:5432",
  13. "upstream": "postgres:5432"
  14. }
  15. $ http-request method=POST url=http://toxiproxy:8474/proxies content-type=application/json
  16. {
  17. "name": "pg_2",
  18. "listen": "0.0.0.0:4432",
  19. "upstream": "postgres:5432"
  20. }
  21. # Run each source at a different impedance
  22. $ http-request method=POST url=http://toxiproxy:8474/proxies/pg_1/toxics content-type=application/json
  23. {
  24. "name": "pg_1",
  25. "type": "bandwidth",
  26. "attributes": { "rate": 10 }
  27. }
  28. $ http-request method=POST url=http://toxiproxy:8474/proxies/pg_2/toxics content-type=application/json
  29. {
  30. "name": "pg_2",
  31. "type": "bandwidth",
  32. "attributes": { "rate": 30 }
  33. }