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

TykTechnologies / tyk / 5051 / 1

Build:
DEFAULT BRANCH: master
Ran 07 Jun 2018 03:29AM UTC
Files 78
Run time 10s
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

07 Jun 2018 03:26AM UTC coverage: 57.429% (-0.4%) from 57.871%
LATEST_GO=true

push

travis-ci

buger
Benchmark default version profiling (#1750)

added changes for https://github.com/TykTechnologies/tyk/issues/1635

When I first looked at BenchmarkDefaultVersion I've noticed that we spend some significant time in ErrorHandler and SuccessHandler when analytics is enabled. So I started looking into it and that PR includes changes for analytics as well:

- we did lots of slice re-allocations for `record.Tags`, I've added helper function which calculates capacity based on spec and configuration
- don't spawn go-routine for `analytics.RecordHit`, write to buffered channel instead which is consumed by pool of workers
- added new method to redis storage `AppendToSetPipelined(key string, values []string)` to use pipelined operation in analytics pool worker
- pool workers maintain buffer of consumed messages, that buffer is sent to redis when it is full or when there were no new messages for some time but buffer holds some unsent messages
- the same config value `pool_size` is used to specify number of pool workers
- also there is new config value `records_buffer_size` which specifies buffer size for pool workers (size of each pipeline operation). also, buffered channel depends on this value as well and calculated as `pool_size * records_buffer_size`. The default value for `records_buffer_size` is `1000`, also if value from config is lower it will be forced to `1000`
- we stop analytics worker poll gracefully when tyk is about to exit

Also there some optimizations specifically for `VersionCheck` middle-ware:

- parse version `expires` field at API load time, not at request processing
- some small clean ups which potentially improve performance and readability of code

benchcmp vs master:
```
benchmark                     old ns/op     new ns/op     delta
BenchmarkDefaultVersion-8     1120529       1023211       -8.69%

benchmark                     old allocs     new allocs     delta
BenchmarkDefaultVersion-8     1487           1226   ... (continued)

7966 of 13871 relevant lines covered (57.43%)

0.63 hits per line

Source Files on job 5051.1 (LATEST_GO=true)
  • Tree
  • List 0
  • Changed 12
  • Source Changed 8
  • Coverage Changed 12
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 4605
  • Travis Job 5051.1
  • abc192a9 on github
  • Prev Job for LATEST_GO=true on master (#5048.1)
  • Next Job for LATEST_GO=true on master (#5059.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

© 2026 Coveralls, Inc