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

ironsmile / nedomi / 755 / 2
66%
master: 73%

Build:
Build:
LAST BUILD BRANCH: getContextFromRequest
DEFAULT BRANCH: master
Ran 09 Dec 2015 06:05PM UTC
Files 87
Run time 2s
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

09 Dec 2015 05:26PM UTC coverage: 66.109%. First build
755.2

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%)

2770.06 hits per line

Source Files on job 755.2
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 755
  • Travis Job 755.2
  • ca9b201b on github
  • Next Job for on feature/reimplementThrottle (#757.1)
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