Class Google::Cloud::Dataflow::V1beta3::Metrics::Client (v0.1.4)

Client for the Metrics service.

The Dataflow Metrics API lets you monitor the progress of Dataflow jobs.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the Metrics Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all Metrics clients
::Google::Cloud::Dataflow::V1beta3::Metrics::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the Metrics Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#get_job_execution_details

def get_job_execution_details(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::StageSummary>
def get_job_execution_details(project_id: nil, job_id: nil, location: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::StageSummary>

Request detailed information about the execution status of the job.

EXPERIMENTAL. This API is subject to change or removal without notice.

Overloads
def get_job_execution_details(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::StageSummary>
Pass arguments to get_job_execution_details via a request object, either of type GetJobExecutionDetailsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataflow::V1beta3::GetJobExecutionDetailsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_job_execution_details(project_id: nil, job_id: nil, location: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::StageSummary>
Pass arguments to get_job_execution_details via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • project_id (::String) — A project id.
  • job_id (::String) — The job to get execution details for.
  • location (::String) — The regional endpoint that contains the job specified by job_id.
  • page_size (::Integer) — If specified, determines the maximum number of stages to return. If unspecified, the service may choose an appropriate default, or may return an arbitrarily large number of results.
  • page_token (::String) — If supplied, this should be the value of next_page_token returned by an earlier call. This will cause the next page of results to be returned.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dataflow/v1beta3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dataflow::V1beta3::Metrics::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dataflow::V1beta3::GetJobExecutionDetailsRequest.new

# Call the get_job_execution_details method.
result = client.get_job_execution_details request

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::Dataflow::V1beta3::StageSummary.
  p response
end

#get_job_metrics

def get_job_metrics(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::JobMetrics
def get_job_metrics(project_id: nil, job_id: nil, start_time: nil, location: nil) -> ::Google::Cloud::Dataflow::V1beta3::JobMetrics

Request the job status.

To request the status of a job, we recommend using projects.locations.jobs.getMetrics with a regional endpoint. Using projects.jobs.getMetrics is not recommended, as you can only request the status of jobs that are running in us-central1.

Overloads
def get_job_metrics(request, options = nil) -> ::Google::Cloud::Dataflow::V1beta3::JobMetrics
Pass arguments to get_job_metrics via a request object, either of type GetJobMetricsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataflow::V1beta3::GetJobMetricsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_job_metrics(project_id: nil, job_id: nil, start_time: nil, location: nil) -> ::Google::Cloud::Dataflow::V1beta3::JobMetrics
Pass arguments to get_job_metrics via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • project_id (::String) — A project id.
  • job_id (::String) — The job to get metrics for.
  • start_time (::Google::Protobuf::Timestamp, ::Hash) — Return only metric data that has changed since this time. Default is to return all information about all metrics for the job.
  • location (::String) — The regional endpoint that contains the job specified by job_id.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dataflow/v1beta3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dataflow::V1beta3::Metrics::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dataflow::V1beta3::GetJobMetricsRequest.new

# Call the get_job_metrics method.
result = client.get_job_metrics request

# The returned object is of type Google::Cloud::Dataflow::V1beta3::JobMetrics.
p result

#get_stage_execution_details

def get_stage_execution_details(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::WorkerDetails>
def get_stage_execution_details(project_id: nil, job_id: nil, location: nil, stage_id: nil, page_size: nil, page_token: nil, start_time: nil, end_time: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::WorkerDetails>

Request detailed information about the execution status of a stage of the job.

EXPERIMENTAL. This API is subject to change or removal without notice.

Overloads
def get_stage_execution_details(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::WorkerDetails>
Pass arguments to get_stage_execution_details via a request object, either of type GetStageExecutionDetailsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Dataflow::V1beta3::GetStageExecutionDetailsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_stage_execution_details(project_id: nil, job_id: nil, location: nil, stage_id: nil, page_size: nil, page_token: nil, start_time: nil, end_time: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Dataflow::V1beta3::WorkerDetails>
Pass arguments to get_stage_execution_details via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • project_id (::String) — A project id.
  • job_id (::String) — The job to get execution details for.
  • location (::String) — The regional endpoint that contains the job specified by job_id.
  • stage_id (::String) — The stage for which to fetch information.
  • page_size (::Integer) — If specified, determines the maximum number of work items to return. If unspecified, the service may choose an appropriate default, or may return an arbitrarily large number of results.
  • page_token (::String) — If supplied, this should be the value of next_page_token returned by an earlier call. This will cause the next page of results to be returned.
  • start_time (::Google::Protobuf::Timestamp, ::Hash) — Lower time bound of work items to include, by start time.
  • end_time (::Google::Protobuf::Timestamp, ::Hash) — Upper time bound of work items to include, by start time.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/dataflow/v1beta3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dataflow::V1beta3::Metrics::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dataflow::V1beta3::GetStageExecutionDetailsRequest.new

# Call the get_stage_execution_details method.
result = client.get_stage_execution_details request

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::Dataflow::V1beta3::WorkerDetails.
  p response
end

#initialize

def initialize() { |config| ... } -> Client

Create a new Metrics client object.

Yields
  • (config) — Configure the Metrics client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Dataflow::V1beta3::Metrics::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Dataflow::V1beta3::Metrics::Client.new do |config|
  config.timeout = 10.0
end