# MetricDefinition

Specifies the metric name and regular expressions used to parse algorithm logs.

- Source: [`aws-stepfunctions-tasks/lib/sagemaker/base-types.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/sagemaker/base-types.ts#L259)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_stepfunctions_tasks as stepfunctions_tasks } from 'aws-cdk-lib';
const metricDefinition: stepfunctions_tasks.MetricDefinition = {
  name: 'name',
  regex: 'regex',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_stepfunctions_tasks as stepfunctions_tasks

metric_definition = stepfunctions_tasks.MetricDefinition(
    name="name",
    regex="regex"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.stepfunctions.tasks.*;

MetricDefinition metricDefinition = MetricDefinition.builder()
        .name("name")
        .regex("regex")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.StepFunctions.Tasks;

var metricDefinition = new MetricDefinition {
    Name = "name",
    Regex = "regex"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

metricDefinition := &MetricDefinition{
	Name: jsii.String("name"),
	Regex: jsii.String("regex"),
}
```

## Properties

- `name`: string (required) — Name of the metric.

- `regex`: string (required) — Regular expression that searches the output of a training job and gets the value of the metric.
