Skip to content

fabmorais/throttling-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

throttling-test

Table of Contents
  1. Prerequisites
  2. Requirements
  3. Payload
  4. Run Locally
  5. Run on Kubernetes
  6. Expected Response

prerequisites

  1. Docker

  2. Kubectl

  3. Go 1.16

requirements

 ❯ maximum of 2 request per second and regardless of the x-secret-key

 ❯ maximum of 10 request per minute and per x-secret-key

payload

curl -X POST \
    http://localhost:8080/ping \
    -H 'content-type: application/json' \
    -H 'x-secret-key: ahs98h' \
    -d '{"request":"ping"}'

run locally

❯ go mod init github.com/fabmorais/throttling-test

❯ go mod tidy -v

❯ go run main.go

run on kubernetes

❯ docker build -t ping-pong-app:latest .

❯ kubectl apply -f kube/deployment.yaml

❯ kubectl apply -f kube/service.yaml

expected response


(not throttled):
 ❯ {"response":"pong"}

(throttled)
 ❯ {"message":"request throttled request","throttle_age":"10"}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published