Skip to content

Commit

Permalink
misc: fix typos in the code (#104)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Kolárik <[email protected]>
  • Loading branch information
kianmeng and MartinKolarik authored Jun 17, 2024
1 parent 40721c4 commit 582c35f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
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

0 comments on commit 582c35f

Please sign in to comment.