Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename MetricCustomization => MetricOptions #2360

Merged
merged 1 commit into from
Apr 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions design/aws-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,9 @@ export interface IFoo extends cdk.IConstruct, ISomething {
addToPipeline(stage: pipelineapi.IStage, name: string, props?: FooActionProps): FooAction;

// metrics
metric(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric;
metricFoo(props?: cloudwatch.MetricCustomization): cloudwatch.Metric;
metricBar(props?: cloudwatch.MetricCustomization): cloudwatch.Metric;
metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
metricFoo(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
metricBar(props?: cloudwatch.MetricOptions): cloudwatch.Metric;

// export
export(): FooImportProps;
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-cloudwatch/lib/metric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class Metric {
*
* @param props The set of properties to change.
*/
public with(props: MetricCustomization): Metric {
public with(props: MetricOptions): Metric {
return new Metric({
dimensions: ifUndefined(props.dimensions, this.dimensions),
namespace: this.namespace,
Expand Down Expand Up @@ -244,7 +244,7 @@ export enum Unit {
/**
* Properties of a metric that can be changed
*/
export interface MetricCustomization {
export interface MetricOptions {
/**
* Dimensions of the metric
*
Expand Down
20 changes: 10 additions & 10 deletions packages/@aws-cdk/aws-codebuild/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export interface IProject extends IResource, iam.IGrantable {
* @param metricName The name of the metric
* @param props Customization properties
*/
metric(metricName: string, props: cloudwatch.MetricCustomization): cloudwatch.Metric;
metric(metricName: string, props: cloudwatch.MetricOptions): cloudwatch.Metric;

/**
* Measures the number of builds triggered.
Expand All @@ -89,7 +89,7 @@ export interface IProject extends IResource, iam.IGrantable {
*
* @default sum over 5 minutes
*/
metricBuilds(props?: cloudwatch.MetricCustomization): cloudwatch.Metric;
metricBuilds(props?: cloudwatch.MetricOptions): cloudwatch.Metric;

/**
* Measures the duration of all builds over time.
Expand All @@ -100,7 +100,7 @@ export interface IProject extends IResource, iam.IGrantable {
*
* @default average over 5 minutes
*/
metricDuration(props?: cloudwatch.MetricCustomization): cloudwatch.Metric;
metricDuration(props?: cloudwatch.MetricOptions): cloudwatch.Metric;

/**
* Measures the number of successful builds.
Expand All @@ -111,7 +111,7 @@ export interface IProject extends IResource, iam.IGrantable {
*
* @default sum over 5 minutes
*/
metricSucceededBuilds(props?: cloudwatch.MetricCustomization): cloudwatch.Metric;
metricSucceededBuilds(props?: cloudwatch.MetricOptions): cloudwatch.Metric;

/**
* Measures the number of builds that failed because of client error or
Expand All @@ -123,7 +123,7 @@ export interface IProject extends IResource, iam.IGrantable {
*
* @default sum over 5 minutes
*/
metricFailedBuilds(props?: cloudwatch.MetricCustomization): cloudwatch.Metric;
metricFailedBuilds(props?: cloudwatch.MetricOptions): cloudwatch.Metric;

/**
* Export this Project. Allows referencing this Project in a different CDK Stack.
Expand Down Expand Up @@ -271,7 +271,7 @@ export abstract class ProjectBase extends Resource implements IProject {
* @param metricName The name of the metric
* @param props Customization properties
*/
public metric(metricName: string, props: cloudwatch.MetricCustomization) {
public metric(metricName: string, props: cloudwatch.MetricOptions) {
return new cloudwatch.Metric({
namespace: 'AWS/CodeBuild',
metricName,
Expand All @@ -289,7 +289,7 @@ export abstract class ProjectBase extends Resource implements IProject {
*
* @default sum over 5 minutes
*/
public metricBuilds(props?: cloudwatch.MetricCustomization) {
public metricBuilds(props?: cloudwatch.MetricOptions) {
return this.metric('Builds', {
statistic: 'sum',
...props,
Expand All @@ -305,7 +305,7 @@ export abstract class ProjectBase extends Resource implements IProject {
*
* @default average over 5 minutes
*/
public metricDuration(props?: cloudwatch.MetricCustomization) {
public metricDuration(props?: cloudwatch.MetricOptions) {
return this.metric('Duration', {
statistic: 'avg',
...props
Expand All @@ -321,7 +321,7 @@ export abstract class ProjectBase extends Resource implements IProject {
*
* @default sum over 5 minutes
*/
public metricSucceededBuilds(props?: cloudwatch.MetricCustomization) {
public metricSucceededBuilds(props?: cloudwatch.MetricOptions) {
return this.metric('SucceededBuilds', {
statistic: 'sum',
...props,
Expand All @@ -338,7 +338,7 @@ export abstract class ProjectBase extends Resource implements IProject {
*
* @default sum over 5 minutes
*/
public metricFailedBuilds(props?: cloudwatch.MetricCustomization) {
public metricFailedBuilds(props?: cloudwatch.MetricOptions) {
return this.metric('FailedBuilds', {
statistic: 'sum',
...props,
Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-ec2/lib/vpn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class VpnConnection extends cdk.Construct implements IVpnConnection {
/**
* Return the given named metric for all VPN connections in the account/region.
*/
public static metricAll(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric {
public static metricAll(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric {
return new cloudwatch.Metric({
namespace: 'AWS/VPN',
metricName,
Expand All @@ -115,7 +115,7 @@ export class VpnConnection extends cdk.Construct implements IVpnConnection {
*
* @default average over 5 minutes
*/
public static metricAllTunnelState(props?: cloudwatch.MetricCustomization): cloudwatch.Metric {
public static metricAllTunnelState(props?: cloudwatch.MetricOptions): cloudwatch.Metric {
return this.metricAll('TunnelSate', { statistic: 'avg', ...props });
}

Expand All @@ -124,7 +124,7 @@ export class VpnConnection extends cdk.Construct implements IVpnConnection {
*
* @default sum over 5 minutes
*/
public static metricAllTunnelDataIn(props?: cloudwatch.MetricCustomization): cloudwatch.Metric {
public static metricAllTunnelDataIn(props?: cloudwatch.MetricOptions): cloudwatch.Metric {
return this.metricAll('TunnelDataIn', { statistic: 'sum', ...props });
}

Expand All @@ -133,7 +133,7 @@ export class VpnConnection extends cdk.Construct implements IVpnConnection {
*
* @default sum over 5 minutes
*/
public static metricAllTunnelDataOut(props?: cloudwatch.MetricCustomization): cloudwatch.Metric {
public static metricAllTunnelDataOut(props?: cloudwatch.MetricOptions): cloudwatch.Metric {
return this.metricAll('TunnelDataOut', { statistic: 'sum', ...props });
}

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ecs/lib/base/base-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export abstract class BaseService extends cdk.Construct
/**
* Return the given named metric for this Service
*/
public metric(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric {
public metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric {
return new cloudwatch.Metric({
namespace: 'AWS/ECS',
metricName,
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-ecs/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export class Cluster extends Resource implements ICluster {
*
* @default average over 5 minutes
*/
public metricCpuReservation(props?: cloudwatch.MetricCustomization): cloudwatch.Metric {
public metricCpuReservation(props?: cloudwatch.MetricOptions): cloudwatch.Metric {
return this.metric('CPUReservation', props);
}

Expand All @@ -208,14 +208,14 @@ export class Cluster extends Resource implements ICluster {
*
* @default average over 5 minutes
*/
public metricMemoryReservation(props?: cloudwatch.MetricCustomization): cloudwatch.Metric {
public metricMemoryReservation(props?: cloudwatch.MetricOptions): cloudwatch.Metric {
return this.metric('MemoryReservation', props );
}

/**
* Return the given named metric for this Cluster
*/
public metric(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric {
public metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric {
return new cloudwatch.Metric({
namespace: 'AWS/ECS',
metricName,
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export class Ec2Service extends BaseService implements elb.ILoadBalancerTarget {
/**
* Return the given named metric for this Service
*/
public metric(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric {
public metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric {
return new cloudwatch.Metric({
namespace: 'AWS/ECS',
metricName,
Expand All @@ -217,7 +217,7 @@ export class Ec2Service extends BaseService implements elb.ILoadBalancerTarget {
*
* @default average over 5 minutes
*/
public metricMemoryUtilization(props?: cloudwatch.MetricCustomization): cloudwatch.Metric {
public metricMemoryUtilization(props?: cloudwatch.MetricOptions): cloudwatch.Metric {
return this.metric('MemoryUtilization', props );
}

Expand All @@ -226,7 +226,7 @@ export class Ec2Service extends BaseService implements elb.ILoadBalancerTarget {
*
* @default average over 5 minutes
*/
public metricCpuUtilization(props?: cloudwatch.MetricCustomization): cloudwatch.Metric {
public metricCpuUtilization(props?: cloudwatch.MetricOptions): cloudwatch.Metric {
return this.metric('CPUUtilization', props);
}

Expand Down
Loading