• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ironsmile / nedomi / 755
66%
master: 73%

Build:
Build:
LAST BUILD BRANCH: getContextFromRequest
DEFAULT BRANCH: master
Ran 09 Dec 2015 05:52PM UTC
Jobs 2
Files 87
Run time 13min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
755

push

travis-ci

MStoykov
reimplement throttle handler

the throttle handler reimplementation has one main strenght - it can use
sendfile. Other benifits is that it removes a dependancy. I would also
argue it's lighter runtime(don't quote me).

In order to use this we use the now new ThrottledWriter which records
how much bytes it has throttled at a given speed and tries to write as
much as it can in order to get to the speed that is requested.

The reason why it's done in the timeoutConn instead of in the handler
given that it requires the whole getting the correct connection for each
request is:
http.ResponseWriter.ReadFrom does os.Stat on each io.LimitedReader it
gets. This adds up pretty quickly to hundred of thousands of os.Stat, which
both slow down the whole application, and make a lot of objects.

Given the fact that io.LimitedReader is the only way to limit the amount
of data the sendfile sends at a time and there is no way to go around
http.ResponseWriter.ReadFrom without Hijacking the connection, the
current solution emerged.

Additional benifit is that other handlers can now throttle as well.

2567 of 3883 relevant lines covered (66.11%)

6175.96 hits per line

Jobs
ID Job ID Ran Files Coverage
1 755.1 09 Dec 2015 05:52PM UTC 0
66.11
Travis Job 755.1
2 755.2 09 Dec 2015 06:05PM UTC 0
66.11
Travis Job 755.2
Source Files on build 755
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #755
  • ca9b201b on github
  • Next Build on feature/reimplementThrottle (#757)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc