Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/chuangyou/qsf
/ functions
Functions
270 in github.com/chuangyou/qsf
⨍
Functions
270
◇
Types & classes
54
↓ 39 callers
Method
String
()
examples/pb/example.pb.go:34
↓ 24 callers
Method
Add
Add sets the name as a reference to the given circuit breaker.
plugin/breaker/panel.go:47
↓ 22 callers
Method
Call
Call wraps a function the Breaker will protect. A failure is recorded whenever the function returns an error. If the called function takes longer than
plugin/breaker/circuitbreaker.go:303
↓ 21 callers
Method
Fail
Fail increments the failure count
plugin/breaker/window.go:32
↓ 21 callers
Method
Limit
Limit returns true if rate was exceeded
plugin/ratelimit/ratelimit.go:40
↓ 19 callers
Method
Tripped
Tripped returns true if the circuit breaker is tripped, false if it is reset.
plugin/breaker/circuitbreaker.go:226
↓ 18 callers
Method
Reset
Reset resets the counts to 0
plugin/breaker/window.go:26
↓ 16 callers
Function
requireValue
(t *testing.T, expect int, c prometheus.Collector)
plugin/prometheus/server_test.go:293
↓ 14 callers
Method
Ready
Ready will return true if the circuit breaker is ready to call the function. It will be ready if the breaker is in a reset state, or if it is time to
plugin/breaker/circuitbreaker.go:291
↓ 13 callers
Function
NewThresholdBreaker
NewThresholdBreaker creates a Breaker with a ThresholdTripFunc.
plugin/breaker/circuitbreaker.go:141
↓ 12 callers
Function
NewBreaker
NewBreaker creates a base breaker with an exponential backoff and no TripFunc
plugin/breaker/circuitbreaker.go:136
↓ 11 callers
Method
Reset
Reset will reset the circuit breaker. After Reset() is called, Tripped() will return false.
plugin/breaker/circuitbreaker.go:211
↓ 11 callers
Method
Trip
Trip will trip the circuit breaker. After Trip() is called, Tripped() will return true.
plugin/breaker/circuitbreaker.go:202
↓ 9 callers
Function
New
New creates a new rate limiter instance
plugin/ratelimit/ratelimit.go:14
↓ 8 callers
Method
Close
()
plugin/loadbalance/registry/etcd/watcher.go:22
↓ 8 callers
Method
Context
()
plugin/tracing/server.go:131
↓ 8 callers
Method
PingList
(ping *pb_testproto.PingRequest, stream pb_testproto.TestService_PingListServer)
plugin/prometheus/server_test.go:244
↓ 8 callers
Method
Success
Sucecss increments the success count
plugin/breaker/window.go:37
↓ 8 callers
Method
apply
(o prom.CounterOpts)
plugin/prometheus/metric_options.go:12
↓ 8 callers
Function
requireValueWithRetry
(ctx context.Context, t *testing.T, expect int, c prometheus.Collector)
plugin/prometheus/server_test.go:315
↓ 7 callers
Method
Fail
Fail is used to indicate a failure condition the Breaker should record. It will increment the failure counters and store the time of the last failure.
plugin/breaker/circuitbreaker.go:255
↓ 7 callers
Function
SetSpanTags
SetSpanTags sets one or more tags on the given span according to the error.
plugin/tracing/errors.go:55
↓ 6 callers
Method
Do
Do wraps http.Client Do()
plugin/breaker/client.go:93
↓ 6 callers
Method
Get
Get retrieves a circuit breaker by name. If no circuit breaker exists, it returns the NoOp one and sets ok to false.
plugin/breaker/panel.go:75
↓ 6 callers
Method
Handled
(code codes.Code)
plugin/prometheus/server_reporter.go:41
↓ 6 callers
Function
NewPanel
NewPanel creates a new Panel
plugin/breaker/panel.go:38
↓ 6 callers
Method
StreamServerInterceptor
StreamServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Streaming RPCs.
plugin/prometheus/server_metrics.go:118
↓ 6 callers
Method
UnaryServerInterceptor
UnaryServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Unary RPCs.
plugin/prometheus/server_metrics.go:103
↓ 6 callers
Function
requireValueHistCount
(t *testing.T, expect int, o prometheus.Observer)
plugin/prometheus/server_test.go:304
↓ 5 callers
Method
Get
Get wraps http.Client Get()
plugin/breaker/client.go:105
↓ 5 callers
Function
NewBreakerWithOptions
NewBreakerWithOptions creates a base breaker with a specified backoff, clock and TripFunc
plugin/breaker/circuitbreaker.go:100
↓ 5 callers
Method
breakerLookup
(val interface{})
plugin/breaker/client.go:152
↓ 4 callers
Method
CallContext
CallContext is same as Call but if the ctx is canceled after the circuit returned an error, the error will not be marked as a failure because the call
plugin/breaker/circuitbreaker.go:309
↓ 4 callers
Method
ConsecFailures
ConsecFailures returns the number of consecutive failures that have occured.
plugin/breaker/circuitbreaker.go:243
↓ 4 callers
Method
Count
(name string)
plugin/breaker/panel_test.go:85
↓ 4 callers
Method
Counter
(sampleRate float32, bucket string, n ...int)
plugin/breaker/panel.go:13
↓ 4 callers
Function
ErrorClass
ErrorClass returns the class of the given error
plugin/tracing/errors.go:25
↓ 4 callers
Method
Failures
Failures returns the number of failures for this circuit breaker.
plugin/breaker/circuitbreaker.go:238
↓ 4 callers
Method
GetExample
(ctx context.Context, in *GetExampleRequest, opts ...grpc.CallOption)
examples/pb/example.pb.go:139
↓ 4 callers
Function
NewRateBreaker
NewRateBreaker creates a Breaker with a RateTripFunc.
plugin/breaker/circuitbreaker.go:155
↓ 4 callers
Method
ReceivedMessage
()
plugin/prometheus/server_reporter.go:33
↓ 4 callers
Method
SentMessage
()
plugin/prometheus/server_reporter.go:37
↓ 4 callers
Method
apply
(opts ...Option)
plugin/tracing/options.go:72
↓ 4 callers
Function
newOptions
newOptions returns the default options.
plugin/tracing/options.go:65
↓ 4 callers
Method
sendEvent
(event BreakerEvent)
plugin/breaker/circuitbreaker.go:373
↓ 3 callers
Method
Failures
Failures returns the total number of failures recorded in all buckets.
plugin/breaker/window.go:92
↓ 3 callers
Method
Header
()
plugin/tracing/client.go:187
↓ 3 callers
Method
Register
()
plugin/loadbalance/registry/etcd/registry.go:62
↓ 3 callers
Method
Run
()
server/server.go:138
↓ 3 callers
Method
Subscribe
Subscribe returns a channel of PanelEvents. Whenever a breaker changes state, the PanelEvent will be sent over the channel. See BreakerEvent for the t
plugin/breaker/panel.go:89
↓ 3 callers
Method
Successes
Successes returns the number of successes for this circuit breaker.
plugin/breaker/circuitbreaker.go:248
↓ 3 callers
Method
UnaryClientInterceptor
UnaryClientInterceptor is a gRPC client-side interceptor that provides Prometheus monitoring for Unary RPCs.
plugin/prometheus/client_metrics.go:108
↓ 3 callers
Function
newWindow
newWindow creates a new window. windowTime is the time covering the entire window. windowBuckets is the number of buckets the window is divided into.
plugin/breaker/window.go:57
↓ 2 callers
Method
EnableClientHandlingTimeHistogram
EnableClientHandlingTimeHistogram turns on recording of handling time of RPCs. Histogram metrics can be very expensive for Prometheus to retain and qu
plugin/prometheus/client_metrics.go:94
↓ 2 callers
Method
EnableHandlingTimeHistogram
EnableHandlingTimeHistogram enables histograms being registered when registering the ServerMetrics on a Prometheus registry. Histograms can be expensi
plugin/prometheus/server_metrics.go:63
↓ 2 callers
Method
ErrorRate
ErrorRate returns the error rate calculated over all buckets, expressed as a floating point number (e.g. 0.9 for 90%)
plugin/breaker/window.go:120
↓ 2 callers
Method
ErrorRate
ErrorRate returns the current error rate of the Breaker, expressed as a floating point number (e.g. 0.9 for 90%), since the last time the breaker was
plugin/breaker/circuitbreaker.go:284
↓ 2 callers
Method
InitializeMetrics
InitializeMetrics initializes all metrics, with their appropriate null value, for all gRPC methods registered on a gRPC server. This is useful, to ens
plugin/prometheus/server_metrics.go:131
↓ 2 callers
Function
NewClientMetrics
NewClientMetrics returns a ClientMetrics object. Use a new instance of ClientMetrics when not using the default Prometheus metrics registry, for examp
plugin/prometheus/client_metrics.go:29
↓ 2 callers
Function
NewConsecutiveBreaker
NewConsecutiveBreaker creates a Breaker with a ConsecutiveTripFunc.
plugin/breaker/circuitbreaker.go:148
↓ 2 callers
Function
NewHTTPClient
NewHTTPClient provides a circuit breaker wrapper around http.Client. It wraps all of the regular http.Client functions. Specifying 0 for timeout will
plugin/breaker/client.go:29
↓ 2 callers
Function
NewServerMetrics
NewServerMetrics returns a ServerMetrics object. Use a new instance of ServerMetrics when not using the default Prometheus metrics registry, for examp
plugin/prometheus/server_metrics.go:26
↓ 2 callers
Method
Next
()
plugin/loadbalance/registry/etcd/watcher.go:38
↓ 2 callers
Method
PingEmpty
(ctx context.Context, _ *pb_testproto.Empty)
plugin/prometheus/server_test.go:230
↓ 2 callers
Method
PingError
(ctx context.Context, ping *pb_testproto.PingRequest)
plugin/prometheus/server_test.go:239
↓ 2 callers
Method
Set
(key, val string)
plugin/tracing/shared.go:22
↓ 2 callers
Method
StreamClientInterceptor
StreamClientInterceptor is a gRPC client-side interceptor that provides Prometheus monitoring for Streaming RPCs.
plugin/prometheus/client_metrics.go:123
↓ 2 callers
Method
Success
Success is used to indicate a success condition the Breaker should record. If the success was triggered by a retry attempt, the breaker will be Reset(
plugin/breaker/circuitbreaker.go:268
↓ 2 callers
Method
Successes
Successes returns the total number of successes recorded in all buckets.
plugin/breaker/window.go:106
↓ 2 callers
Function
extractSpanContext
(ctx context.Context, tracer opentracing.Tracer)
plugin/tracing/server.go:135
↓ 2 callers
Method
getLatestBucket
getLatestBucket returns the current bucket. If the bucket time has elapsed it will move to the next bucket, resetting its counts and updating the last
plugin/breaker/window.go:153
↓ 2 callers
Function
injectSpanContext
(ctx context.Context, tracer opentracing.Tracer, clientSpan opentracing.Span)
plugin/tracing/client.go:226
↓ 2 callers
Function
newClientReporter
(m *ClientMetrics, rpcType grpcType, fullMethod string)
plugin/prometheus/client_reporter.go:20
↓ 2 callers
Function
newServerReporter
(m *ServerMetrics, rpcType grpcType, fullMethod string)
plugin/prometheus/server_reporter.go:20
↓ 2 callers
Function
requireValueWithRetryHistCount
(ctx context.Context, t *testing.T, expect int, o prometheus.Observer)
plugin/prometheus/server_test.go:333
↓ 2 callers
Function
splitMethodName
(fullMethodName string)
plugin/prometheus/util.go:31
↓ 2 callers
Method
state
state returns the state of the TrippableBreaker. The states available are: closed - the circuit is in a reset state and is operational open - the circ
plugin/breaker/circuitbreaker.go:348
↓ 2 callers
Function
toFloat64HistCount
toFloat64HistCount does the same thing as prometheus go client testutil.ToFloat64, but for histograms. TODO(bwplotka): Upstream this function to prome
plugin/prometheus/server_test.go:257
↓ 2 callers
Function
unixNano
now as unix nanoseconds
plugin/ratelimit/ratelimit.go:76
↓ 1 callers
Method
AddListener
AddListener adds a channel of ListenerEvents on behalf of a listener. The listener channel must be buffered.
plugin/breaker/circuitbreaker.go:183
↓ 1 callers
Function
AuthHandle
(h http.Handler)
examples/gateway/gateway_example.go:131
↓ 1 callers
Method
Break
Break trips the circuit breaker and prevents it from auto resetting. Use this when manual control over the circuit breaker state is needed.
plugin/breaker/circuitbreaker.go:232
↓ 1 callers
Method
Collect
Collect is called by the Prometheus registry when collecting metrics. The implementation sends each collected metric via the provided channel and retu
plugin/prometheus/client_metrics.go:82
↓ 1 callers
Function
ConsecutiveTripFunc
ConsecutiveTripFunc returns a TripFunc that trips whenever the consecutive failure count meets the threshold.
plugin/breaker/circuitbreaker.go:398
↓ 1 callers
Function
EnableClientHandlingTimeHistogram
EnableClientHandlingTimeHistogram turns on recording of handling time of RPCs. Histogram metrics can be very expensive for Prometheus to retain and qu
plugin/prometheus/client.go:36
↓ 1 callers
Function
EnableHandlingTimeHistogram
EnableHandlingTimeHistogram turns on recording of handling time of RPCs. Histogram metrics can be very expensive for Prometheus to retain and query. T
plugin/prometheus/server.go:45
↓ 1 callers
Method
GetValue
()
examples/pb/example.pb.go:58
↓ 1 callers
Function
NewExampleServiceClient
(cc *grpc.ClientConn)
examples/pb/example.pb.go:146
↓ 1 callers
Function
NewHTTPClientWithBreaker
NewHTTPClientWithBreaker provides a circuit breaker wrapper around http.Client. It wraps all of the regular http.Client functions using the provided B
plugin/breaker/client.go:64
↓ 1 callers
Function
ParseError
(err error)
grpc_error/error.go:158
↓ 1 callers
Function
RateTripFunc
RateTripFunc returns a TripFunc that trips whenever the error rate hits the threshold. The error rate is calculated as such: f = number of failures s
plugin/breaker/circuitbreaker.go:411
↓ 1 callers
Function
Register
Register takes a gRPC server and pre-initializes all counters to 0. This allows for easier monitoring in Prometheus (no missing metrics), and should b
plugin/prometheus/server.go:37
↓ 1 callers
Function
RegisterExampleServiceHandler
RegisterExampleServiceHandler registers the http handlers for service ExampleService to "mux". The handlers forward requests to the grpc endpoint over
examples/pb/example.pb.gw.go:75
↓ 1 callers
Function
RegisterExampleServiceHandlerClient
RegisterExampleServiceHandlerClient registers the http handlers for service ExampleService to "mux". The handlers forward requests to the grpc endpoin
examples/pb/example.pb.gw.go:84
↓ 1 callers
Method
RemoveListener
RemoveListener removes a channel previously added via AddListener. Once removed, the channel will no longer receive ListenerEvents. Returns true if th
plugin/breaker/circuitbreaker.go:190
↓ 1 callers
Method
ResetCounters
ResetCounters will reset only the failures, consecFailures, and success counters
plugin/breaker/circuitbreaker.go:220
↓ 1 callers
Method
SetServiceToken
(string)
client/client.go:139
↓ 1 callers
Method
Subscribe
Subscribe returns a channel of BreakerEvents. Whenever the breaker changes state, the state will be sent over the channel. See BreakerEvent for the ty
plugin/breaker/circuitbreaker.go:163
↓ 1 callers
Function
ThresholdTripFunc
ThresholdTripFunc returns a TripFunc with that trips whenever the failure count meets the threshold.
plugin/breaker/circuitbreaker.go:390
↓ 1 callers
Method
Time
(name string)
plugin/breaker/panel_test.go:91
next →
1–100 of 270, ranked by callers