1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
// This package is designated as private and is intended for use only by the
// smithy client runtime. The exported API therein is not considered stable and
// is subject to breaking changes without notice.
package emf
import "strings"
func stripString(str string) string {
str = strings.Replace(str, " ", "", -1)
str = strings.Replace(str, "\t", "", -1)
str = strings.Replace(str, "\n", "", -1)
return str
}
var completeEntry = stripString(`
{
"_aws": {
"CloudWatchMetrics": [{
"Dimensions": [
["testDimension1", "testDimension2"]
],
"Metrics": [{
"Name": "testMetric1"
}, {
"Name": "testMetric2"
}],
"Namespace": "testNamespace"
}],
"Timestamp": 1234000
},
"testDimension1": "dim1",
"testDimension2": "dim2",
"testMetric1": 1,
"testMetric2": 2,
"testProperty1": "prop1",
"testProperty2": "prop2"
}
`)
var noMetrics = stripString(`
{
"_aws": {
"CloudWatchMetrics": [{
"Dimensions": [
["testDimension1", "testDimension2"]
],
"Metrics": [],
"Namespace": "testNamespace"
}],
"Timestamp": 1234000
},
"testDimension1": "dim1",
"testDimension2": "dim2",
"testProperty1": "prop1",
"testProperty2": "prop2"
}
`)
var noProperties = stripString(`
{
"_aws": {
"CloudWatchMetrics": [{
"Dimensions": [
["testDimension1", "testDimension2"]
],
"Metrics": [{
"Name": "testMetric1"
}, {
"Name": "testMetric2"
}],
"Namespace": "testNamespace"
}],
"Timestamp": 1234000
},
"testDimension1": "dim1",
"testDimension2": "dim2",
"testMetric1": 1,
"testMetric2": 2
}
`)
var noDimensions = stripString(`
{
"_aws": {
"CloudWatchMetrics": [{
"Dimensions": [
[]
],
"Metrics": [{
"Name": "testMetric1"
}, {
"Name": "testMetric2"
}],
"Namespace": "testNamespace"
}],
"Timestamp": 1234000
},
"testMetric1": 1,
"testMetric2": 2,
"testProperty1": "prop1",
"testProperty2": "prop2"
}
`)
|