首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何检查Matrics属性是否适用于hystrix?

如何检查Matrics属性是否适用于hystrix?
EN

Stack Overflow用户
提问于 2017-06-06 18:55:14
回答 1查看 409关注 0票数 0

我的local.properties文件hystrix属性如下所示。

代码语言:javascript
复制
hystrix.command.FASTSearchPageCommand.execution.isolation.strategy=THREAD
hystrix.command.FASTSearchPageCommand.execution.isolation.semaphore.maxConcurrentRequests=10
hystrix.command.FASTSearchPageCommand.execution.isolation.thread.timeoutInMilliseconds=1000

hystrix.command.FASTSearchPageCommand.execution.timeout.disabled=true
hystrix.command.FASTSearchPageCommand.execution.timeout.enabled=false

hystrix.command.FASTSearchPageCommand.execution.isolation.thread.interruptOnTimeout=true
hystrix.command.FASTSearchPageCommand.fallback.isolation.semaphore.maxConcurrentRequests=10
hystrix.command.FASTSearchPageCommand.fallback.disabled=false
hystrix.command.FASTSearchPageCommand.fallback.enabled=true


hystrix.command.FASTSearchPageCommand.circuitBreaker.disabled=false
hystrix.command.FASTSearchPageCommand.circuitBreaker.enabled=true
hystrix.command.FASTSearchPageCommand.circuitBreaker.requestVolumeThreshold=10
hystrix.command.FASTSearchPageCommand.circuitBreaker.sleepWindowInMilliseconds=8000
hystrix.command.FASTSearchPageCommand.circuitBreaker.errorThresholdPercentage=10
hystrix.command.FASTSearchPageCommand.circuitBreaker.forceOpen=false
hystrix.command.FASTSearchPageCommand.circuitBreaker.forceClosed=false
hystrix.command.FASTSearchPageCommand.metrics.rollingStats.timeInMilliseconds=1000
hystrix.command.FASTSearchPageCommand.metrics.rollingStats.numBuckets=5
hystrix.command.FASTSearchPageCommand.metrics.rollingPercentile.enabled=true
hystrix.command.FASTSearchPageCommand.metrics.rollingPercentile.timeInMilliseconds=100
hystrix.command.FASTSearchPageCommand.metrics.rollingPercentile.bucketSize=10
hystrix.command.FASTSearchPageCommand.metrics.healthSnapshot.intervalInMilliseconds=100
fastSearch.executionTimeout=5000

那么我如何检查所有的都在工作呢?

EN

回答 1

Stack Overflow用户

发布于 2017-06-06 19:59:56

我想你可以在这里找到所有的文档:Hystrix docs

取自他们的文档的示例如下:

代码语言:javascript
复制
public class CommandThatFailsSilently extends HystrixCommand<String> {

    private final boolean throwException;

    public CommandThatFailsSilently(boolean throwException) {
        super(HystrixCommandGroupKey.Factory.asKey("FASTSearchPageCommand"));
        this.throwException = throwException;
    }

    @Override
    protected String run() {
        if (throwException) {
            throw new RuntimeException("failure from CommandThatFailsFast");
        } else {
            return "success";
        }
    }

    @Override
    protected String getFallback() {
        return null;
    }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44388104

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档