aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go')
-rw-r--r--vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go65
1 files changed, 44 insertions, 21 deletions
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go
index 152d785..25a66d1 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go
@@ -1,30 +1,61 @@
1// Package csm provides Client Side Monitoring (CSM) which enables sending metrics 1// Package csm provides the Client Side Monitoring (CSM) client which enables
2// via UDP connection. Using the Start function will enable the reporting of 2// sending metrics via UDP connection to the CSM agent. This package provides
3// metrics on a given port. If Start is called, with different parameters, again, 3// control options, and configuration for the CSM client. The client can be
4// a panic will occur. 4// controlled manually, or automatically via the SDK's Session configuration.
5// 5//
6// Pause can be called to pause any metrics publishing on a given port. Sessions 6// Enabling CSM client via SDK's Session configuration
7// that have had their handlers modified via InjectHandlers may still be used. 7//
8// However, the handlers will act as a no-op meaning no metrics will be published. 8// The CSM client can be enabled automatically via SDK's Session configuration.
9// The SDK's session configuration enables the CSM client if the AWS_CSM_PORT
10// environment variable is set to a non-empty value.
11//
12// The configuration options for the CSM client via the SDK's session
13// configuration are:
14//
15// * AWS_CSM_PORT=<port number>
16// The port number the CSM agent will receive metrics on.
17//
18// * AWS_CSM_HOST=<hostname or ip>
19// The hostname, or IP address the CSM agent will receive metrics on.
20// Without port number.
21//
22// Manually enabling the CSM client
23//
24// The CSM client can be started, paused, and resumed manually. The Start
25// function will enable the CSM client to publish metrics to the CSM agent. It
26// is safe to call Start concurrently, but if Start is called additional times
27// with different ClientID or address it will panic.
9// 28//
10// Example:
11// r, err := csm.Start("clientID", ":31000") 29// r, err := csm.Start("clientID", ":31000")
12// if err != nil { 30// if err != nil {
13// panic(fmt.Errorf("failed starting CSM: %v", err)) 31// panic(fmt.Errorf("failed starting CSM: %v", err))
14// } 32// }
15// 33//
34// When controlling the CSM client manually, you must also inject its request
35// handlers into the SDK's Session configuration for the SDK's API clients to
36// publish metrics.
37//
16// sess, err := session.NewSession(&aws.Config{}) 38// sess, err := session.NewSession(&aws.Config{})
17// if err != nil { 39// if err != nil {
18// panic(fmt.Errorf("failed loading session: %v", err)) 40// panic(fmt.Errorf("failed loading session: %v", err))
19// } 41// }
20// 42//
43// // Add CSM client's metric publishing request handlers to the SDK's
44// // Session Configuration.
21// r.InjectHandlers(&sess.Handlers) 45// r.InjectHandlers(&sess.Handlers)
22// 46//
23// client := s3.New(sess) 47// Controlling CSM client
24// resp, err := client.GetObject(&s3.GetObjectInput{ 48//
25// Bucket: aws.String("bucket"), 49// Once the CSM client has been enabled the Get function will return a Reporter
26// Key: aws.String("key"), 50// value that you can use to pause and resume the metrics published to the CSM
27// }) 51// agent. If Get function is called before the reporter is enabled with the
52// Start function or via SDK's Session configuration nil will be returned.
53//
54// The Pause method can be called to stop the CSM client publishing metrics to
55// the CSM agent. The Continue method will resume metric publishing.
56//
57// // Get the CSM client Reporter.
58// r := csm.Get()
28// 59//
29// // Will pause monitoring 60// // Will pause monitoring
30// r.Pause() 61// r.Pause()
@@ -35,12 +66,4 @@
35// 66//
36// // Resume monitoring 67// // Resume monitoring
37// r.Continue() 68// r.Continue()
38//
39// Start returns a Reporter that is used to enable or disable monitoring. If
40// access to the Reporter is required later, calling Get will return the Reporter
41// singleton.
42//
43// Example:
44// r := csm.Get()
45// r.Continue()
46package csm 69package csm