最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

關(guān)于Spring?Cloud的熔斷器監(jiān)控問題

 更新時間:2022年01月23日 14:22:42   作者:程序貓大剛  
Turbine是一個聚合Hystrix監(jiān)控數(shù)據(jù)的工具,它可將所有相關(guān)/hystrix.stream端點的數(shù)據(jù)聚合到一個組合的/turbine.stream中,從而讓集群的監(jiān)控更加方便,接下來通過本文給大家介紹Spring?Cloud的熔斷器監(jiān)控,感興趣的朋友一起看看吧

Hystrix監(jiān)控

actuator的監(jiān)控節(jié)點

actuator下有用來監(jiān)控hystrix的端點/actuator/hystrix.stream。

訪問:

http://localhost:9202/actuator/hystrix.stream

輸出:(注意監(jiān)控時需要請求@HystrixCommand配置的微服務(wù))

ping: 

data: {"type":"HystrixCommand","name":"feignCardRand","group":"TestController","currentTime":1641272819332,"isCircuitBreakerOpen":false,"errorPercentage":0,"errorCount":0,"requestCount":1000,"rollingCountBadRequests":0,"rollingCountCollapsedRequests":0,"rollingCountEmit":0,"rollingCountExceptionsThrown":0,"rollingCountFailure":0,"rollingCountFallbackEmit":0,"rollingCountFallbackFailure":0,"rollingCountFallbackMissing":0,"rollingCountFallbackRejection":0,"rollingCountFallbackSuccess":0,"rollingCountResponsesFromCache":0,"rollingCountSemaphoreRejected":0,"rollingCountShortCircuited":0,"rollingCountSuccess":1000,"rollingCountThreadPoolRejected":0,"rollingCountTimeout":0,"currentConcurrentExecutionCount":0,"rollingMaxConcurrentExecutionCount":10,"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":1000,"propertyValue_executionTimeoutInMilliseconds":1000,"propertyValue_executionIsolationThreadInterruptOnTimeout":true,"propertyValue_executionIsolationThreadPoolKeyOverride":null,"propertyValue_executionIsolationSemaphoreMaxConcurrentRequests":10,"propertyValue_fallbackIsolationSemaphoreMaxConcurrentRequests":10,"propertyValue_metricsRollingStatisticalWindowInMilliseconds":10000,"propertyValue_requestCacheEnabled":true,"propertyValue_requestLogEnabled":true,"reportingHosts":1,"threadPool":"TestController"}

集成hystrix dashboard

接口數(shù)據(jù)查看起來不直觀,可以運行hystrix dashboard通過界面來查看。

先引入依賴

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>

創(chuàng)建啟動類

@EnableHystrixDashboard
@SpringBootApplication(scanBasePackages = "com.github.mg0324")
public class StartupApplication {
    public static void main(String[] args) {
        SpringApplication.run(StartupApplication.class,args);
    }
}

添加首頁跳轉(zhuǎn),支持端口直接到hystrix資源路徑

@Controller
public class HystrixIndexController {
  @GetMapping("")
  public String index() {
    return "forward:/hystrix";
  }
}

添加配置端口

server:
  port: 8030

hystrix:
  dashboard:
    # 設(shè)置允許連接的IP
    proxy-stream-allow-list: "192.168.3.29"

啟動服務(wù),并訪問 http://127.0.0.0:8030

監(jiān)控詳情解讀

在 Hystrix Dashboard 界面里的url處填寫要監(jiān)控的hystrix數(shù)據(jù)流地址。
如:http://192.168.3.29:9202/actuator/hystrix.stream

如果連接后的界面里什么都沒有顯示,則需要手動請求后,才能展現(xiàn)數(shù)據(jù)??梢杂?ab 命令做請求壓測,加大壓力,讓熔斷器開啟,圖中會出現(xiàn)紅色。

ab命令如下:
ab -n 10000 -c 160 http://127.0.0.1:9201/test/test/feign/cardRand

集成Turbine監(jiān)控

Turbine是一個聚合Hystrix監(jiān)控數(shù)據(jù)的工具,它可將所有相關(guān)/hystrix.stream端點的數(shù)據(jù)聚合到一個組合的/turbine.stream中,從而讓集群的監(jiān)控更加方便。

添加依賴。

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-turbine</artifactId>
</dependency>

編寫啟動類。

@EnableTurbine
@SpringBootApplication(scanBasePackages = "com.github.mg0324")
public class StartupApplication {
    public static void main(String[] args) {
        SpringApplication.run(StartupApplication.class,args);
    }
}

添加配置。

server:
  port: 8031
