Closed stephen-soltesz closed 1 year ago
internal/triggertrace/triggertrace.go
line 66 at r1 (raw file):
Parser ParseTracer HopAnnotator AnnotateAndArchiver Scamper TracerWriter
I am not sure if Scamper
is a good name because the triggertrace
package does not (and should not) care about the tool to use for tracing. Today, it's scamper
but tomorrow it could be fast-mda-traceroute
(or something else). In short, can you think of a better name for the field name?
internal/triggertrace/triggertrace.go
line 158 at r1 (raw file):
err = h.Scamper.WriteFile(uuid, traceStartTime, rawData) if err != nil { log.Printf("writing scamper trace failed for uuid: %s: %v\n", uuid, err)
All error messages intraceroute-caller
are consistently of the format 'failed to ...so they can be easily searched for with a single pattern. Can you change this to
failed to write trace for uuidand also remove
scamper` per my earlier comment?
tracer/scamper_test.go
line 189 at r1 (raw file):
err = s.WriteFile(wantUUID, faketime, out) if err != nil { t.Errorf("WriteFile() error = %v, want nil", err)
nit: s/error//
tracer/scamper_test.go
line 247 at r1 (raw file):
b, err := s.CachedTrace(uuid, faketime, cachedTrace) if err != nil { t.Errorf("CacheTrace() returned error %v, want nil", err)
nit: s/returned error/=/ https://google.github.io/styleguide/go/decisions#level-of-detail
internal/triggertrace/triggertrace.go
line 66 at r1 (raw file):
Great point. How about `Tracer`?
Tracer
can be a good choice but if may be confused with the Tracer
interface in ipcache
. What do you think about Tracetool
(variables of type ipcache.Tracer
are called tracetool
)?
Thank you!
Thank you for noting that. We can change it in the next anonymization PR.
This change is one of two to support anonymizing traceroutes. This change alters the
tracer.Scamper
package interface to separate the collection of traces (byTrace
andCachedTrace
) from the writing of traces to a file (byWriteFile
). This separation allows thetriggertracer
package, which currently writes hop annotations, to be responsible for writing all files, including the trace output.The second change will anonymize the trace data before writing to file.
This change is![Reviewable](https://reviewable.io/review_button.svg)