AWS SDK for C++

AWS SDK for C++ Version 1.11.440

Loading...
Searching...
No Matches
DefaultMonitoring.h
1
6#pragma once
7#include <aws/core/Core_EXPORTS.h>
8#include <aws/core/client/AWSClient.h>
9#include <aws/core/monitoring/MonitoringInterface.h>
10#include <aws/core/monitoring/MonitoringFactory.h>
11#include <aws/core/net/SimpleUDP.h>
12namespace Aws
13{
14 namespace Monitoring
15 {
19 class AWS_CORE_API DefaultMonitoring: public MonitoringInterface
20 {
21 public:
23 const static char DEFAULT_CSM_CONFIG_ENABLED[];
24 const static char DEFAULT_CSM_CONFIG_CLIENT_ID[];
25 const static char DEFAULT_CSM_CONFIG_HOST[];
26 const static char DEFAULT_CSM_CONFIG_PORT[];
27 const static char DEFAULT_CSM_ENVIRONMENT_VAR_ENABLED[];
28 const static char DEFAULT_CSM_ENVIRONMENT_VAR_CLIENT_ID[];
29 const static char DEFAULT_CSM_ENVIRONMENT_VAR_HOST[];
30 const static char DEFAULT_CSM_ENVIRONMENT_VAR_PORT[];
31
38 DefaultMonitoring(const Aws::String& clientId, const Aws::String& host, unsigned short port);
39
40 void* OnRequestStarted(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request) const override;
41
42 void OnRequestSucceeded(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request,
43 const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, void* context) const override;
44
45
46 void OnRequestFailed(const Aws::String& serviceName, const Aws::String& requestName, const std::shared_ptr<const Aws::Http::HttpRequest>& request,
47 const Aws::Client::HttpResponseOutcome& outcome, const CoreMetricsCollection& metricsFromCore, void* context) const override;
48
49
50 void OnRequestRetry(const Aws::String& serviceName, const Aws::String& requestName,
51 const std::shared_ptr<const Aws::Http::HttpRequest>& request, void* context) const override;
52
53
54 void OnFinish(const Aws::String& serviceName, const Aws::String& requestName,
55 const std::shared_ptr<const Aws::Http::HttpRequest>& request, void* context) const override;
56
57 static inline int GetVersion() { return DEFAULT_MONITORING_VERSION; }
58 private:
59 void CollectAndSendAttemptData(const Aws::String& serviceName, const Aws::String& requestName,
60 const std::shared_ptr<const Aws::Http::HttpRequest>& request, const Aws::Client::HttpResponseOutcome& outcome,
61 const CoreMetricsCollection& metricsFromCore, void* context) const;
62
64 Aws::String m_clientId;
65 };
66
67 class AWS_CORE_API DefaultMonitoringFactory : public MonitoringFactory
68 {
69 public:
71 };
72 } // namespace Monitoring
73} // namespace Aws
Aws::UniquePtr< MonitoringInterface > CreateMonitoringInstance() const override
DefaultMonitoring(const Aws::String &clientId, const Aws::String &host, unsigned short port)
Construct a default monitoring instance.
void OnRequestRetry(const Aws::String &serviceName, const Aws::String &requestName, const std::shared_ptr< const Aws::Http::HttpRequest > &request, void *context) const override
Once an API call retried the attempt and send the request again, this function will be called.
void * OnRequestStarted(const Aws::String &serviceName, const Aws::String &requestName, const std::shared_ptr< const Aws::Http::HttpRequest > &request) const override
This function lets you do preparation work when a http attempt(request) starts. It returns a pointer ...
void OnFinish(const Aws::String &serviceName, const Aws::String &requestName, const std::shared_ptr< const Aws::Http::HttpRequest > &request, void *context) const override
This function will always be called by the SDK to signal the implementer that this request is done....
void OnRequestFailed(const Aws::String &serviceName, const Aws::String &requestName, const std::shared_ptr< const Aws::Http::HttpRequest > &request, const Aws::Client::HttpResponseOutcome &outcome, const CoreMetricsCollection &metricsFromCore, void *context) const override
Once a Http request finished and received "Failed" response, this function will be called.
void OnRequestSucceeded(const Aws::String &serviceName, const Aws::String &requestName, const std::shared_ptr< const Aws::Http::HttpRequest > &request, const Aws::Client::HttpResponseOutcome &outcome, const CoreMetricsCollection &metricsFromCore, void *context) const override
Once a Http attempt finished and received "Succeeded" response, this function will be called.
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition AWSString.h:97
std::unique_ptr< T, D > UniquePtr
Definition AWSMemory.h:255