Manages metric descriptors, monitored resource descriptors, and time series data.
Equality
Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection>
objects compare equal. Objects that compare equal share the same underlying resources.
Performance
Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.
Thread Safety
Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.
Constructors
MetricServiceClient(MetricServiceClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
MetricServiceClient const &
|
MetricServiceClient(MetricServiceClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
MetricServiceClient &&
|
MetricServiceClient(std::shared_ptr< MetricServiceConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< MetricServiceConnection >
|
opts |
Options
|
Operators
operator=(MetricServiceClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
MetricServiceClient const &
|
Returns | |
---|---|
Type | Description |
MetricServiceClient & |
operator=(MetricServiceClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
MetricServiceClient &&
|
Returns | |
---|---|
Type | Description |
MetricServiceClient & |
Functions
ListMonitoredResourceDescriptors(std::string const &, Options)
Lists monitored resource descriptors that match a filter.
This method does not require a Workspace.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The project on which to execute the request. The format is: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::api::MonitoredResourceDescriptor > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListMonitoredResourceDescriptors(google::monitoring::v3::ListMonitoredResourceDescriptorsRequest, Options)
Lists monitored resource descriptors that match a filter.
This method does not require a Workspace.
Parameters | |
---|---|
Name | Description |
request |
google::monitoring::v3::ListMonitoredResourceDescriptorsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::api::MonitoredResourceDescriptor > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetMonitoredResourceDescriptor(std::string const &, Options)
Gets a single monitored resource descriptor.
This method does not require a Workspace.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The monitored resource descriptor to get. The format is: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::MonitoredResourceDescriptor > | the result of the RPC. The response message type (google.api.MonitoredResourceDescriptor) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetMonitoredResourceDescriptor(google::monitoring::v3::GetMonitoredResourceDescriptorRequest const &, Options)
Gets a single monitored resource descriptor.
This method does not require a Workspace.
Parameters | |
---|---|
Name | Description |
request |
google::monitoring::v3::GetMonitoredResourceDescriptorRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::MonitoredResourceDescriptor > | the result of the RPC. The response message type (google.api.MonitoredResourceDescriptor) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListMetricDescriptors(std::string const &, Options)
Lists metric descriptors that match a filter.
This method does not require a Workspace.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The project on which to execute the request. The format is: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::api::MetricDescriptor > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListMetricDescriptors(google::monitoring::v3::ListMetricDescriptorsRequest, Options)
Lists metric descriptors that match a filter.
This method does not require a Workspace.
Parameters | |
---|---|
Name | Description |
request |
google::monitoring::v3::ListMetricDescriptorsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::api::MetricDescriptor > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetMetricDescriptor(std::string const &, Options)
Gets a single metric descriptor.
This method does not require a Workspace.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The metric descriptor on which to execute the request. The format is: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::MetricDescriptor > | the result of the RPC. The response message type (google.api.MetricDescriptor) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetMetricDescriptor(google::monitoring::v3::GetMetricDescriptorRequest const &, Options)
Gets a single metric descriptor.
This method does not require a Workspace.
Parameters | |
---|---|
Name | Description |
request |
google::monitoring::v3::GetMetricDescriptorRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::MetricDescriptor > | the result of the RPC. The response message type (google.api.MetricDescriptor) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateMetricDescriptor(std::string const &, google::api::MetricDescriptor const &, Options)
Creates a new metric descriptor.
The creation is executed asynchronously and callers may check the returned operation to track its progress. User-created metric descriptors define custom metrics.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The project on which to execute the request. The format is: 4 projects/[PROJECT_ID_OR_NUMBER] |
metric_descriptor |
google::api::MetricDescriptor const &
Required. The new custom metric descriptor. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::MetricDescriptor > | the result of the RPC. The response message type (google.api.MetricDescriptor) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateMetricDescriptor(google::monitoring::v3::CreateMetricDescriptorRequest const &, Options)
Creates a new metric descriptor.
The creation is executed asynchronously and callers may check the returned operation to track its progress. User-created metric descriptors define custom metrics.
Parameters | |
---|---|
Name | Description |
request |
google::monitoring::v3::CreateMetricDescriptorRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::MetricDescriptor > | the result of the RPC. The response message type (google.api.MetricDescriptor) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteMetricDescriptor(std::string const &, Options)
Deletes a metric descriptor.
Only user-created custom metrics can be deleted.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The metric descriptor on which to execute the request. The format is: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status | a |
DeleteMetricDescriptor(google::monitoring::v3::DeleteMetricDescriptorRequest const &, Options)
Deletes a metric descriptor.
Only user-created custom metrics can be deleted.
Parameters | |
---|---|
Name | Description |
request |
google::monitoring::v3::DeleteMetricDescriptorRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status | a |
ListTimeSeries(std::string const &, std::string const &, google::monitoring::v3::TimeInterval const &, google::monitoring::v3::ListTimeSeriesRequest::TimeSeriesView, Options)
Lists time series that match a filter.
This method does not require a Workspace.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The project, organization or folder on which to execute the request. The format is: |
filter |
std::string const &
Required. A monitoring filter that specifies which time series should be returned. The filter must specify a single metric type, and can additionally specify metric labels and other information. For example: |
interval |
google::monitoring::v3::TimeInterval const &
Required. The time interval for which results should be returned. Only time series that contain data points in the specified interval are included in the response. |
view |
google::monitoring::v3::ListTimeSeriesRequest::TimeSeriesView
Required. Specifies which information is returned about the time series. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::monitoring::v3::TimeSeries > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListTimeSeries(google::monitoring::v3::ListTimeSeriesRequest, Options)
Lists time series that match a filter.
This method does not require a Workspace.
Parameters | |
---|---|
Name | Description |
request |
google::monitoring::v3::ListTimeSeriesRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::monitoring::v3::TimeSeries > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
CreateTimeSeries(std::string const &, std::vector< google::monitoring::v3::TimeSeries > const &, Options)
Creates or adds data to one or more time series.
The response is empty if all time series in the request were written. If any time series could not be written, a corresponding failure message is included in the error response.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The project on which to execute the request. The format is: |
time_series |
std::vector< google::monitoring::v3::TimeSeries > const &
Required. The new data to be added to a list of time series. Adds at most one data point to each of several time series. The new data point must be more recent than any other point in its time series. Each |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status | a |
CreateTimeSeries(google::monitoring::v3::CreateTimeSeriesRequest const &, Options)
Creates or adds data to one or more time series.
The response is empty if all time series in the request were written. If any time series could not be written, a corresponding failure message is included in the error response.
Parameters | |
---|---|
Name | Description |
request |
google::monitoring::v3::CreateTimeSeriesRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status | a |
CreateServiceTimeSeries(std::string const &, std::vector< google::monitoring::v3::TimeSeries > const &, Options)
Creates or adds data to one or more service time series.
A service time series is a time series for a metric from a Google Cloud service. The response is empty if all time series in the request were written. If any time series could not be written, a corresponding failure message is included in the error response. This endpoint rejects writes to user-defined metrics. This method is only for use by Google Cloud services. Use projects.timeSeries.create instead.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The project on which to execute the request. The format is: |
time_series |
std::vector< google::monitoring::v3::TimeSeries > const &
Required. The new data to be added to a list of time series. Adds at most one data point to each of several time series. The new data point must be more recent than any other point in its time series. Each |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status | a |
CreateServiceTimeSeries(google::monitoring::v3::CreateTimeSeriesRequest const &, Options)
Creates or adds data to one or more service time series.
A service time series is a time series for a metric from a Google Cloud service. The response is empty if all time series in the request were written. If any time series could not be written, a corresponding failure message is included in the error response. This endpoint rejects writes to user-defined metrics. This method is only for use by Google Cloud services. Use projects.timeSeries.create instead.
Parameters | |
---|---|
Name | Description |
request |
google::monitoring::v3::CreateTimeSeriesRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status | a |
AsyncCreateTimeSeries(std::string const &, std::vector< google::monitoring::v3::TimeSeries > const &, Options)
Creates or adds data to one or more time series.
The response is empty if all time series in the request were written. If any time series could not be written, a corresponding failure message is included in the error response.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The project on which to execute the request. The format is: |
time_series |
std::vector< google::monitoring::v3::TimeSeries > const &
Required. The new data to be added to a list of time series. Adds at most one data point to each of several time series. The new data point must be more recent than any other point in its time series. Each |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< Status > | a |
AsyncCreateTimeSeries(google::monitoring::v3::CreateTimeSeriesRequest const &, Options)
Creates or adds data to one or more time series.
The response is empty if all time series in the request were written. If any time series could not be written, a corresponding failure message is included in the error response.
Parameters | |
---|---|
Name | Description |
request |
google::monitoring::v3::CreateTimeSeriesRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< Status > | a |