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

misc: fix typos in the code #104

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ coverage.html

dist/

# binaries not commited
# binaries not committed
bin/
2 changes: 1 addition & 1 deletion cmd/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (r *Root) RunPing(cmd *cobra.Command, args []string) error {

func (r *Root) pingInfinite(opts *globalping.MeasurementCreate) error {
if r.ctx.Limit > 5 {
return fmt.Errorf("continous mode is currently limited to 5 probes")
return fmt.Errorf("continuous mode is currently limited to 5 probes")
}

var err error
Expand Down
8 changes: 4 additions & 4 deletions view/infinite.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func (v *viewer) outputStreamingPackets(m *globalping.Measurement) error {
probeMeasurement := &m.Results[0]
hm := v.ctx.History.Find(m.ID)
if probeMeasurement.Result.RawOutput != "" {
concurentStats := v.aggregateConcurentStats(v.ctx.AggregatedStats[0], 0, m.ID)
parsedOutput := v.parsePingRawOutput(hm, probeMeasurement, concurentStats.Sent)
concurrentStats := v.aggregateConcurrentStats(v.ctx.AggregatedStats[0], 0, m.ID)
parsedOutput := v.parsePingRawOutput(hm, probeMeasurement, concurrentStats.Sent)
if len(hm.Stats) == 0 {
hm.Stats = make([]*MeasurementStats, 1)
}
Expand Down Expand Up @@ -134,7 +134,7 @@ func (v *viewer) generateTable(hm *HistoryItem, m *globalping.Measurement, areaW
parsedOutput := v.parsePingRawOutput(hm, probeMeasurement, -1)
newAggregatedStats[i] = mergeMeasurementStats(*v.ctx.AggregatedStats[i], parsedOutput.Stats)
newStats[i] = parsedOutput.Stats
row := getRowValues(v.aggregateConcurentStats(newAggregatedStats[i], i, m.ID))
row := getRowValues(v.aggregateConcurrentStats(newAggregatedStats[i], i, m.ID))
rowWidth := 0
for j := 1; j < len(row); j++ {
rowWidth += len(row[j]) + len(colSeparator)
Expand Down Expand Up @@ -188,7 +188,7 @@ func (v *viewer) generateTable(hm *HistoryItem, m *globalping.Measurement, areaW
return &output, newStats, newAggregatedStats
}

func (v *viewer) aggregateConcurentStats(completed *MeasurementStats, probeIndex int, excludeId string) *MeasurementStats {
func (v *viewer) aggregateConcurrentStats(completed *MeasurementStats, probeIndex int, excludeId string) *MeasurementStats {
inProgressStats := v.ctx.History.FilterByStatus(globalping.StatusInProgress)
for i := range inProgressStats {
if inProgressStats[i].Id == excludeId {
Expand Down
2 changes: 1 addition & 1 deletion view/infinite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ Nuremberg, DE, EU, Hetzner Online GmbH (AS0) | 2 | 0.00% | 4.07 ms | 4.
assert.Equal(t, expectedOutput, w.String())
}

func Test_OutputInfinite_MultipleProbes_MultipleConcurentCalls(t *testing.T) {
func Test_OutputInfinite_MultipleProbes_MultipleConcurrentCalls(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()

Expand Down
2 changes: 1 addition & 1 deletion view/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func (v *viewer) OutputSummary() {
}

if len(v.ctx.AggregatedStats) == 1 {
stats := v.aggregateConcurentStats(v.ctx.AggregatedStats[0], 0, "")
stats := v.aggregateConcurrentStats(v.ctx.AggregatedStats[0], 0, "")

v.printer.Printf("\n--- %s ping statistics ---\n", v.ctx.Hostname)
v.printer.Printf("%d packets transmitted, %d received, %.2f%% packet loss, time %.0fms\n",
Expand Down