Skip to content

Commit

Permalink
Merge pull request #527 from cuishuang/master
Browse files Browse the repository at this point in the history
fix some comments
  • Loading branch information
binbin0325 authored Sep 13, 2024
2 parents bafe3d5 + a2e7b21 commit 7100e5b
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func WithAttachment(key interface{}, value interface{}) EntryOption {
}
}

// WithAttachment set the resource entry with the given k-v pairs
// WithAttachments set the resource entry with the given k-v pairs
func WithAttachments(data map[interface{}]interface{}) EntryOption {
return func(opts *EntryOptions) {
if opts.attachments == nil {
Expand Down
2 changes: 1 addition & 1 deletion core/base/slot_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func NewSlotChain() *SlotChain {
}
}

// Get a EntryContext from EntryContext ctxPool, if ctxPool doesn't have enough EntryContext then new one.
// Get an EntryContext from EntryContext ctxPool, if ctxPool doesn't have enough EntryContext then new one.
func (sc *SlotChain) GetPooledContext() *EntryContext {
ctx := sc.ctxPool.Get().(*EntryContext)
ctx.startTime = util.CurrentTimeMillis()
Expand Down
2 changes: 1 addition & 1 deletion core/circuitbreaker/circuit_breaker.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func (b *circuitBreakerBase) fromHalfOpenToOpen(snapshot interface{}) bool {
return false
}

// fromHalfOpenToOpen updates circuit breaker state machine from half-open to closed
// fromHalfOpenToClosed updates circuit breaker state machine from half-open to closed
// Return true only if current goroutine successfully accomplished the transformation.
func (b *circuitBreakerBase) fromHalfOpenToClosed() bool {
if b.state.cas(HalfOpen, Closed) {
Expand Down
2 changes: 1 addition & 1 deletion core/system_metric/sys_metric_stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func init() {
metric_exporter.Register(processMemoryGauge)
}

// getMemoryStat returns the current machine's memory statistic
// getTotalMemorySize returns the current machine's memory statistic
func getTotalMemorySize() (total uint64) {
stat, err := mem.VirtualMemory()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion ext/datasource/hotspot_rule_converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (s *SpecificValue) String() string {
return fmt.Sprintf("SpecificValue: [ValKind: %+v, ValStr: %s]", s.ValKind, s.ValStr)
}

// arseSpecificItems parses the SpecificValue as real value.
// parseSpecificItems parses the SpecificValue as real value.
func parseSpecificItems(source []SpecificValue) map[interface{}]int64 {
ret := make(map[interface{}]int64, len(source))
if len(source) == 0 {
Expand Down
8 changes: 4 additions & 4 deletions pkg/adapters/micro/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ type (
}
)

// WithUnaryClientResourceExtractor sets the resource extractor of unary client request.
// WithClientResourceExtractor sets the resource extractor of unary client request.
// The second string parameter is the full method name of current invocation.
func WithClientResourceExtractor(fn func(context.Context, client.Request) string) Option {
return func(opts *options) {
opts.clientResourceExtract = fn
}
}

// WithUnaryServerResourceExtractor sets the resource extractor of unary server request.
// WithServerResourceExtractor sets the resource extractor of unary server request.
func WithServerResourceExtractor(fn func(context.Context, server.Request) string) Option {
return func(opts *options) {
opts.serverResourceExtract = fn
Expand All @@ -55,15 +55,15 @@ func WithStreamServerResourceExtractor(fn func(server.Stream) string) Option {
}
}

// WithUnaryClientBlockFallback sets the block fallback handler of unary client request.
// WithClientBlockFallback sets the block fallback handler of unary client request.
// The second string parameter is the full method name of current invocation.
func WithClientBlockFallback(fn func(context.Context, client.Request, *base.BlockError) error) Option {
return func(opts *options) {
opts.clientBlockFallback = fn
}
}

// WithUnaryServerBlockFallback sets the block fallback handler of unary server request.
// WithServerBlockFallback sets the block fallback handler of unary server request.
func WithServerBlockFallback(fn func(context.Context, server.Request, *base.BlockError) error) Option {
return func(opts *options) {
opts.serverBlockFallback = fn
Expand Down
2 changes: 1 addition & 1 deletion pkg/datasource/k8s/controllers/hotspotrules_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (r *HotspotRulesReconciler) assembleHotspotRules(rs *datasourcev1.HotspotRu
return ret
}

// arseSpecificItems parses the SpecificValue as real value.
// parseSpecificItems parses the SpecificValue as real value.
func parseSpecificItems(source []datasourcev1.SpecificValue) map[interface{}]int64 {
ret := make(map[interface{}]int64)
if len(source) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion util/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func CurrentClock() Clock {
return currentClock.Load().(*clockWrapper).clock
}

// SetClock sets the ticker creator used by util package.
// SetTickerCreator sets the ticker creator used by util package.
// In general, no need to set it. It is usually used for testing.
func SetTickerCreator(tc TickerCreator) {
currentTickerCreator.Store(&tickerCreatorWrapper{tc})
Expand Down

0 comments on commit 7100e5b

Please sign in to comment.