Udemy 課程Microservices with Spring 17
首先加入必要的dependency
hal-Hypertext Application Language解說
基本解說就一句:
HAL is a simple format that gives a consistent and easy way to hyperlink between resources in your API.
監控模式會變成網頁
舊版Spring Boot網頁會在:
http://localhost:8080/application
新版改在:
http://localhost:8080/actuator
來到對應網址就會見到(因為我port改在8089)
進到圖上提供的網址列會看到各種資訊
看起來很多資訊沒有on起來
所以要改寫其中的設定properties
在application.properties檔內打上:
management.endpoints.web.exposure.include=*
再次啟動程式:
但請記得這些監控或多或少都會影響效能
另外進到http://localhost:8089會見到
例如點到bean後面的箭頭
會看到spring boot協助建的Bean
其中比較重要的是:
點箭頭進去看到右邊一堆資訊
例如上圖紅框的記憶體上限,複製文字,貼到左上後端
按Go!後
就看到相關數值:
其它還有像是誰調用了api,可以使用httptrace
出現各api調用資訊:
但是記得這些東西不該啟用在正式環境,都會影響效能
目前專案置於"restful-web-services_6"