New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add offset to the histogram of the response time #495
Conversation
Code Climate has analyzed commit 9c9b356 and detected 0 issues on this pull request. View more on Code Climate. |
Codecov Report
@@ Coverage Diff @@
## master #495 +/- ##
========================================
+ Coverage 87.0% 87.1% +0.1%
========================================
Files 26 26
Lines 3381 3381
========================================
+ Hits 2941 2945 +4
+ Misses 292 288 -4
Partials 148 148
Continue to review full report at Codecov.
|
fortio_main.go
Outdated
@@ -104,6 +104,7 @@ var ( | |||
durationFlag = flag.Duration("t", defaults.Duration, "How long to run the test or 0 to run until ^C") | |||
percentilesFlag = flag.String("p", "50,75,90,99,99.9", "List of pXX to calculate") | |||
resolutionFlag = flag.Float64("r", defaults.Resolution, "Resolution of the histogram lowest buckets in seconds") | |||
offsetFlag = flag.Float64("o", defaults.Offset, "Offset of the histogram data in seconds") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably be a duration (like -t)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code updated and pushed again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
periodic/periodic.go
Outdated
@@ -406,7 +408,8 @@ func (r *periodicRunner) Run() RunnerResults { | |||
} | |||
start := time.Now() | |||
// Histogram and stats for Function duration - millisecond precision | |||
functionDuration := stats.NewHistogram(0, r.Resolution) | |||
offsetSec := float64(r.Offset) / float64(time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks. It is much easier to get the seconds. Code updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
I should have thought about this sooner, but I am going to change the flag to keep the short |
#496 - so please use 1.18.2 and |
thanks
在 2021年11月24日週三 02:21,Laurent Demailly ***@***.***> 寫道:
… #496 <#496> - so please use 1.18.2
and -offset - thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#495 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHWBE5TCVLWZXPKS23KTMNDUNPLSHANCNFSM5HQHV5IA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
It is to add offsset to the histogram of the response time.
Currently we run the fortio on a service with predefined latency, say, 200ms, 500ms, 1s to simulate production behavior. Fortio does not give accurate response time as the histogram of the response time is always starting from 0.
In this PR, a new flag is added. it is
-o : offset to histogram of the response time
e.g. if the latency of the service is 200ms, i.e. sleep 200ms in the service. the command for the fortio is : '
fortio load -o 0.2s ......