# Statistic

Statistic to use over the aggregation period.

- Source: [`aws-cloudwatch/lib/metric-types.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-cloudwatch/lib/metric-types.ts#L69)
- Type last changed: v2.54.0 · 7 Dec 2022

## Example

```ts
declare const matchmakingRuleSet: gamelift.MatchmakingRuleSet;
// Alarm that triggers when the per-second average of not placed matches exceed 10%
const ruleEvaluationRatio = new cloudwatch.MathExpression({
  expression: '1 - (ruleEvaluationsPassed / ruleEvaluationsFailed)',
  usingMetrics: {
    ruleEvaluationsPassed: matchmakingRuleSet.metricRuleEvaluationsPassed({ statistic: cloudwatch.Statistic.SUM }),
    ruleEvaluationsFailed: matchmakingRuleSet.metric('ruleEvaluationsFailed'),
  },
});
new cloudwatch.Alarm(this, 'Alarm', {
  metric: ruleEvaluationRatio,
  threshold: 0.1,
  evaluationPeriods: 3,
});
```

## Members

| Member | Description |
| --- | --- |
| `SAMPLE_COUNT` | The count (number) of data points used for the statistical calculation. |
| `AVERAGE` | The value of Sum / SampleCount during the specified period. |
| `SUM` | All values submitted for the matching metric added together. |
| `MINIMUM` | The lowest value observed during the specified period. |
| `MAXIMUM` | The highest value observed during the specified period. |
