@aws-cdk/aws-cloudwatch
Version:
The CDK Construct Library for AWS::CloudWatch
794 lines • 498 kB
JSON
{
"version": "2",
"toolVersion": "1.58.0",
"snippets": {
"d49c979b36d1f57a507f7f95e9e2d23d003214f8bdeb16d07ea83910b08db7ea": {
"translations": {
"python": {
"source": "# fn: lambda.Function\n\n\nerrors = fn.metric_errors()",
"version": "2"
},
"csharp": {
"source": "Function fn;\n\n\nMetric errors = fn.MetricErrors();",
"version": "1"
},
"java": {
"source": "Function fn;\n\n\nMetric errors = fn.metricErrors();",
"version": "1"
},
"go": {
"source": "var fn function\n\n\nerrors := fn.metricErrors()",
"version": "1"
},
"$": {
"source": "declare const fn: lambda.Function;\n\nconst errors = fn.metricErrors();",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-cloudwatch"
},
"field": {
"field": "markdown",
"line": 27
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-cloudwatch.Metric"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const fn: lambda.Function;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as cloudwatch from '@aws-cdk/aws-cloudwatch';\nimport * as route53 from '@aws-cdk/aws-route53';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst errors = fn.metricErrors();\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n\n",
"syntaxKindCounter": {
"75": 6,
"130": 1,
"153": 1,
"169": 1,
"194": 1,
"196": 1,
"225": 2,
"242": 2,
"243": 2,
"290": 1
},
"fqnsFingerprint": "b75bb3a9d9b2452f1b355571a09bb2d42514b1b88cc82697da3748575aaafa00"
},
"7c03a3d404f91569cb80fce723ee41998a7cf14d98191192247e133b3887fe49": {
"translations": {
"python": {
"source": "hosted_zone = route53.HostedZone(self, \"MyHostedZone\", zone_name=\"example.org\")\nmetric = cloudwatch.Metric(\n namespace=\"AWS/Route53\",\n metric_name=\"DNSQueries\",\n dimensions_map={\n \"HostedZoneId\": hosted_zone.hosted_zone_id\n }\n)",
"version": "2"
},
"csharp": {
"source": "HostedZone hostedZone = new HostedZone(this, \"MyHostedZone\", new HostedZoneProps { ZoneName = \"example.org\" });\nMetric metric = new Metric(new MetricProps {\n Namespace = \"AWS/Route53\",\n MetricName = \"DNSQueries\",\n DimensionsMap = new Dictionary<string, string> {\n { \"HostedZoneId\", hostedZone.HostedZoneId }\n }\n});",
"version": "1"
},
"java": {
"source": "HostedZone hostedZone = HostedZone.Builder.create(this, \"MyHostedZone\").zoneName(\"example.org\").build();\nMetric metric = Metric.Builder.create()\n .namespace(\"AWS/Route53\")\n .metricName(\"DNSQueries\")\n .dimensionsMap(Map.of(\n \"HostedZoneId\", hostedZone.getHostedZoneId()))\n .build();",
"version": "1"
},
"go": {
"source": "hostedZone := route53.NewHostedZone(this, jsii.String(\"MyHostedZone\"), &hostedZoneProps{\n\tzoneName: jsii.String(\"example.org\"),\n})\nmetric := cloudwatch.NewMetric(&metricProps{\n\tnamespace: jsii.String(\"AWS/Route53\"),\n\tmetricName: jsii.String(\"DNSQueries\"),\n\tdimensionsMap: map[string]*string{\n\t\t\"HostedZoneId\": hostedZone.hostedZoneId,\n\t},\n})",
"version": "1"
},
"$": {
"source": "const hostedZone = new route53.HostedZone(this, 'MyHostedZone', { zoneName: \"example.org\" });\nconst metric = new cloudwatch.Metric({\n namespace: 'AWS/Route53',\n metricName: 'DNSQueries',\n dimensionsMap: {\n HostedZoneId: hostedZone.hostedZoneId\n }\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-cloudwatch"
},
"field": {
"field": "markdown",
"line": 40
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-cloudwatch.Metric",
"@aws-cdk/aws-cloudwatch.MetricProps",
"@aws-cdk/aws-route53.HostedZone",
"@aws-cdk/aws-route53.HostedZone#hostedZoneId",
"@aws-cdk/aws-route53.HostedZoneProps",
"constructs.Construct"
],
"fullSource": "// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as cloudwatch from '@aws-cdk/aws-cloudwatch';\nimport * as route53 from '@aws-cdk/aws-route53';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst hostedZone = new route53.HostedZone(this, 'MyHostedZone', { zoneName: \"example.org\" });\nconst metric = new cloudwatch.Metric({\n namespace: 'AWS/Route53',\n metricName: 'DNSQueries',\n dimensionsMap: {\n HostedZoneId: hostedZone.hostedZoneId\n }\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n\n",
"syntaxKindCounter": {
"10": 4,
"75": 13,
"104": 1,
"193": 3,
"194": 3,
"197": 2,
"225": 2,
"242": 2,
"243": 2,
"281": 5
},
"fqnsFingerprint": "246a2fbd4e692aa56cf78e29e8b695cfff1768c78645b3353df0bad9eeec7ba2"
},
"1c24d76a9416e5e1854f02b341d462fc6f2c84275adb8ba45bc9a4a4906e1bb7": {
"translations": {
"python": {
"source": "metric = cloudwatch.Metric(\n namespace=\"MyNamespace\",\n metric_name=\"MyMetric\",\n dimensions_map={\n \"ProcessingStep\": \"Download\"\n }\n)",
"version": "2"
},
"csharp": {
"source": "Metric metric = new Metric(new MetricProps {\n Namespace = \"MyNamespace\",\n MetricName = \"MyMetric\",\n DimensionsMap = new Dictionary<string, string> {\n { \"ProcessingStep\", \"Download\" }\n }\n});",
"version": "1"
},
"java": {
"source": "Metric metric = Metric.Builder.create()\n .namespace(\"MyNamespace\")\n .metricName(\"MyMetric\")\n .dimensionsMap(Map.of(\n \"ProcessingStep\", \"Download\"))\n .build();",
"version": "1"
},
"go": {
"source": "metric := cloudwatch.NewMetric(&metricProps{\n\tnamespace: jsii.String(\"MyNamespace\"),\n\tmetricName: jsii.String(\"MyMetric\"),\n\tdimensionsMap: map[string]*string{\n\t\t\"ProcessingStep\": jsii.String(\"Download\"),\n\t},\n})",
"version": "1"
},
"$": {
"source": "const metric = new cloudwatch.Metric({\n namespace: 'MyNamespace',\n metricName: 'MyMetric',\n dimensionsMap: {\n ProcessingStep: 'Download'\n }\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-cloudwatch"
},
"field": {
"field": "markdown",
"line": 56
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-cloudwatch.Metric",
"@aws-cdk/aws-cloudwatch.MetricProps"
],
"fullSource": "// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as cloudwatch from '@aws-cdk/aws-cloudwatch';\nimport * as route53 from '@aws-cdk/aws-route53';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst metric = new cloudwatch.Metric({\n namespace: 'MyNamespace',\n metricName: 'MyMetric',\n dimensionsMap: {\n ProcessingStep: 'Download'\n }\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n\n",
"syntaxKindCounter": {
"10": 3,
"75": 7,
"193": 2,
"194": 1,
"197": 1,
"225": 1,
"242": 1,
"243": 1,
"281": 4
},
"fqnsFingerprint": "087202f23cfe91448b6f603badfd0f34456db0f16bbb5a99a5e48aca326762c6"
},
"e0e6577612f4e90fca287dcf97860b1cbfd24be1756b60b03839bef859c150c7": {
"translations": {
"python": {
"source": "# fn: lambda.Function\n\n\nall_problems = cloudwatch.MathExpression(\n expression=\"errors + throttles\",\n using_metrics={\n \"errors\": fn.metric_errors(),\n \"faults\": fn.metric_throttles()\n }\n)",
"version": "2"
},
"csharp": {
"source": "Function fn;\n\n\nMathExpression allProblems = new MathExpression(new MathExpressionProps {\n Expression = \"errors + throttles\",\n UsingMetrics = new Dictionary<string, IMetric> {\n { \"errors\", fn.MetricErrors() },\n { \"faults\", fn.MetricThrottles() }\n }\n});",
"version": "1"
},
"java": {
"source": "Function fn;\n\n\nMathExpression allProblems = MathExpression.Builder.create()\n .expression(\"errors + throttles\")\n .usingMetrics(Map.of(\n \"errors\", fn.metricErrors(),\n \"faults\", fn.metricThrottles()))\n .build();",
"version": "1"
},
"go": {
"source": "var fn function\n\n\nallProblems := cloudwatch.NewMathExpression(&mathExpressionProps{\n\texpression: jsii.String(\"errors + throttles\"),\n\tusingMetrics: map[string]iMetric{\n\t\t\"errors\": fn.metricErrors(),\n\t\t\"faults\": fn.metricThrottles(),\n\t},\n})",
"version": "1"
},
"$": {
"source": "declare const fn: lambda.Function;\n\nconst allProblems = new cloudwatch.MathExpression({\n expression: \"errors + throttles\",\n usingMetrics: {\n errors: fn.metricErrors(),\n faults: fn.metricThrottles(),\n }\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-cloudwatch"
},
"field": {
"field": "markdown",
"line": 71
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-cloudwatch.IMetric",
"@aws-cdk/aws-cloudwatch.MathExpression",
"@aws-cdk/aws-cloudwatch.MathExpressionProps"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const fn: lambda.Function;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as cloudwatch from '@aws-cdk/aws-cloudwatch';\nimport * as route53 from '@aws-cdk/aws-route53';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst allProblems = new cloudwatch.MathExpression({\n expression: \"errors + throttles\",\n usingMetrics: {\n errors: fn.metricErrors(),\n faults: fn.metricThrottles(),\n }\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n\n",
"syntaxKindCounter": {
"10": 1,
"75": 14,
"130": 1,
"153": 1,
"169": 1,
"193": 2,
"194": 3,
"196": 2,
"197": 1,
"225": 2,
"242": 2,
"243": 2,
"281": 4,
"290": 1
},
"fqnsFingerprint": "8a95c14cad450e60e066f38e4e55360a750a83efd1716dfbd4e3bc9cf1607374"
},
"3c44ef26fbf1700dc2d558fdb87da7bccc962a384472ffb84411cd91e987ecd8": {
"translations": {
"python": {
"source": "# fn: lambda.Function\n# all_problems: cloudwatch.MathExpression\n\n\nproblem_percentage = cloudwatch.MathExpression(\n expression=\"(problems / invocations) * 100\",\n using_metrics={\n \"problems\": all_problems,\n \"invocations\": fn.metric_invocations()\n }\n)",
"version": "2"
},
"csharp": {
"source": "Function fn;\nMathExpression allProblems;\n\n\nMathExpression problemPercentage = new MathExpression(new MathExpressionProps {\n Expression = \"(problems / invocations) * 100\",\n UsingMetrics = new Dictionary<string, IMetric> {\n { \"problems\", allProblems },\n { \"invocations\", fn.MetricInvocations() }\n }\n});",
"version": "1"
},
"java": {
"source": "Function fn;\nMathExpression allProblems;\n\n\nMathExpression problemPercentage = MathExpression.Builder.create()\n .expression(\"(problems / invocations) * 100\")\n .usingMetrics(Map.of(\n \"problems\", allProblems,\n \"invocations\", fn.metricInvocations()))\n .build();",
"version": "1"
},
"go": {
"source": "var fn function\nvar allProblems mathExpression\n\n\nproblemPercentage := cloudwatch.NewMathExpression(&mathExpressionProps{\n\texpression: jsii.String(\"(problems / invocations) * 100\"),\n\tusingMetrics: map[string]iMetric{\n\t\t\"problems\": allProblems,\n\t\t\"invocations\": fn.metricInvocations(),\n\t},\n})",
"version": "1"
},
"$": {
"source": "declare const fn: lambda.Function;\ndeclare const allProblems: cloudwatch.MathExpression;\n\nconst problemPercentage = new cloudwatch.MathExpression({\n expression: \"(problems / invocations) * 100\",\n usingMetrics: {\n problems: allProblems,\n invocations: fn.metricInvocations()\n }\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-cloudwatch"
},
"field": {
"field": "markdown",
"line": 86
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-cloudwatch.IMetric",
"@aws-cdk/aws-cloudwatch.MathExpression",
"@aws-cdk/aws-cloudwatch.MathExpressionProps"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const fn: lambda.Function;\ndeclare const allProblems: cloudwatch.MathExpression;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as cloudwatch from '@aws-cdk/aws-cloudwatch';\nimport * as route53 from '@aws-cdk/aws-route53';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst problemPercentage = new cloudwatch.MathExpression({\n expression: \"(problems / invocations) * 100\",\n usingMetrics: {\n problems: allProblems,\n invocations: fn.metricInvocations()\n }\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n\n",
"syntaxKindCounter": {
"10": 1,
"75": 16,
"130": 2,
"153": 2,
"169": 2,
"193": 2,
"194": 2,
"196": 1,
"197": 1,
"225": 3,
"242": 3,
"243": 3,
"281": 4,
"290": 1
},
"fqnsFingerprint": "8a95c14cad450e60e066f38e4e55360a750a83efd1716dfbd4e3bc9cf1607374"
},
"9bb2a1cc3eff64a126194c3fd08d28fddda3000fe27c44ac356adc5e38ff2d96": {
"translations": {
"python": {
"source": "cpu_utilization = cloudwatch.MathExpression(\n expression=\"SEARCH('{AWS/EC2,InstanceId} MetricName=\\\"CPUUtilization\\\"', 'Average', 300)\",\n\n # Specifying '' as the label suppresses the default behavior\n # of using the expression as metric label. This is especially appropriate\n # when using expressions that return multiple time series (like SEARCH()\n # or METRICS()), to show the labels of the retrieved metrics only.\n label=\"\"\n)",
"version": "2"
},
"csharp": {
"source": "MathExpression cpuUtilization = new MathExpression(new MathExpressionProps {\n Expression = \"SEARCH('{AWS/EC2,InstanceId} MetricName=\\\"CPUUtilization\\\"', 'Average', 300)\",\n\n // Specifying '' as the label suppresses the default behavior\n // of using the expression as metric label. This is especially appropriate\n // when using expressions that return multiple time series (like SEARCH()\n // or METRICS()), to show the labels of the retrieved metrics only.\n Label = \"\"\n});",
"version": "1"
},
"java": {
"source": "MathExpression cpuUtilization = MathExpression.Builder.create()\n .expression(\"SEARCH('{AWS/EC2,InstanceId} MetricName=\\\"CPUUtilization\\\"', 'Average', 300)\")\n\n // Specifying '' as the label suppresses the default behavior\n // of using the expression as metric label. This is especially appropriate\n // when using expressions that return multiple time series (like SEARCH()\n // or METRICS()), to show the labels of the retrieved metrics only.\n .label(\"\")\n .build();",
"version": "1"
},
"go": {
"source": "cpuUtilization := cloudwatch.NewMathExpression(&mathExpressionProps{\n\texpression: jsii.String(\"SEARCH('{AWS/EC2,InstanceId} MetricName=\\\"CPUUtilization\\\"', 'Average', 300)\"),\n\n\t// Specifying '' as the label suppresses the default behavior\n\t// of using the expression as metric label. This is especially appropriate\n\t// when using expressions that return multiple time series (like SEARCH()\n\t// or METRICS()), to show the labels of the retrieved metrics only.\n\tlabel: jsii.String(\"\"),\n})",
"version": "1"
},
"$": {
"source": "const cpuUtilization = new cloudwatch.MathExpression({\n expression: \"SEARCH('{AWS/EC2,InstanceId} MetricName=\\\"CPUUtilization\\\"', 'Average', 300)\",\n\n // Specifying '' as the label suppresses the default behavior\n // of using the expression as metric label. This is especially appropriate\n // when using expressions that return multiple time series (like SEARCH()\n // or METRICS()), to show the labels of the retrieved metrics only.\n label: '',\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-cloudwatch"
},
"field": {
"field": "markdown",
"line": 105
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-cloudwatch.MathExpression",
"@aws-cdk/aws-cloudwatch.MathExpressionProps"
],
"fullSource": "// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as cloudwatch from '@aws-cdk/aws-cloudwatch';\nimport * as route53 from '@aws-cdk/aws-route53';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst cpuUtilization = new cloudwatch.MathExpression({\n expression: \"SEARCH('{AWS/EC2,InstanceId} MetricName=\\\"CPUUtilization\\\"', 'Average', 300)\",\n\n // Specifying '' as the label suppresses the default behavior\n // of using the expression as metric label. This is especially appropriate\n // when using expressions that return multiple time series (like SEARCH()\n // or METRICS()), to show the labels of the retrieved metrics only.\n label: '',\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n\n",
"syntaxKindCounter": {
"10": 2,
"75": 5,
"193": 1,
"194": 1,
"197": 1,
"225": 1,
"242": 1,
"243": 1,
"281": 2
},
"fqnsFingerprint": "d076b8f8d5159f89701271919860e1d06da34c1b313ccdeda1241e8347a71d6f"
},
"2cde04306e1a22bd62e171efa5384e4e8e27af0ee46cea9a8734eb5bd670c361": {
"translations": {
"python": {
"source": "# fn: lambda.Function\n\n\nminute_error_rate = fn.metric_errors(\n statistic=\"avg\",\n period=Duration.minutes(1),\n label=\"Lambda failure rate\"\n)",
"version": "2"
},
"csharp": {
"source": "Function fn;\n\n\nMetric minuteErrorRate = fn.MetricErrors(new MetricOptions {\n Statistic = \"avg\",\n Period = Duration.Minutes(1),\n Label = \"Lambda failure rate\"\n});",
"version": "1"
},
"java": {
"source": "Function fn;\n\n\nMetric minuteErrorRate = fn.metricErrors(MetricOptions.builder()\n .statistic(\"avg\")\n .period(Duration.minutes(1))\n .label(\"Lambda failure rate\")\n .build());",
"version": "1"
},
"go": {
"source": "var fn function\n\n\nminuteErrorRate := fn.metricErrors(&metricOptions{\n\tstatistic: jsii.String(\"avg\"),\n\tperiod: *awscdkcore.Duration.minutes(jsii.Number(1)),\n\tlabel: jsii.String(\"Lambda failure rate\"),\n})",
"version": "1"
},
"$": {
"source": "declare const fn: lambda.Function;\n\nconst minuteErrorRate = fn.metricErrors({\n statistic: 'avg',\n period: Duration.minutes(1),\n label: 'Lambda failure rate'\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-cloudwatch"
},
"field": {
"field": "markdown",
"line": 135
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-cloudwatch.Metric",
"@aws-cdk/aws-cloudwatch.MetricOptions",
"@aws-cdk/core.Duration",
"@aws-cdk/core.Duration#minutes"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const fn: lambda.Function;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as cloudwatch from '@aws-cdk/aws-cloudwatch';\nimport * as route53 from '@aws-cdk/aws-route53';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst minuteErrorRate = fn.metricErrors({\n statistic: 'avg',\n period: Duration.minutes(1),\n label: 'Lambda failure rate'\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n\n",
"syntaxKindCounter": {
"8": 1,
"10": 2,
"75": 11,
"130": 1,
"153": 1,
"169": 1,
"193": 1,
"194": 2,
"196": 2,
"225": 2,
"242": 2,
"243": 2,
"281": 3,
"290": 1
},
"fqnsFingerprint": "0403a2d3527b3542a5966cc11b3ed44ac3ea5d6f87538223070f30ed3dd59f87"
},
"c48368c3648768426d3ff9557d4d50a524f8033ec2776e226c92ecf4aeece403": {
"translations": {
"python": {
"source": "# fn: lambda.Function\n\n\nminute_error_rate = fn.metric_errors(\n statistic=\"sum\",\n period=Duration.hours(1),\n\n # Show the maximum hourly error count in the legend\n label=\"[max: ${MAX}] Lambda failure rate\"\n)",
"version": "2"
},
"csharp": {
"source": "Function fn;\n\n\nMetric minuteErrorRate = fn.MetricErrors(new MetricOptions {\n Statistic = \"sum\",\n Period = Duration.Hours(1),\n\n // Show the maximum hourly error count in the legend\n Label = \"[max: ${MAX}] Lambda failure rate\"\n});",
"version": "1"
},
"java": {
"source": "Function fn;\n\n\nMetric minuteErrorRate = fn.metricErrors(MetricOptions.builder()\n .statistic(\"sum\")\n .period(Duration.hours(1))\n\n // Show the maximum hourly error count in the legend\n .label(\"[max: ${MAX}] Lambda failure rate\")\n .build());",
"version": "1"
},
"go": {
"source": "var fn function\n\n\nminuteErrorRate := fn.metricErrors(&metricOptions{\n\tstatistic: jsii.String(\"sum\"),\n\tperiod: *awscdkcore.Duration.hours(jsii.Number(1)),\n\n\t// Show the maximum hourly error count in the legend\n\tlabel: jsii.String(\"[max: ${MAX}] Lambda failure rate\"),\n})",
"version": "1"
},
"$": {
"source": "declare const fn: lambda.Function;\n\nconst minuteErrorRate = fn.metricErrors({\n statistic: 'sum',\n period: Duration.hours(1),\n\n // Show the maximum hourly error count in the legend\n label: '[max: ${MAX}] Lambda failure rate',\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-cloudwatch"
},
"field": {
"field": "markdown",
"line": 174
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-cloudwatch.Metric",
"@aws-cdk/aws-cloudwatch.MetricOptions",
"@aws-cdk/core.Duration",
"@aws-cdk/core.Duration#hours"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const fn: lambda.Function;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as cloudwatch from '@aws-cdk/aws-cloudwatch';\nimport * as route53 from '@aws-cdk/aws-route53';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst minuteErrorRate = fn.metricErrors({\n statistic: 'sum',\n period: Duration.hours(1),\n\n // Show the maximum hourly error count in the legend\n label: '[max: ${MAX}] Lambda failure rate',\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n\n",
"syntaxKindCounter": {
"8": 1,
"10": 2,
"75": 11,
"130": 1,
"153": 1,
"169": 1,
"193": 1,
"194": 2,
"196": 2,
"225": 2,
"242": 2,
"243": 2,
"281": 3,
"290": 1
},
"fqnsFingerprint": "3945d2aa18e8771579b70b9961819dabe3de06c0504da86161687cd36713019b"
},
"c62b6e9ea6eb19cde44536cb807c284a15ba05e9615294eda4a7fc502259f55d": {
"translations": {
"python": {
"source": "# fn: lambda.Function\n\n\ncloudwatch.Alarm(self, \"Alarm\",\n metric=fn.metric_errors(),\n threshold=100,\n evaluation_periods=2\n)",
"version": "2"
},
"csharp": {
"source": "Function fn;\n\n\nnew Alarm(this, \"Alarm\", new AlarmProps {\n Metric = fn.MetricErrors(),\n Threshold = 100,\n EvaluationPeriods = 2\n});",
"version": "1"
},
"java": {
"source": "Function fn;\n\n\nAlarm.Builder.create(this, \"Alarm\")\n .metric(fn.metricErrors())\n .threshold(100)\n .evaluationPeriods(2)\n .build();",
"version": "1"
},
"go": {
"source": "var fn function\n\n\ncloudwatch.NewAlarm(this, jsii.String(\"Alarm\"), &alarmProps{\n\tmetric: fn.metricErrors(),\n\tthreshold: jsii.Number(100),\n\tevaluationPeriods: jsii.Number(2),\n})",
"version": "1"
},
"$": {
"source": "declare const fn: lambda.Function;\n\nnew cloudwatch.Alarm(this, 'Alarm', {\n metric: fn.metricErrors(),\n threshold: 100,\n evaluationPeriods: 2,\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-cloudwatch"
},
"field": {
"field": "markdown",
"line": 198
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-cloudwatch.Alarm",
"@aws-cdk/aws-cloudwatch.AlarmProps",
"@aws-cdk/aws-cloudwatch.IMetric",
"constructs.Construct"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const fn: lambda.Function;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as cloudwatch from '@aws-cdk/aws-cloudwatch';\nimport * as route53 from '@aws-cdk/aws-route53';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nnew cloudwatch.Alarm(this, 'Alarm', {\n metric: fn.metricErrors(),\n threshold: 100,\n evaluationPeriods: 2,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n\n",
"syntaxKindCounter": {
"8": 2,
"10": 1,
"75": 10,
"104": 1,
"130": 1,
"153": 1,
"169": 1,
"193": 1,
"194": 2,
"196": 1,
"197": 1,
"225": 1,
"226": 1,
"242": 1,
"243": 1,
"281": 3,
"290": 1
},
"fqnsFingerprint": "6e79e7dcfe0189242492fb93f3f778cec45c81a17088ee3486ae591176f05d95"
},
"79c88735991c2aa6796adf9e38f29a8328ece1d607bf300be6700e755aa652fd": {
"translations": {
"python": {
"source": "# fn: lambda.Function\n\n\nfn.metric_errors().create_alarm(self, \"Alarm\",\n threshold=100,\n evaluation_periods=2\n)",
"version": "2"
},
"csharp": {
"source": "Function fn;\n\n\nfn.MetricErrors().CreateAlarm(this, \"Alarm\", new CreateAlarmOptions {\n Threshold = 100,\n EvaluationPeriods = 2\n});",
"version": "1"
},
"java": {
"source": "Function fn;\n\n\nfn.metricErrors().createAlarm(this, \"Alarm\", CreateAlarmOptions.builder()\n .threshold(100)\n .evaluationPeriods(2)\n .build());",
"version": "1"
},
"go": {
"source": "var fn function\n\n\nfn.metricErrors().createAlarm(this, jsii.String(\"Alarm\"), &createAlarmOptions{\n\tthreshold: jsii.Number(100),\n\tevaluationPeriods: jsii.Number(2),\n})",
"version": "1"
},
"$": {
"source": "declare const fn: lambda.Function;\n\nfn.metricErrors().createAlarm(this, 'Alarm', {\n threshold: 100,\n evaluationPeriods: 2,\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-cloudwatch"
},
"field": {
"field": "markdown",
"line": 210
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-cloudwatch.CreateAlarmOptions",
"@aws-cdk/aws-cloudwatch.Metric#createAlarm",
"@aws-cdk/core.Construct"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const fn: lambda.Function;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as cloudwatch from '@aws-cdk/aws-cloudwatch';\nimport * as route53 from '@aws-cdk/aws-route53';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nfn.metricErrors().createAlarm(this, 'Alarm', {\n threshold: 100,\n evaluationPeriods: 2,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n\n",
"syntaxKindCounter": {
"8": 2,
"10": 1,
"75": 8,
"104": 1,
"130": 1,
"153": 1,
"169": 1,
"193": 1,
"194": 2,
"196": 2,
"225": 1,
"226": 1,
"242": 1,
"243": 1,
"281": 2,
"290": 1
},
"fqnsFingerprint": "ecd9b00a4113c7a85c9d87a2d5cb2133b2e7eaf42a1f4b221f50ed8608c77f0c"
},
"3a31b8ab4f24dc7de1dc1aa021ccae3b0074fc61ebe97ba9c528b5418a4fefcc": {
"translations": {
"python": {
"source": "import aws_cdk.aws_cloudwatch_actions as cw_actions\n# alarm: cloudwatch.Alarm\n\n\ntopic = sns.Topic(self, \"Topic\")\nalarm.add_alarm_action(cw_actions.SnsAction(topic))",
"version": "2"
},
"csharp": {
"source": "using Amazon.CDK.AWS.CloudWatch.Actions;\nAlarm alarm;\n\n\nTopic topic = new Topic(this, \"Topic\");\nalarm.AddAlarmAction(new SnsAction(topic));",
"version": "1"
},
"java": {
"source": "import software.amazon.awscdk.services.cloudwatch.actions.*;\nAlarm alarm;\n\n\nTopic topic = new Topic(this, \"Topic\");\nalarm.addAlarmAction(new SnsAction(topic));",
"version": "1"
},
"go": {
"source": "import cw_actions \"github.com/aws-samples/dummy/awscdkawscloudwatchactions\"\nvar alarm alarm\n\n\ntopic := sns.NewTopic(this, jsii.String(\"Topic\"))\nalarm.addAlarmAction(cw_actions.NewSnsAction(topic))",
"version": "1"
},
"$": {
"source": "import * as cw_actions from '@aws-cdk/aws-cloudwatch-actions';\ndeclare const alarm: cloudwatch.Alarm;\n\nconst topic = new sns.Topic(this, 'Topic');\nalarm.addAlarmAction(new cw_actions.SnsAction(topic));",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-cloudwatch"
},
"field": {
"field": "markdown",
"line": 234
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-cloudwatch-actions.SnsAction",
"@aws-cdk/aws-cloudwatch.Alarm#addAlarmAction",
"@aws-cdk/aws-cloudwatch.IAlarmAction",
"@aws-cdk/aws-sns.ITopic",
"@aws-cdk/aws-sns.Topic",
"constructs.Construct"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\nimport * as cw_actions from '@aws-cdk/aws-cloudwatch-actions';\ndeclare const alarm: cloudwatch.Alarm;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as cloudwatch from '@aws-cdk/aws-cloudwatch';\nimport * as route53 from '@aws-cdk/aws-route53';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst topic = new sns.Topic(this, 'Topic');\nalarm.addAlarmAction(new cw_actions.SnsAction(topic));\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n\n",
"syntaxKindCounter": {
"10": 2,
"75": 12,
"104": 1,
"130": 1,
"153": 1,
"169": 1,
"194": 3,
"196": 1,
"197": 2,
"225": 2,
"226": 1,
"242": 2,
"243": 2,
"254": 1,
"255": 1,
"256": 1,
"290": 1
},
"fqnsFingerprint": "fa70d9ce808da817e3a4f0c7b3066421e3844c75f6796d714b24b7063a53cfe4"
},
"c1484f351e36b25a33ad249d74d35830c5473e7ea50fe6424359174d131c5b4e": {
"translations": {
"python": {
"source": "# alarm1: cloudwatch.Alarm\n# alarm2: cloudwatch.Alarm\n# alarm3: cloudwatch.Alarm\n# alarm4: cloudwatch.Alarm\n\n\nalarm_rule = cloudwatch.AlarmRule.any_of(\n cloudwatch.AlarmRule.all_of(\n cloudwatch.AlarmRule.any_of(alarm1,\n cloudwatch.AlarmRule.from_alarm(alarm2, cloudwatch.AlarmState.OK), alarm3),\n cloudwatch.AlarmRule.not(cloudwatch.AlarmRule.from_alarm(alarm4, cloudwatch.AlarmState.INSUFFICIENT_DATA))),\n cloudwatch.AlarmRule.from_boolean(False))\n\ncloudwatch.CompositeAlarm(self, \"MyAwesomeCompositeAlarm\",\n alarm_rule=alarm_rule\n)",
"version": "2"
},
"csharp": {
"source": "Alarm alarm1;\nAlarm alarm2;\nAlarm alarm3;\nAlarm alarm4;\n\n\nIAlarmRule alarmRule = AlarmRule.AnyOf(AlarmRule.AllOf(AlarmRule.AnyOf(alarm1, AlarmRule.FromAlarm(alarm2, AlarmState.OK), alarm3), AlarmRule.Not(AlarmRule.FromAlarm(alarm4, AlarmState.INSUFFICIENT_DATA))), AlarmRule.FromBoolean(false));\n\nnew CompositeAlarm(this, \"MyAwesomeCompositeAlarm\", new CompositeAlarmProps {\n AlarmRule = alarmRule\n});",
"version": "1"
},
"java": {
"source": "Alarm alarm1;\nAlarm alarm2;\nAlarm alarm3;\nAlarm alarm4;\n\n\nIAlarmRule alarmRule = AlarmRule.anyOf(AlarmRule.allOf(AlarmRule.anyOf(alarm1, AlarmRule.fromAlarm(alarm2, AlarmState.OK), alarm3), AlarmRule.not(AlarmRule.fromAlarm(alarm4, AlarmState.INSUFFICIENT_DATA))), AlarmRule.fromBoolean(false));\n\nCompositeAlarm.Builder.create(this, \"MyAwesomeCompositeAlarm\")\n .alarmRule(alarmRule)\n .build();",
"version": "1"
},
"go": {
"source": "var alarm1 alarm\nvar alarm2 alarm\nvar alarm3 alarm\nvar alarm4 alarm\n\n\nalarmRule := cloudwatch.alarmRule.anyOf(cloudwatch.alarmRule.allOf(cloudwatch.alarmRule.anyOf(alarm1, cloudwatch.alarmRule.fromAlarm(alarm2, cloudwatch.alarmState_OK), alarm3), cloudwatch.alarmRule.not(cloudwatch.alarmRule.fromAlarm(alarm4, cloudwatch.alarmState_INSUFFICIENT_DATA))), cloudwatch.alarmRule.fromBoolean(jsii.Boolean(false)))\n\ncloudwatch.NewCompositeAlarm(this, jsii.String(\"MyAwesomeCompositeAlarm\"), &compositeAlarmProps{\n\talarmRule: alarmRule,\n})",
"version": "1"
},
"$": {
"source": "declare const alarm1: cloudwatch.Alarm;\ndeclare const alarm2: cloudwatch.Alarm;\ndeclare const alarm3: cloudwatch.Alarm;\ndeclare const alarm4: cloudwatch.Alarm;\n\nconst alarmRule = cloudwatch.AlarmRule.anyOf(\n cloudwatch.AlarmRule.allOf(\n cloudwatch.AlarmRule.anyOf(\n alarm1,\n cloudwatch.AlarmRule.fromAlarm(alarm2, cloudwatch.AlarmState.OK),\n alarm3,\n ),\n cloudwatch.AlarmRule.not(cloudwatch.AlarmRule.fromAlarm(alarm4, cloudwatch.AlarmState.INSUFFICIENT_DATA)),\n ),\n cloudwatch.AlarmRule.fromBoolean(false),\n);\n\nnew cloudwatch.CompositeAlarm(this, 'MyAwesomeCompositeAlarm', {\n alarmRule,\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-cloudwatch"
},
"field": {
"field": "markdown",
"line": 268
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-cloudwatch.AlarmRule",
"@aws-cdk/aws-cloudwatch.AlarmRule#allOf",
"@aws-cdk/aws-cloudwatch.AlarmRule#anyOf",
"@aws-cdk/aws-cloudwatch.AlarmRule#fromAlarm",
"@aws-cdk/aws-cloudwatch.AlarmRule#fromBoolean",
"@aws-cdk/aws-cloudwatch.AlarmRule#not",
"@aws-cdk/aws-cloudwatch.AlarmState",
"@aws-cdk/aws-cloudwatch.AlarmState#INSUFFICIENT_DATA",
"@aws-cdk/aws-cloudwatch.AlarmState#OK",
"@aws-cdk/aws-cloudwatch.CompositeAlarm",
"@aws-cdk/aws-cloudwatch.CompositeAlarmProps",
"@aws-cdk/aws-cloudwatch.IAlarm",
"@aws-cdk/aws-cloudwatch.IAlarmRule",
"constructs.Construct"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const alarm1: cloudwatch.Alarm;\ndeclare const alarm2: cloudwatch.Alarm;\ndeclare const alarm3: cloudwatch.Alarm;\ndeclare const alarm4: cloudwatch.Alarm;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as cloudwatch from '@aws-cdk/aws-cloudwatch';\nimport * as route53 from '@aws-cdk/aws-route53';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst alarmRule = cloudwatch.AlarmRule.anyOf(\n cloudwatch.AlarmRule.allOf(\n cloudwatch.AlarmRule.anyOf(\n alarm1,\n cloudwatch.AlarmRule.fromAlarm(alarm2, cloudwatch.AlarmState.OK),\n alarm3,\n ),\n cloudwatch.AlarmRule.not(cloudwatch.AlarmRule.fromAlarm(alarm4, cloudwatch.AlarmState.INSUFFICIENT_DATA)),\n ),\n cloudwatch.AlarmRule.fromBoolean(false),\n);\n\nnew cloudwatch.CompositeAlarm(this, 'MyAwesomeCompositeAlarm', {\n alarmRule,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n\n",
"syntaxKindCounter": {
"10": 1,
"75": 47,
"91": 1,
"104": 1,
"130": 4,
"153": 4,
"169": 4,
"193": 1,
"194": 19,
"196": 7,
"197": 1,
"225": 5,
"226": 1,
"242": 5,
"243": 5,
"282": 1,
"290": 1
},
"fqnsFingerprint": "fee41f55ebdb796ada349b0655c3d755869d1a1f81292ff128fb32225e52886f"
},
"108729d9bad0f66478ac124f1c1e4a1b7267b0308868fad209f878f7d624f0c1": {
"translations": {
"python": {
"source": "# dashboard: cloudwatch.Dashboard\n# execution_count_metric: cloudwatch.Metric\n# error_count_metric: cloudwatch.Metric\n\n\ndashboard.add_widgets(cloudwatch.GraphWidget(\n title=\"Executions vs error rate\",\n\n left=[execution_count_metric],\n\n right=[error_count_metric.with(\n statistic=\"average\",\n label=\"Error rate\",\n color=cloudwatch.Color.GREEN\n )]\n))",
"version": "2"
},
"csharp": {
"source": "Dashboard dashboard;\nMetric executionCountMetric;\nMetric errorCountMetric;\n\n\ndashboard.AddWidgets(new GraphWidget(new GraphWidgetProps {\n Title = \"Executions vs error rate\",\n\n Left = new [] { executionCountMetric },\n\n Right = new [] { errorCountMetric.With(new MetricOptions {\n Statistic = \"average\",\n Label = \"Error rate\",\n Color = Color.GREEN\n }) }\n}));",
"version": "1"
},
"java": {
"source": "Dashboard dashboard;\nMetric executionCountMetric;\nMetric errorCountMetric;\n\n\ndashboard.addWidgets(GraphWidget.Builder.create()\n .title(\"Executions vs error rate\")\n\n .left(List.of(executionCountMetric))\n\n .right(List.of(errorCountMetric.with(MetricOptions.builder()\n .statistic(\"average\")\n .label(\"Error rate\")\n .color(Color.GREEN)\n .build())))\n .build());",
"version": "1"
},
"go": {
"source": "var dashboard dashboard\nvar executionCountMetric metric\nvar errorCountMetric metric\n\n\ndashboard.addWidgets(cloudwatch.NewGraphWidget(&graphWidgetProps{\n\ttitle: jsii.String(\"Executions vs error rate\"),\n\n\tleft: []iMetric{\n\t\texecutionCountMetric,\n\t},\n\n\tright: []*iMetric{\n\t\terrorCountMetric.with(&metricOptions{\n\t\t\tstatistic: jsii.String(\"average\"),\n\t\t\tlabel: jsii.String(\"Error rate\"),\n\t\t\tcolor: cloudwatch.color_GREEN(),\n\t\t}),\n\t},\n}))",
"version": "1"
},
"$": {
"source": "declare const dashboard: cloudwatch.Dashboard;\ndeclare const executionCountMetric: cloudwatch.Metric;\ndeclare const errorCountMetric: cloudwatch.Metric;\n\ndashboard.addWidgets(new cloudwatch.GraphWidget({\n title: \"Executions vs error rate\",\n\n left: [executionCountMetric],\n\n right: [errorCountMetric.with({\n statistic: \"average\",\n label: \"Error rate\",\n color: cloudwatch.Color.GREEN,\n })]\n}));",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-cloudwatch"
},
"field": {
"field": "markdown",
"line": 331
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-cloudwatch.Color",
"@aws-cdk/aws-cloudwatch.Color#GREEN",
"@aws-cdk/aws-cloudwatch.Dashboard#addWidgets",
"@aws-cdk/aws-cloudwatch.GraphWidget",
"@aws-cdk/aws-cloudwatch.GraphWidgetProps",
"@aws-cdk/aws-cloudwatch.IWidget",
"@aws-cdk/aws-cloudwatch.Metric#with",
"@aws-cdk/aws-cloudwatch.MetricOptions"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const dashboard: cloudwatch.Dashboard;\ndeclare const executionCountMetric: cloudwatch.Metric;\ndeclare const errorCountMetric: cloudwatch.Metric;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as cloudwatch from '@aws-cdk/aws-cloudwatch';\nimport * as route53 from '@aws-cdk/aws-route53';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\ndashboard.addWidgets(new cloudwatch.GraphWidget({\n title: \"Executions vs error rate\",\n\n left: [executionCountMetric],\n\n right: [errorCountMetric.with({\n statistic: \"average\",\n label: \"Error rate\",\n color: cloudwatch.Color.GREEN,\n })]\n}));\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n\n",
"syntaxKindCounter": {
"10": 3,
"75": 25,
"130": 3,
"153": 3,
"169": 3,
"192": 2,
"193": 2,
"194": 5,
"196": 2,
"197": 1,
"225": 3,
"226": 1,
"242": 3,
"243": 3,
"281": 6,
"290": 1
},
"fqnsFingerprint": "1645fef2b75b21b1050b2ea6bda4405579544588e20fc0f2a7e37d7eb18b7f63"
},
"2e8b47815ed5ca3b937b3be6af75939cc73563b5ae737f8429adc5643fdff9c8": {
"translations": {
"python": {
"source": "# dashboard: cloudwatch.Dashboard\n\n\ndashboard.add_widgets(cloudwatch.GraphWidget(\n # ...\n\n left_annotations=[cloudwatch.HorizontalAnnotation(value=1800, label=Duration.minutes(30).to_human_string(), color=cloudwatch.Color.RED), cloudwatch.HorizontalAnnotation(value=3600, label=\"1 hour\", color=\"#2ca02c\")\n ]\n))",
"version": "2"
},
"csharp": {
"source": "Dashboard dashboard;\n\n\ndashboard.AddWidgets(new GraphWidget(new GraphWidgetProps {\n // ...\n\n LeftAnnotations = new [] { new HorizontalAnnotation { Value = 1800, Label = Duration.Minutes(30).ToHumanString(), Color = Color.RED }, new HorizontalAnnotation { Value = 3600, Label = \"1 hour\", Color = \"#2ca02c\" } }\n}));",
"version": "1"
},
"java": {
"source": "Dashboard dashboard;\n\n\ndashboard.addWidgets(GraphWidget.Builder.create()\n // ...\n\n .leftAnnotations(List.of(HorizontalAnnotation.builder().value(1800).label(Duration.minutes(30).toHumanString()).color(Color.RED).build(), HorizontalAnnotation.builder().value(3600).label(\"1 hour\").color(\"#2ca02c\").build()))\n .build());",
"version": "1"
},
"go": {
"source": "var dashboard dashboard\n\n\ndashboard.addWidgets(cloudwatch.NewGraphWidget(&graphWidgetProps{\n\t// ...\n\n\tleftAnnotations: []horizontalAnnotation{\n\t\t&horizontalAnnotation{\n\t\t\tvalue: jsii.Number(1800),\n\t\t\tlabel: *awscdkcore.Duration.minutes(jsii.Number(30)).toHumanString(),\n\t\t\tcolor: cloudwatch.color_RED(),\n\t\t},\n\t\t&horizontalAnnotation{\n\t\t\tvalue: jsii.Number(3600),\n\t\t\tlabel: jsii.String(\"1 hour\"),\n\t\t\tcolor: jsii.String(\"#2ca02c\"),\n\t\t},\n\t},\n}))",
"version": "1"
},
"$": {
"source": "de