-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
57 lines (49 loc) · 912 Bytes
/
main.go
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
package main
import (
"os"
)
func main() {
if len(os.Args) < 3 {
loginfof("%s <resourceId> <resourceRegion>", os.Args[0])
os.Exit(2)
}
resourceID := os.Args[1]
resourceRegion := os.Args[2]
config := &Config{}
err := config.loadConfig("secret.yml")
if err != nil {
logerror(err)
os.Exit(1)
}
client := NewAzureClient(config, &publicAzureEnvironment)
client.SendCustomMetric(
resourceID,
resourceRegion,
"SampleMetric1",
"SampleMetricNamespace",
1,
1,
1,
1)
client.SendCustomMetricWithDimensions(
resourceID,
resourceRegion,
"SampleMetric2",
"SampleMetricNamespace",
"SampleDimension",
"SampleDimensionValue",
1,
1,
1,
1)
client.ReadAndPrintCustomMetric(
resourceID,
"SampleMetric1",
"SampleMetricNamespace",
"")
client.ReadAndPrintCustomMetric(
resourceID,
"SampleMetric2",
"SampleMetricNamespace",
"SampleDimension%20eq%20'*'")
}