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

TykTechnologies / tyk / 5051

Build:
DEFAULT BRANCH: master
Ran 07 Jun 2018 03:29AM UTC
Jobs 2
Files 78
Run time 3min
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
5051

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

1.28 hits per line

Jobs
ID Job ID Ran Files Coverage
1 5051.1 (LATEST_GO=true) 07 Jun 2018 03:29AM UTC 0
57.43
Travis Job 5051.1
2 5051.2 (LATEST_GO=true) 07 Jun 2018 03:32AM UTC 0
58.52
Travis Job 5051.2
Source Files on build 5051
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #5051
  • abc192a9 on github
  • Prev Build on master (#5048)
  • Next Build on master (#5059)
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