Google\Cloud\Logging\V2\MetricsServiceV2Client::getLogMetric PHP 메소드

getLogMetric() 공개 메소드

Sample code: try { $metricsServiceV2Client = new MetricsServiceV2Client(); $formattedMetricName = MetricsServiceV2Client::formatMetricName("[PROJECT]", "[METRIC]"); $response = $metricsServiceV2Client->getLogMetric($formattedMetricName); } finally { if (isset($metricsServiceV2Client)) { $metricsServiceV2Client->close(); } }
public getLogMetric ( string $metricName, array $optionalArgs = [] ) : google\logging\v2\LogMetric
$metricName string The resource name of the desired metric: "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
$optionalArgs array { Optional. @type \Google\GAX\RetrySettings $retrySettings Retry settings to use for this call. If present, then $timeoutMillis is ignored. @type int $timeoutMillis Timeout to use for this call. Only used if $retrySettings is not set. }
리턴 google\logging\v2\LogMetric
    public function getLogMetric($metricName, $optionalArgs = [])
    {
        $request = new GetLogMetricRequest();
        $request->setMetricName($metricName);
        $mergedSettings = $this->defaultCallSettings['getLogMetric']->merge(new CallSettings($optionalArgs));
        $callable = ApiCallable::createApiCall($this->metricsServiceV2Stub, 'GetLogMetric', $mergedSettings, $this->descriptors['getLogMetric']);
        return $callable($request, [], ['call_credentials_callback' => $this->createCredentialsCallback()]);
    }