-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
76 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
All Benchmarks are conducted with go run locally, and the redis being ran on the same host as prod. | ||
|
||
These numbers were taken using tests/avg.py | ||
|
||
## /hit with different TTL implementations (in relation to the data return) | ||
### With expire before | ||
|
||
AVG: 66.62284ms, MIN: 53.67ms, MAX: 311.721ms, COUNT: 100 | ||
|
||
### With expire after | ||
|
||
AVG: 64.50046999999999ms, MIN: 53.162ms, MAX: 193.546ms, COUNT: 100 | ||
|
||
### With expire as a go routine | ||
|
||
AVG: 43.408190000000005ms, MIN: 28.913999999999998ms, MAX: 167.731ms, COUNT: 100 | ||
|
||
### With no expire | ||
|
||
AVG: 38.95288ms, MIN: 22.008ms, MAX: 165.397ms, COUNT: 100 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import requests | ||
|
||
COUNT = 100 | ||
TIMEOUT = 0.5 #(500ms) | ||
url = 'http://localhost:8080/hit/jasoncameron.dev/' | ||
times = [] | ||
|
||
for _ in range(COUNT): | ||
|
||
response = requests.get(url, timeout=TIMEOUT) | ||
times.append(response.elapsed.total_seconds() * 1000) | ||
|
||
print(f"AVG: {sum(times)/COUNT}ms, MIN: {min(times)}ms, MAX: {max(times)}ms, COUNT: {len(times)}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package utils | ||
|
||
import "time" | ||
|
||
const BaseTTLPeriod = time.Hour * 24 * 7 * 4 * 6 // 6 months | ||
|
||
const MinLength = 3 | ||
const MaxLength = 64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters