欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

SpringCloud關(guān)于:SpringCloudNetflixHystrix

服務(wù)短路(CircuitBreaker)

榆樹網(wǎng)站建設(shè)公司成都創(chuàng)新互聯(lián),榆樹網(wǎng)站設(shè)計(jì)制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為榆樹1000+提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)網(wǎng)站制作要多少錢,請(qǐng)找那個(gè)售后服務(wù)好的榆樹做網(wǎng)站的公司定做!

QPS:Query Per Second

TPS:Transaction Per Second

QPS:經(jīng)過全鏈路壓測(cè),計(jì)算單機(jī)極限QPS,集群QPS=單機(jī)PQS*集群機(jī)器數(shù)量*可靠性比率

全鏈路壓測(cè),除了壓極限QPS,還有錯(cuò)誤數(shù)量

全鏈路:一個(gè)完整的業(yè)務(wù)流程操作

JMeter:可調(diào)整型比較靈活

Spring Cloud Hystrix Client

官網(wǎng):https://github.com/Netflix/Hystrix

Reactive Java框架:

java9 Flow API

Reactor

RxJava(Reactive X)

激活Hystrix

通過@EnableHystrix激活

配置信息wiki:https//github.com/Netflix/Hystrix/wiki/Configuration

Hystrix

1. 注解方式

