diff --git a/packages/@aws-cdk/aws-neptune/README.md b/packages/@aws-cdk/aws-neptune/README.md index 095c158404535..36433215ce57e 100644 --- a/packages/@aws-cdk/aws-neptune/README.md +++ b/packages/@aws-cdk/aws-neptune/README.md @@ -152,8 +152,8 @@ Both `DatabaseCluster` and `DatabaseInstance` provide a `metric()` method to hel declare const cluster: neptune.DatabaseCluster; declare const instance: neptune.DatabaseInstance; -cluster.metric('SparqlErrors'); // cluster-level SparqlErrors metric -instance.metric('SparqlErrors') // instance-level SparqlErrors metric +cluster.metric('SparqlRequestsPerSec'); // cluster-level SparqlErrors metric +instance.metric('SparqlRequestsPerSec') // instance-level SparqlErrors metric ``` For more details on the available metrics, refer to https://docs.aws.amazon.com/neptune/latest/userguide/cw-metrics.html diff --git a/packages/@aws-cdk/aws-neptune/test/cluster.integ.snapshot/aws-cdk-neptune-integ.template.json b/packages/@aws-cdk/aws-neptune/test/cluster.integ.snapshot/aws-cdk-neptune-integ.template.json index e8def0514c82c..15290913fcbd9 100644 --- a/packages/@aws-cdk/aws-neptune/test/cluster.integ.snapshot/aws-cdk-neptune-integ.template.json +++ b/packages/@aws-cdk/aws-neptune/test/cluster.integ.snapshot/aws-cdk-neptune-integ.template.json @@ -542,7 +542,7 @@ "Alarm7103F465": { "Type": "AWS::CloudWatch::Alarm", "Properties": { - "ComparisonOperator": "GreaterThanThreshold", + "ComparisonOperator": "LessThanThreshold", "EvaluationPeriods": 1, "Dimensions": [ { @@ -552,11 +552,11 @@ } } ], - "MetricName": "SparqlErrors", + "MetricName": "SparqlRequestsPerSec", "Namespace": "AWS/Neptune", "Period": 300, - "Statistic": "Sum", - "Threshold": 0 + "Statistic": "Average", + "Threshold": 1 } } }, diff --git a/packages/@aws-cdk/aws-neptune/test/cluster.test.ts b/packages/@aws-cdk/aws-neptune/test/cluster.test.ts index 54b2ed415f131..b0b2873572eb8 100644 --- a/packages/@aws-cdk/aws-neptune/test/cluster.test.ts +++ b/packages/@aws-cdk/aws-neptune/test/cluster.test.ts @@ -671,11 +671,11 @@ describe('DatabaseCluster', () => { }); // WHEN - const metric = cluster.metric('SparqlErrors'); + const metric = cluster.metric('SparqlRequestsPerSec'); new cloudwatch.Alarm(stack, 'Alarm', { evaluationPeriods: 1, - threshold: 0, - comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD, + threshold: 1, + comparisonOperator: cloudwatch.ComparisonOperator.LESS_THAN_THRESHOLD, metric: metric, }); @@ -685,20 +685,20 @@ describe('DatabaseCluster', () => { dimensionsMap: { DBClusterIdentifier: cluster.clusterIdentifier, }, - metricName: 'SparqlErrors', + metricName: 'SparqlRequestsPerSec', })); Template.fromStack(stack).hasResourceProperties('AWS::CloudWatch::Alarm', { Namespace: 'AWS/Neptune', - MetricName: 'SparqlErrors', + MetricName: 'SparqlRequestsPerSec', Dimensions: [ { Name: 'DBClusterIdentifier', Value: stack.resolve(cluster.clusterIdentifier), }, ], - ComparisonOperator: 'GreaterThanThreshold', + ComparisonOperator: 'LessThanThreshold', EvaluationPeriods: 1, - Threshold: 0, + Threshold: 1, }); }); }); diff --git a/packages/@aws-cdk/aws-neptune/test/instance.test.ts b/packages/@aws-cdk/aws-neptune/test/instance.test.ts index 49e9e01f593c3..95e6e27d3f4ed 100644 --- a/packages/@aws-cdk/aws-neptune/test/instance.test.ts +++ b/packages/@aws-cdk/aws-neptune/test/instance.test.ts @@ -151,11 +151,11 @@ describe('DatabaseInstance', () => { }); // WHEN - const metric = instance.metric('SparqlErrors'); + const metric = instance.metric('SparqlRequestsPerSec'); new cloudwatch.Alarm(stack, 'Alarm', { evaluationPeriods: 1, - threshold: 0, - comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD, + threshold: 1, + comparisonOperator: cloudwatch.ComparisonOperator.LESS_THAN_THRESHOLD, metric: metric, }); @@ -165,20 +165,20 @@ describe('DatabaseInstance', () => { dimensionsMap: { DBInstanceIdentifier: instance.instanceIdentifier, }, - metricName: 'SparqlErrors', + metricName: 'SparqlRequestsPerSec', })); Template.fromStack(stack).hasResourceProperties('AWS::CloudWatch::Alarm', { Namespace: 'AWS/Neptune', - MetricName: 'SparqlErrors', + MetricName: 'SparqlRequestsPerSec', Dimensions: [ { Name: 'DBInstanceIdentifier', Value: stack.resolve(instance.instanceIdentifier), }, ], - ComparisonOperator: 'GreaterThanThreshold', + ComparisonOperator: 'LessThanThreshold', EvaluationPeriods: 1, - Threshold: 0, + Threshold: 1, }); }); }); diff --git a/packages/@aws-cdk/aws-neptune/test/integ.cluster.ts b/packages/@aws-cdk/aws-neptune/test/integ.cluster.ts index 8b7507e90a8e0..1b8d4156ef6f5 100644 --- a/packages/@aws-cdk/aws-neptune/test/integ.cluster.ts +++ b/packages/@aws-cdk/aws-neptune/test/integ.cluster.ts @@ -44,11 +44,11 @@ const cluster = new DatabaseCluster(stack, 'Database', { cluster.connections.allowDefaultPortFromAnyIpv4('Open to the world'); -const metric = cluster.metric('SparqlErrors', { statistic: cloudwatch.Statistic.SUM }); +const metric = cluster.metric('SparqlRequestsPerSec'); new cloudwatch.Alarm(stack, 'Alarm', { evaluationPeriods: 1, - threshold: 0, - comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD, + threshold: 1, + comparisonOperator: cloudwatch.ComparisonOperator.LESS_THAN_THRESHOLD, metric: metric, });