Skip to content

Commit

Permalink
History Error Injection Client (cadence-workflow#3796)
Browse files Browse the repository at this point in the history
  • Loading branch information
yycptt authored Dec 1, 2020
1 parent f3e13b2 commit 0d10cd3
Show file tree
Hide file tree
Showing 6 changed files with 1,217 additions and 57 deletions.
10 changes: 9 additions & 1 deletion client/clientfactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,15 @@ func (cf *rpcClientFactory) NewHistoryClientWithTimeout(timeout time.Duration) (
return history.NewThriftClient(historyserviceclient.New(dispatcher.ClientConfig(common.HistoryServiceName))), nil
}

client := history.NewClient(cf.numberOfHistoryShards, timeout, common.NewClientCache(keyResolver, clientProvider), cf.logger)
client := history.NewClient(
cf.numberOfHistoryShards,
timeout,
common.NewClientCache(keyResolver, clientProvider),
cf.logger,
)
if errorRate := cf.dynConfig.GetFloat64Property(dynamicconfig.HistoryErrorInjectionRate, 0)(); errorRate != 0 {
client = history.NewErrorInjectionClient(client, errorRate, cf.logger)
}
if cf.metricsClient != nil {
client = history.NewMetricClient(client, cf.metricsClient)
}
Expand Down
Loading

0 comments on commit 0d10cd3

Please sign in to comment.