@HystrixCommand(defaultFallback= "errorContent",commandProperties =

{@HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds",value= "100")})

@GetMapping("/user/count")

public String userCount() throws InterruptedException {

Random random = new Random();

int nextInt = random.nextInt(200);

System.out.println("random time > "+nextInt);

Thread.sleep(nextInt);

return userService.userCount();

}

public String errorContent() {

System.out.println("超時(shí)了");

return "-1";

}

2. 編程方式

@GetMapping("/user/count2")

public String userCount2() {

return new MyHystrixCommand().execute();

}

private class MyHystrixCommand extends com.netflix.hystrix.HystrixCommand{

protected MyHystrixCommand() {

super(HystrixCommandGroupKey.Factory.asKey(""), 100);

}

@Override

protected String run() throws Exception {

Random random = new Random();

int nextInt = random.nextInt(200);

System.out.println("random time > "+nextInt);

Thread.sleep(nextInt);

return "OK";

}

@Override

protected String getFallback() {

return UserServiceProviderRestApiController.this.errorContent();

}

}

對(duì)比其他Java執(zhí)行方式:

Feature

public class FutrueDemo {

public static void main(String[] args) {

Random random = new Random();

ExecutorService service = Executors.newFixedThreadPool(1);

Future futrue = service.submit(() -> {

int value = random.nextInt(200);

System.out.print("睡眠"+value+"ms.");

Thread.sleep(value);

return "OK";

});

try {

futrue.get(100,TimeUnit.MILLISECONDS);

}catch (Exception e) {

System.out.println("超時(shí)保護(hù)...");

}

service.shutdown();

}

}

Health Endpoint (/actuator/health)

{

"status": "UP",

"details": {

"diskSpace": {

"status": "UP",

"details": {

"total": 140382552064,

"free": 7376781312,

"threshold": 10485760

}

},

"refreshScope": {

"status": "UP"

},

"discoveryComposite": {

"status": "UP",

"details": {

"discoveryClient": {

"status": "UP",

"details": {

"services": ["user-service-consumer", "user-service-provider", "eureka-server"]

}

},

"eureka": {

"description": "Remote status from Eureka server",

"status": "UP",

"details": {

"applications": {

"USER-SERVICE-CONSUMER": 1,

"EUREKA-SERVER": 2,

"USER-SERVICE-PROVIDER": 2

}

}

}

}

},

"hystrix": {

"status": "UP"

}

}

}

激活熔斷保護(hù) 無錫婦科醫(yī)院排行 http://www.0510bhyy.com/

@EnableCircuitBreaker 激活:@EnableHystrix + Spring Cloud功能

@EnableHystrix 激活,沒有一些Spring Cloud功能,如 /hystrix.stream

hystrix Endpoint(/actuator/hystrix.stream)

data: {

"type": "HystrixCommand",

"name": "MyHystrixCommand",

"group": "",

"currentTime": 1563720628038,

"isCircuitBreakerOpen": false,

"errorPercentage": 50,

"errorCount": 2,

"requestCount": 4,

"rollingCountBadRequests": 0,

"rollingCountCollapsedRequests": 0,

"rollingCountEmit": 0,

"rollingCountExceptionsThrown": 0,

"rollingCountFailure": 0,

"rollingCountFallbackEmit": 0,

"rollingCountFallbackFailure": 0,

"rollingCountFallbackMissing": 0,

"rollingCountFallbackRejection": 0,

"rollingCountFallbackSuccess": 1,

"rollingCountResponsesFromCache": 0,

"rollingCountSemaphoreRejected": 0,

"rollingCountShortCircuited": 0,

"rollingCountSuccess": 2,

"rollingCountThreadPoolRejected": 0,

"rollingCountTimeout": 1,

"currentConcurrentExecutionCount": 0,

"rollingMaxConcurrentExecutionCount": 1,

"latencyExecute_mean": 0,

"latencyExecute": {

"0": 0,

"25": 0,

"50": 0,

"75": 0,

"90": 0,

"95": 0,

"99": 0,

"99.5": 0,

"100": 0

},

"latencyTotal_mean": 0,

"latencyTotal": {

"0": 0,

"25": 0,

"50": 0,

"75": 0,

"90": 0,

"95": 0,

"99": 0,

"99.5": 0,

"100": 0

},

"propertyValue_circuitBreakerRequestVolumeThreshold": 20,

"propertyValue_circuitBreakerSleepWindowInMilliseconds": 5000,

"propertyValue_circuitBreakerErrorThresholdPercentage": 50,

"propertyValue_circuitBreakerForceOpen": false,

"propertyValue_circuitBreakerForceClosed": false,

"propertyValue_circuitBreakerEnabled": true,

"propertyValue_executionIsolationStrategy": "THREAD",

"propertyValue_executionIsolationThreadTimeoutInMilliseconds": 100,

"propertyValue_executionTimeoutInMilliseconds": 100,

"propertyValue_executionIsolationThreadInterruptOnTimeout": true,

"propertyValue_executionIsolationThreadPoolKeyOverride": null,

"propertyValue_executionIsolationSemaphoreMaxConcurrentRequests": 10,

"propertyValue_fallbackIsolationSemaphoreMaxConcurrentRequests": 10,

"propertyValue_metricsRollingStatisticalWindowInMilliseconds": 10000,

"propertyValue_requestCacheEnabled": true,

"propertyValue_requestLogEnabled": true,

"reportingHosts": 1,

"threadPool": ""

}

Spring Cloud Hystrix Dashboard

使用@EnableHystrixDashboard激活

@SpringBootApplication

@EnableHystrixDashboard

public class SpringCloudHystrixDashboardApplication {

public static void main(String[] args) {

SpringApplication.run(SpringCloudHystrixDashboardApplication.class, args);

}

}

當(dāng)前標(biāo)題:SpringCloud關(guān)于:SpringCloudNetflixHystrix
地址分享:http://www.aaarwkj.com/article16/psdodg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供做網(wǎng)站、用戶體驗(yàn)、面包屑導(dǎo)航、搜索引擎優(yōu)化電子商務(wù)、外貿(mào)建站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站制作
色呦呦视频在线免费观看| 97精品少妇一区二区三区| 日本欧美一区二区精品| 精品国产熟女成人av| 欧美日韩一区二区综合在线视频| 久久久久久国产综合精品| 麻豆国产免费av在线| 精品人妻av中文字幕乱| 深夜视频在线观看成人| 国产黄片免费高清观看| 亚洲一区免费在线视频| 日本黄色高清视频一区| 日本在线一区二区三区| 日韩久久精品国产亚洲av成人| 精品少妇人妻一区二区三区| 嫩草网站国产精品一区二| 日韩成人中文字幕电影| 日本黄色大波少妇网站| 亚洲成av人片一区二久久精品| 日本欧美精品一区二区精选| 国产成人综合亚洲欧美在线| 九九久久精品久久久精品| 日韩精品日本道欧美黄片 | 91亚洲蜜桃内射后入在线观看| 中文字幕日韩精品国产| 五月婷婷丁香综合中文字幕| 丰满人妻大屁一区二区| av影片天堂在线观看| 亚洲综合久久五月天| 濑亚美莉在线观看一区二区三区| 欧美丰满老妇性猛交| 中文字幕二区三区av| 亚洲偷拍自拍在线观看| 国产精品精品久久久久久| 少妇精品偷拍高潮少妇在线观看| 老熟妇仑乱换频一区二区| 最新日韩中文字幕在线播放| av一区二区三区三| 日韩国产一区二区三区精品| 国产av一区二区三区| 久久久久久精品妇女|