-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add/icmp prober #20
Add/icmp prober #20
Conversation
prober/icmp.go
Outdated
} | ||
pinger.SetPrivileged(false) | ||
pinger.OnRecv = func(pkt *ping.Packet) { | ||
fmt.Printf("%d bytes from %s: icmp_seq=%d time=%v ttl=%v\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this
pinger.OnRecv = func(pkt *ping.Packet) { | ||
fmt.Printf("%d bytes from %s: icmp_seq=%d time=%v ttl=%v\n", | ||
pkt.Nbytes, pkt.IPAddr, pkt.Seq, pkt.Rtt, pkt.Ttl) | ||
icmpresult = ICMPResult{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to save and resturn a full ICMPResult? if we are not using those results in anyway, so why should we have them in struct? (e.g. Size, Seq,,...). We can only use the values which we are using (log, metric.observe, etc). If we ever need them, we can add those later (YAGNI :D)
prober/icmp.go
Outdated
} | ||
|
||
} | ||
func (i *ICMP) calculateInterval() time.Duration { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can move this to a utils.go func calculateInterval(rps int) time.Duration {
and refactor other modules (http, dns) with this function as well. We can do this in another PR if you want to merge this before that.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #20 +/- ##
==========================
==========================
☔ View full report in Codecov by Sentry. |
No description provided.