

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 計算彈性分數
<a name="calculate-score"></a>

本節中的表格說明 AWS Resilience Hub 用來判斷每個建議類型的評分元件的公式，以及應用程式的彈性分數。針對每個建議類型的 AWS Resilience Hub 評分元件和應用程式的彈性分數，由 決定的所有結果值會四捨五入至最接近的點。例如，如果三個警示中有兩個已實作，則分數為 13.33 ((2/3) \* 20) 點。此值將四捨五入至 13 點。如需資料表中公式中使用的權重詳細資訊，請參閱[權重](#weight)一節。

某些評分元件只能透過 `ScoringComponentResiliencyScore` API 取得。如需此 API 的詳細資訊，請參閱 [ScoringComponentResiliencyScore](https://docs.aws.amazon.com/resilience-hub/latest/APIReference/API_ScoringComponentResiliencyScore.html)。

**資料表**
+ [**用於計算每個建議類型評分元件的公式**](#recommendation-type-coverage)
+ [**計算彈性分數的公式**](#resiliency-score)
+ [**用於計算 AppComponents 和中斷類型彈性分數的公式**](#resiliency-score-AppComponents-disruption-types)

下表說明 AWS Resilience Hub 用來計算每個建議類型的評分元件的公式。


**用於計算每個建議類型評分元件的公式**  

| 評分元件 | Description | 公式 | 範例 | 
| --- | --- | --- | --- | 
| 測試涵蓋範圍 (T) | 標準化分數 (0 - 100 分），根據成功實作和排除的測試總數，超出 AWS Resilience Hub 建議的測試總數。 若要計算彈性分數，建議的測試必須在過去 30 天內成功執行， AWS Resilience Hub 才會將其視為已實作。  | T = ((Total number of tests implemented) \+ (Total number of tests excluded)) / (Total number of tests recommended)公式的一部分如下：[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/resilience-hub/latest/userguide/calculate-score.html) | 如果您已實作 10 個測試，並在 20 AWS Resilience Hub 個建議測試中排除 5 個測試，則測試涵蓋範圍的計算方式如下：`T = (10 + 5) / 20`<br />也就是說 `T = .75 or 75 points` | 
| 警示涵蓋範圍 (A) | 根據成功實作和排除的 Amazon CloudWatch 警示數量，在 AWS Resilience Hub 建議的 Amazon CloudWatch 警示總數中，標準化分數 (0 -100 分）。 若要計算彈性分數，建議的警示應處於**就緒**狀態 AWS Resilience Hub ，讓 將其視為已實作。  | A = ((Total number of alarms implemented) \+ (Total number of alarms excluded)) / (Total number of alarms recommended)公式的一部分如下：[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/resilience-hub/latest/userguide/calculate-score.html) | 如果您已實作 10 個，並在 20 個 AWS Resilience Hub 建議的 Amazon CloudWatch 警示中排除 5 個 Amazon CloudWatch 警示，Amazon CloudWatch 警示涵蓋範圍的計算方式如下：`A = (10 + 5) / 20`<br />也就是說 `A = .75 or 75 points` | 
| SOP 涵蓋範圍 (S) | 根據成功實作和排除SOPs 總數的標準化分數 AWS Resilience Hub (0 - 100 分）。 SOPs | S = ((Total number of SOPs implemented) \+ (Total number of SOPs excluded)) / (Total number of SOPs recommended)公式的一部分如下：[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/resilience-hub/latest/userguide/calculate-score.html) | 如果您已實作 10 個，並在 20 AWS Resilience Hub 個建議的 SOPs 中排除 5 SOPs，則 SOP 涵蓋範圍的計算方式如下：`S = (10 + 5) / 20`<br />也就是說 `S = .75 or 75 points` | 
| RTO/RPO 合規 (P) | 根據應用程式符合其彈性政策的標準化分數 (0 - 100 分）。 | P = Total weights of disruption types meeting the application's resiliency policy / Total weights of all disruption types. | 如果您應用程式彈性政策僅符合可用區域 (AZ) 和基礎設施中斷類型，則彈性政策分數 (P) 的計算方式如下：[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/resilience-hub/latest/userguide/calculate-score.html) | 

下表說明 AWS Resilience Hub 用來計算整個應用程式的彈性分數的公式。


**計算彈性分數的公式**  

| 評分元件 | Description | 公式 | 範例 | 
| --- | --- | --- | --- | 
| 應用程式彈性分數 (RS) | 標準化彈性分數 (0 - 100 分），視您的應用程式是否符合其彈性政策而定。每個應用程式的彈性分數是所有建議類型的加權平均值。也就是說： RS = Weighted Average (T, A, S, P) | 每個應用程式的彈性分數是以下列公式計算： RS = (T \* Weight(T) \+`A * Weight(A) +`<br />`S * Weight(S) +`<br />`P * Weight(P)) /`<br />`(Weight(T) + Weight(A) + Weight(S) + Weight(P))` | 用來計算每個建議類型資料表涵蓋範圍的公式如下：[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/resilience-hub/latest/userguide/calculate-score.html)每個應用程式的彈性分數計算方式如下：<br />`RS = ((.75 * .2) + (.75 * .2) + (.75 * .2) + (.5 * .4)) /(.2 + .2 + .2 + .4)`<br />也就是說 `RS = .65 or 65 points` | 

下表說明 用來 AWS Resilience Hub 計算 Application Components (AppComponents) 和中斷類型的彈性分數的公式。不過，您只能透過下列 AWS Resilience Hub APIs 取得 AppComponents 和中斷類型的彈性分數：
+ 要取得的 [DescribeAppAssessment](https://docs.aws.amazon.com/resilience-hub/latest/APIReference/API_DescribeAppAssessment.html) `RSo`
+ [ListAppComponentCompliances](https://docs.aws.amazon.com/resilience-hub/latest/APIReference/API_ListAppComponentCompliances.html) 以取得 `RSao` 和 `RSA`


**用於計算 AppComponents 和中斷類型彈性分數的公式**  

| 評分元件 | Description | 公式 | 範例 | 
| --- | --- | --- | --- | 
| 每個 AppComponent 和每個中斷類型的彈性分數 (RSao) | 標準化分數 (0 - 100 分），以 AppComponent 符合每個中斷類型的彈性政策為基礎。每個 AppComponent 和每個中斷類型的彈性分數是所有建議類型的加權平均值。也就是說： `RSao = Weighted Average (T, A, S, P)`<br />的值`T, A, S, P`會針對 AppComponent 和中斷類型的所有建議測試、警示、SOPs 和會議彈性政策計算。 | 每個 AppComponent 和每個中斷類型的彈性分數使用以下公式計算：`RSao = (T * Weight(T) + `<br />`A * Weight(A) + `<br />`S * Weight(S) + `<br />`P * Weight(P)) /`<br />`(Weight(T) + Weight(A) + Weight(S) + Weight(P))` | `RSao` 所有建議類型的假設如下：[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/resilience-hub/latest/userguide/calculate-score.html)每個 AppComponent 和中斷類型的彈性分數計算方式如下：<br />`RSao = ((.75 * .2) + (.75 * .2) + (.75 * .2) + (.5 * .4)) / `(.2 \+ .2 \+ .2 \+ .4)<br />也就是說 `RSao = .65 or 65 points`  | 
| 每個 AppComponent 的彈性分數 (RSa) | 標準化分數 (0 - 100 分），以符合其彈性政策為依據。每個 AppComponent 的彈性分數是所有建議類型的加權平均值。也就是說： RSa = Weighted Average (T, A, S, P)的值`T, A, S, P`會針對 AppComponent 的所有建議測試、警示、SOPs 和符合彈性政策計算。 | 每個 AppComponent 的彈性分數是以下列公式計算：`RSa = ``(T * Weight(T) +`<br />`A * Weight(A) +`<br />`S * Weight(S) +`<br />`P * Weight(P)) /`<br />`(Weight(T) + Weight(A) + Weight(S) + Weight(P))` | `RSa` 所有建議類型的假設如下：[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/resilience-hub/latest/userguide/calculate-score.html)每個 AppComponent 的彈性分數計算方式如下：<br />`RSa = ((.75 * .2) + (.75 * .2) + (.75 * .2) + (.5 * .4)) / `(.2 \+ .2 \+ .2 \+ .4)<br />也就是說 `RSa = .65 or 65 points`  | 
| 每種中斷類型的彈性分數 (RSo) | 標準化分數 (0 - 100 分），以符合其彈性政策為依據。每個中斷類型的彈性分數是所有建議類型的加權平均值。也就是說： RSo = Weighted Average (T, A, S, P)的值`T, A, S, P`會針對中斷類型的所有建議測試、警示、SOPs 和會議彈性政策計算。 | 每個中斷類型的彈性分數是以下列公式計算：`RSo = (T * Weight(T) + A * Weight(A) + `<br />`S * Weight(S) + P * Weight(P)) /` <br />`(Weight(T) + Weight(A) + Weight(S) + Weight(P))` | `RSo` 所有建議類型的假設如下：[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/resilience-hub/latest/userguide/calculate-score.html)<br />每個中斷類型的彈性分數計算方式如下：<br />`RSo = ((.75 * .2) + (.75 * .2) + (.75 * .2) + (.5 *.4)) /`<br />`(.2 + .2 + .2 + .4)`<br />也就是說 `RSo = .65 or 65 points` | 

## 權重
<a name="weight"></a>

AWS Resilience Hub 會將權重指派給總彈性分數的每個建議類型。

下表顯示警示、SOPs、測試、會議彈性政策和中斷類型的權重。中斷類型包括應用程式、基礎設施、AZ 和區域。

**注意**  
如果您選擇不為政策定義區域性 RTO 或 RPO 目標，則**當區域未定義時，其他中斷類型的權重會相應地增加，如權重**所示。


**警示、SOPs、測試、政策目標的權重**  

| 建議類型 | Weight (粗細) | 
| --- | --- | 
| 警示 | 20 點 | 
| SOPs | 20 點 | 
| 測試 | 20 點 | 
| 會議彈性政策 | 40 點 | 


**中斷類型的權重**  

| 中斷類型 | 定義區域時的權重 | 區域未定義時的權重 | 
| --- | --- | --- | 
| 應用程式 | 40 點 | 44.44 點 | 
| 基礎設施 | 30 點 | 33.33 點 | 
| 可用區域 | 20 點 | 22.22 點 | 
| 區域 | 10 點 | N/A | 