Skip to content

Commit

Permalink
fix function names in comments (grafana#9415)
Browse files Browse the repository at this point in the history
  • Loading branch information
cuishuang committed May 6, 2023
1 parent 48ad068 commit 520e434
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion clients/pkg/logentry/stages/multiline.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ type multilineState struct {
currentLines uint64 // The number of lines of the current multiline block.
}

// newMulitlineStage creates a MulitlineStage from config
// newMultilineStage creates a MulitlineStage from config
func newMultilineStage(logger log.Logger, config interface{}) (Stage, error) {
cfg := &MultilineConfig{}
err := mapstructure.WeakDecode(config, cfg)
Expand Down
2 changes: 1 addition & 1 deletion clients/pkg/promtail/wal/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func (w *Watcher) Stop() {
w.metrics.watchersRunning.WithLabelValues().Dec()
}

// firstAndList finds the first and last segment number for a WAL directory.
// firstAndLast finds the first and last segment number for a WAL directory.
func (w *Watcher) firstAndLast() (int, int, error) {
refs, err := readSegmentNumbers(w.walDir)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/distributor/distributor_ring.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (cfg *RingConfig) RegisterFlags(f *flag.FlagSet) {
f.BoolVar(&cfg.EnableIPv6, "distributor.ring.instance-enable-ipv6", false, "Enable using a IPv6 instance address.")
}

// ToLifecyclerConfig returns a BasicLifecyclerConfig based on the distributor
// ToBasicLifecyclerConfig returns a BasicLifecyclerConfig based on the distributor
// ring config.
func (cfg *RingConfig) ToBasicLifecyclerConfig(logger log.Logger) (ring.BasicLifecyclerConfig, error) {
instanceAddr, err := ring.GetInstanceAddr(cfg.InstanceAddr, cfg.InstanceInterfaceNames, logger, cfg.EnableIPv6)
Expand Down
2 changes: 1 addition & 1 deletion pkg/iter/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ type cachedSampleIterator struct {
iterErr error
}

// newSampleCachedIterator creates an iterator that cache iteration result and can be iterated again
// NewCachedSampleIterator creates an iterator that cache iteration result and can be iterated again
// after closing it without re-using the underlaying iterator `it`.
func NewCachedSampleIterator(it SampleIterator, cap int) CacheSampleIterator {
c := &cachedSampleIterator{
Expand Down
4 changes: 2 additions & 2 deletions pkg/iter/sample_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ type QuerySampleClient interface {
CloseSend() error
}

// NewQueryClientIterator returns an iterator over a QueryClient.
// NewSampleQueryClientIterator returns an iterator over a QueryClient.
func NewSampleQueryClientIterator(client QuerySampleClient) SampleIterator {
return &sampleQueryClientIterator{
client: client,
Expand Down Expand Up @@ -706,7 +706,7 @@ func (i *timeRangedSampleIterator) Next() bool {
return ok
}

// ReadBatch reads a set of entries off an iterator.
// ReadSampleBatch reads a set of entries off an iterator.
func ReadSampleBatch(i SampleIterator, size uint32) (*logproto.SampleQueryResponse, uint32, error) {
var (
series = map[uint64]map[string]*logproto.Series{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/loghttp/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func parseInt(value string, def int) (int, error) {
return strconv.Atoi(value)
}

// parseUnixNano parses a ns unix timestamp from a string
// parseTimestamp parses a ns unix timestamp from a string
// if the value is empty it returns a default value passed as second parameter
func parseTimestamp(value string, def time.Time) (time.Time, error) {
if value == "" {
Expand Down

0 comments on commit 520e434

Please sign in to comment.