m-lab / traceroute-caller

A sidecar service which runs traceroute after a connection closes
Apache License 2.0
18 stars 5 forks source link

Add NewScamper() to create a new scamper instance #135

Closed SaiedKazemi closed 2 years ago

SaiedKazemi commented 2 years ago

This commit adds a new function, NewScamper(), to the tracer package for creating a new instance of scamper based on the configuration specified in the call if the configuration is valid. The new scamper instance contains all of the information required for invoking the scamper binary to run a traceroute.

The changes were tested locally with go test and docker-compose.


This change is Reviewable

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 430


Totals Coverage Status
Change from base Build 424: 0.4%
Covered Lines: 559
Relevant Lines: 579

💛 - Coveralls
SaiedKazemi commented 2 years ago

@cristinaleonr Just FYI...

SaiedKazemi commented 2 years ago

Thank you for your quick review.

SaiedKazemi commented 2 years ago

tracer/scamper.go, line 40 at r1 (raw file):

Previously, stephen-soltesz (Stephen Soltesz) wrote…
Nice changes :+1:

Thank you. The original code didn't have a factory function and instantiated a Scamper structure directly, putting values there. The current implementation is much better.