Skip to content
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

Merged
merged 5 commits into from
Jan 15, 2024
Merged

Add/icmp prober #20

merged 5 commits into from
Jan 15, 2024

Conversation

yeganeahmadnejad
Copy link
Collaborator

No description provided.

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",
Copy link
Member

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{
Copy link
Member

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 {
Copy link
Member

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.

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4dbb2a8) 0.00% compared to head (d9eafd4) 0.00%.
Report is 1 commits behind head on main.

❗ Current head d9eafd4 differs from pull request most recent head ec90be1. Consider uploading reports for the commit ec90be1 to get more accurate results

Additional details and impacted files
@@    Coverage Diff     @@
##   main   #20   +/-   ##
==========================
==========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@m-yosefpor m-yosefpor merged commit 4ec23e0 into main Jan 15, 2024
3 checks passed
@1995parham 1995parham deleted the add/icmp-prober branch January 15, 2024 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants