

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 计算弹性分数
<a name="calculate-score"></a>

本节中的表格说明了用于确定每种推荐类型的评分组成部分和应用程序的弹性分数的公式。 AWS Resilience Hub 由 AWS Resilience Hub 每种推荐类型的评分组成部分和应用程序的弹性分数确定的所有结果值都四舍五入到最接近的点。例如，如果实施了三分之二的警报，则分数将为 13.33（（2/3）\* 20）分。该值将四舍五入为 13 点。有关表格中公式中使用的权重的更多信息，请参见 [Weight](#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 


**计算每种建议类型的评分组件的公式**  

| 评分组件 | 说明 | Formula | 示例 | 
| --- | --- | --- | --- | 
| 测试覆盖率（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_cn/resilience-hub/latest/userguide/calculate-score.html) | 如果您实施了 AWS Resilience Hub 建议的 20 个测试中的 10 个测试并排除了 5 个测试，则测试覆盖率的计算方法如下：`T = (10 + 5) / 20`<br />即：`T = .75 or 75 points` | 
| 警报覆盖率（A） | 标准化分数（0 -100 分），基于成功实施和排除的亚马逊 CloudWatch警报数量（在 AWS Resilience Hub 推荐的亚马逊 CloudWatch 警报总数中）。 要计算弹性分数，建议的警报应处于**就绪**状态，以便 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_cn/resilience-hub/latest/userguide/calculate-score.html) | 如果您在 AWS Resilience Hub 推荐的 20 个亚马逊 CloudWatch 警报中实施了 10 个但排除了 5 个亚马逊 CloudWatch 警报，则亚马逊 CloudWatch 警报覆盖范围的计算方法如下：`A = (10 + 5) / 20`<br />即：`A = .75 or 75 points` | 
| SOP 覆盖率（S） | 标准化分数（0 -100 分）基于成功实施和排除在 AWS Resilience Hub 建议 SOPs总数中的数量。 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_cn/resilience-hub/latest/userguide/calculate-score.html) | 如果您实施了 10 个，但排除 SOPs 了 20 个 AWS Resilience Hub 建议中的 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_cn/resilience-hub/latest/userguide/calculate-score.html) | 

下表说明了用于计算整个应用程序的弹性分数的公式。 AWS Resilience Hub 


**计算弹性分数的公式**  

| 评分组件 | 说明 | Formula | 示例 | 
| --- | --- | --- | --- | 
| 应用程序的弹性分数（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_cn/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` | 

下表说明了用于计算应用程序组件 (AppComponents) 和中断类型的弹性分数的公式。 AWS Resilience Hub 但是，您只能通过以下 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 的公式**  

| 评分组件 | 说明 | Formula | 示例 | 
| --- | --- | --- | --- | 
| 每种中断类型 AppComponent 和每种中断类型的弹性得分 () RSao | 基于 AppComponent 满足每种中断类型的弹性策略的标准化分数（0 -100 分）。每 AppComponent 种中断类型的弹性分数是所有建议类型的加权平均值。即：`RSao = Weighted Average (T, A, S, P)`<br />的值`T, A, S, P`是针对和中断类型的所有推荐测试 SOPs、警报和会议弹性策略计算得出的。 AppComponent  | 使用以下公式计算每 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_cn/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`是针对的所有推荐测试 SOPs、警报和会议弹性策略计算得出的 AppComponent。 | 每 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_cn/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_cn/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` | 

## Weight
<a name="weight"></a>

AWS Resilience Hub 为每种建议类型分配总弹性分数的权重。

下表显示了警报、、测试 SOPs、会议弹性策略和中断类型的权重。中断类型包括应用程序、基础设施、可用区和区域。

**注意**  
如果您选择不为策略定义区域 RTO 或 RPO 目标，则其他中断类型的权重将相应增加，如**未定义区域时的权重**列所示。


**警报、测试 SOPs、策略目标的权重**  

| 获取建议 | 权重 | 
| --- | --- | 
| Alarms | 20 点数 | 
| SOPs | 20 点数 | 
| 测试 | 20 点数 | 
| 会议弹性策略 | 40 点数 | 


**中断类型的权重**  

| 中断类型 | 定义区域时的权重 | 未定义区域时的权重 | 
| --- | --- | --- | 
| 应用程序 | 40 点数 | 44.44 点数 | 
| 基础设施 | 30 点数 | 33.33 点数 | 
| 可用区 | 20 点数 | 22.22 点数 | 
| Region | 10 点数 | 不适用 | 