Skip to content

Commit 1b969e1

Browse files
WangYulihao022
authored andcommitted
fix: correct misspellings in identifiers, error messages, and log strings
Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
1 parent 05f4402 commit 1b969e1

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

core/events/net_rx_latency.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func (c *netRecvLatTracing) Start(ctx context.Context) error {
160160
default:
161161
var pd netRcvPerfEvent
162162
if err := reader.ReadInto(&pd); err != nil {
163-
return fmt.Errorf("read rrom perf event fail: %w", err)
163+
return fmt.Errorf("read from perf event fail: %w", err)
164164
}
165165
tracerTime := time.Now()
166166

core/metrics/cpu_stat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func (c *cpuStatCollector) Update() ([]*metric.Data, error) {
149149
}
150150

151151
for _, container := range containers {
152-
containerDataCache := container.LifeResouces("collector_cpu_stat").(*cpuStat)
152+
containerDataCache := container.LifeResources("collector_cpu_stat").(*cpuStat)
153153
if err := c.updateDataCache(containerDataCache, container); err != nil {
154154
log.Infof("failed to update cpu info of %s, %v", container, err)
155155
continue

core/metrics/cpu_util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func (c *cpuUtilCollector) Update() ([]*metric.Data, error) {
151151
continue
152152
}
153153

154-
containerDataCache := container.LifeResouces("collector_cpu_util").(*cpuUtilStat)
154+
containerDataCache := container.LifeResources("collector_cpu_util").(*cpuUtilStat)
155155
if err := c.updateDataCache(containerDataCache, container, numCores); err != nil {
156156
log.Infof("failed to update cpu info of %s, %v", container, err)
157157
continue

core/metrics/runqlat_tracing.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (c *runqlatCollector) updateContainerDataCache(cssContainers map[uint64]*po
104104
}
105105

106106
buf = bytes.NewReader(v.Value)
107-
if err := binary.Read(buf, binary.LittleEndian, container.LifeResouces("runqlat").(*latencyBpfData)); err != nil {
107+
if err := binary.Read(buf, binary.LittleEndian, container.LifeResources("runqlat").(*latencyBpfData)); err != nil {
108108
return fmt.Errorf("read cpu_tg_metric value: %w", err)
109109
}
110110
}
@@ -148,7 +148,7 @@ func (c *runqlatCollector) Update() ([]*metric.Data, error) {
148148

149149
data := []*metric.Data{}
150150
for _, container := range containers {
151-
cache := container.LifeResouces("runqlat").(*latencyBpfData)
151+
cache := container.LifeResources("runqlat").(*latencyBpfData)
152152

153153
data = append(data,
154154
metric.NewContainerGaugeData(container, "latency", float64(cache.NumLatencyZone0), "cpu run queue latency for the containers", map[string]string{"zone": "0"}),

internal/pod/container.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ type Container struct {
4949
StartedAt time.Time `json:"started_at"`
5050
SyncedAt time.Time `json:"synced_at"`
5151
Labels map[string]any `json:"labels"` // custom labels
52-
lifeResouces map[string]any
52+
lifeResources map[string]any
5353
}
5454

5555
func (c *Container) String() string {
5656
return fmt.Sprintf("%s:%s/%s/%s:%s/%s", c.ID, c.Hostname, c.Name, c.Type, c.Qos, c.IPAddress)
5757
}
5858

59-
// LifeResouces returns the life resouces of container.
60-
func (c *Container) LifeResouces(key string) any {
61-
return c.lifeResouces[key]
59+
// LifeResources returns the life resources of container.
60+
func (c *Container) LifeResources(key string) any {
61+
return c.lifeResources[key]
6262
}
6363

6464
// LabelHostNamespace returns namespace label

internal/pod/container_kubelet_sync.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ func kubeletUpdateContainer(containerID string, container *corev1.Container, con
413413
CgroupCss: css,
414414
StartedAt: startedAt,
415415
SyncedAt: time.Now(),
416-
lifeResouces: make(map[string]any),
416+
lifeResources: make(map[string]any),
417417
Labels: labels,
418418
}
419419

@@ -514,7 +514,7 @@ func kubeletConfigCacheUpdate(ctx *PodContainerInitCtx) error {
514514

515515
config, err = kubeletConfigFileDefault()
516516
if err != nil {
517-
panic("we cant not find any cgroup driver of kubelet after requesting configz and default files")
517+
panic("we cannot find any cgroup driver of kubelet after requesting configz and default files")
518518
}
519519

520520
return nil

internal/pod/container_life_resources.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func createContainerLifeResources(c *Container) {
4848
lifeResourcesTpl.Range(func(key, anythingType any) bool {
4949
// create container life resource
5050
typ := anythingType.(reflect.Type)
51-
c.lifeResouces[key.(string)] = reflect.New(typ.Elem()).Interface()
51+
c.lifeResources[key.(string)] = reflect.New(typ.Elem()).Interface()
5252
return true
5353
})
5454
}

internal/services/collector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func CollectorDo(ctx *gin.Context) {
4545
Timeout: 30 * time.Second,
4646
})
4747

48-
log.Infof("The prometheus Metrics HTTP server is startting: %v", collectorPromHandler)
48+
log.Infof("The prometheus Metrics HTTP server is starting: %v", collectorPromHandler)
4949
})
5050

5151
collectorPromHandler.ServeHTTP(ctx.Writer, ctx.Request)

pkg/tracing/register_event.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ func NewRegister(blackListed []string) (map[string]*EventTracingAttr, error) {
7575
}
7676

7777
tracingStatusCache[name] = statusInitError
78-
err = fmt.Errorf("traing name: %s, err: [%w]", name, err)
78+
err = fmt.Errorf("tracing name: %s, err: [%w]", name, err)
7979
return
8080
}
8181
if attr.Flag&(FlagTracing|FlagMetric) == 0 {
82-
err = fmt.Errorf("traing name: %s, invalid flag", name)
82+
err = fmt.Errorf("tracing name: %s, invalid flag", name)
8383
return
8484
}
8585

0 commit comments

Comments
 (0)