spring:
  application:
    name: card-hystrix-turbine
eureka:
  client:
    service-url:
      defaultZone: http://192.168.3.29:8761/eureka/
  instance:
    prefer-ip-address: true
turbine:
  # 要監(jiān)控的微服務(wù)列表,多個用,分隔
  appConfig: mic-card,mic-test
  clusterNameExpression: "'default'"

啟動服務(wù)后,得到 http://192.168.3.29:8031/turbine.stream 的聚合節(jié)點。填寫到hystrix dashboard的url中做監(jiān)控。

參考

https://www.itmuch.com/spring-cloud/finchley-15/

到此這篇關(guān)于Spring Cloud的熔斷器監(jiān)控的文章就介紹到這了,更多相關(guān)Spring Cloud 熔斷器內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • 用SpringMVC編寫一個HelloWorld的詳細(xì)過程

    用SpringMVC編寫一個HelloWorld的詳細(xì)過程

    SpringMVC是Spring的一個后續(xù)產(chǎn)品,是Spring的一個子項目<BR>SpringMVC?是?Spring?為表述層開發(fā)提供的一整套完備的解決方案,本文我們將用SpringMVC編寫一個HelloWorld,文中有詳細(xì)的編寫過程,需要的朋友可以參考下
    2023-08-08
  • java稀疏數(shù)組的示例代碼

    java稀疏數(shù)組的示例代碼

    這篇文章主要介紹了java稀疏數(shù)組,稀疏數(shù)組,記錄一共有幾行幾列,有多少個不同值,把具有不同值的元素和行里了及值記錄在一個小規(guī)模的數(shù)組中,從而縮小程序的規(guī)模,對java稀疏數(shù)組相關(guān)知識感興趣的朋友一起看看吧
    2022-07-07
  • Java中HashMap和HashTable區(qū)別

    Java中HashMap和HashTable區(qū)別

    HashMap和Hashtable都是Java常見的基于哈希表實現(xiàn)的Map接口的實現(xiàn)類,本文主要介紹了Java中HashMap和HashTable區(qū)別,具有一定的參考價值,感興趣的可以了解一下
    2023-11-11
  • Java 選擇排序、插入排序、希爾算法實例詳解

    Java 選擇排序、插入排序、希爾算法實例詳解

    這篇文章主要介紹了Java 選擇排序、插入排序、希爾算法實例詳解,需要的朋友可以參考下
    2017-05-05
  • Java文件批量重命名批量提取特定類型文件

    Java文件批量重命名批量提取特定類型文件

    這篇文章主要介紹了Java文件批量重命名批量提取特定類型文件的相關(guān)資料
    2016-08-08
  • 使用spring?data的page和pageable如何實現(xiàn)分頁查詢

    使用spring?data的page和pageable如何實現(xiàn)分頁查詢

    這篇文章主要介紹了使用spring?data的page和pageable如何實現(xiàn)分頁查詢,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-12-12
  • springboot配置redis過程詳解

    springboot配置redis過程詳解

    這篇文章主要介紹了springboot配置redis過程詳解,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2019-09-09
  • Java IO流之Properties類的使用

    Java IO流之Properties類的使用

    這篇文章主要介紹了Java IO流之Properties類的使用方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2024-08-08
  • SpringCloud超詳細(xì)講解微服務(wù)網(wǎng)關(guān)Zuul基礎(chǔ)

    SpringCloud超詳細(xì)講解微服務(wù)網(wǎng)關(guān)Zuul基礎(chǔ)

    這篇文章主要介紹了SpringCloud?Zuul微服務(wù)網(wǎng)關(guān),負(fù)載均衡,熔斷和限流,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2022-10-10
  • Hibernate緩存詳解

    Hibernate緩存詳解

    本文主要介紹了Hibernate緩存的相關(guān)知識。具有很好的參考價值,下面跟著小編一起來看下吧
    2017-02-02

最新評論

墨脱县| 景洪市| 祁门县| 扎赉特旗| 调兵山市| 西藏| 江油市| 定西市| 新乡市| 奉新县| 长兴县| 建水县| 凉城县| 年辖:市辖区| 杭锦旗| 荔浦县| 肃宁县| 衢州市| 六枝特区| 鄂伦春自治旗| 广灵县| 桦川县| 永安市| 鄂尔多斯市| 汉源县| 东乡| 贵州省| 泾川县| 达拉特旗| 乌兰浩特市| 交口县| 柏乡县| 石屏县| 德化县| 凉山| 襄樊市| 锡林郭勒盟| 秭归县| 融水| 大荔县| 沛县|