Skip to content

Commit

Permalink
updating builds and fixing doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuyivara, Ivan committed Jan 29, 2018
1 parent e4eb501 commit 3d89ab9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ go:

install:
- "go get -d -v ./..."
- "GOOS=windows GOARCH=amd64 go build -v ./..."
- "GOOS=linux GOARCH=amd64 go build -v ./..."
- "GOOS=windows GOARCH=amd64 go build -o sidebreaker-win-amd64.exe -v ./..."
- "GOOS=linux GOARCH=arm go build -o sidebreaker-linux-amd64 -v ./..."
- "GOOS=darwin GOARCH=amd64 go build -o sidebreaker-darwin-amd64 -v ./..."

before_deploy:
# Set up git user name and tag this commit
Expand All @@ -17,6 +18,7 @@ deploy:
provider: releases
api_key: $GITHUB_TOKEN
file:
- "sidebreaker"
- "sidebreaker.exe"
- "sidebreaker-linux-amd64"
- "sidebreaker-win-amd64.exe"
- "sidebreaker-darwin-amd64"
skip_cleanup: true
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ You can create a configuration file in the same folder as the sidebreaker and in
"host": "external.service.com",
"breakType": "rate",
"timeout": 8000,
"threshold": 0.85
"threshold": 85
}]
}
```

You can indicate 3 types of circuit breaker: consecutive, threshold and rate. The threshold for the rate circuit breaker is a double indicating the percentage per 100 requests before the circuit breaker trips. (i.e. 0.85 if you want 85%).
You can indicate 3 types of circuit breaker: consecutive, threshold and rate. The threshold for the rate circuit breaker is an int indicating the percentage per 100 requests before the circuit breaker trips. (i.e. 85 if you want 85%).
Once you have your configuration file in the same folder as your sidebreaker you can just start the application normally

run `> sidebreaker.exe` on windows or `$ sidebreaker` in linux
Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"host": "external.service.com",
"breakType": "rate",
"timeout": 8000,
"threshold": 0.85
"threshold": 85
}

]
Expand Down
2 changes: 1 addition & 1 deletion sidebreaker.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func main() {
breaker = circuit.NewThresholdBreaker(v.Threshold)
break
case "rate":
breaker = circuit.NewRateBreaker(v.Rate, 100)
breaker = circuit.NewRateBreaker(v.Rate/100, 100)
break
default:
breaker = circuit.NewConsecutiveBreaker(5)
Expand Down

0 comments on commit 3d89ab9

Please sign in to comment.