Skip to content

Commit b6a99c0

Browse files
authored
Fix documentation for setDimension (#70)
1 parent 51305b0 commit b6a99c0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ putDimensions(DimensionSet.of("Operation", "Aggregator"))
109109
putDimensions(DimensionSet.of("Operation", "Aggregator", "DeviceType", "Actuator"))
110110
```
111111

112-
- MetricsLogger **setDimensions**(DimensionSet dimensions)
112+
- MetricsLogger **setDimensions**(DimensionSet... dimensionSets)
113113

114114
Explicitly override all dimensions. This will remove the default dimensions.
115115

@@ -129,9 +129,20 @@ setDimensions(DimensionSet.of(
129129
"Operation", "Aggregator",
130130
"DeviceType", "Actuator")
131131
)
132+
```
133+
134+
To create an aggregate metric across all dimensions, you can use an empty `DimensionsSet`:
132135

136+
```java
137+
setDimensions(
138+
DimensionSet.of(
139+
"Operation", "Aggregator",
140+
"DeviceType", "Actuator"),
141+
new DimensionSet()
142+
)
133143
```
134144

145+
135146
- MetricsLogger **setNamespace**(String value)
136147

137148
Sets the CloudWatch [namespace](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Namespace) that extracted metrics should be published to. If not set, a default value of aws-embedded-metrics will be used.

0 commit comments

Comments
 (0)