Google\Cloud\Logging\LoggingClient::createMetric PHP Метод

createMetric() публичный Метод

Example: $metric = $logging->createMetric( 'my-metric', 'logName = projects/my-project/logs/my-log' );
См. также: https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.metrics/create projects.metrics create API documentation.
public createMetric ( string $name, string $filter, array $options = [] ) : Metric
$name string The name of the metric.
$filter string An [advanced logs filter](https://cloud.google.com/logging/docs/view/advanced_filters).
$options array [optional] { Configuration Options. @type string $description A description of the metric. }
Результат Metric
    public function createMetric($name, $filter, array $options = [])
    {
        $response = $this->connection->createMetric($options + ['parent' => $this->formattedProjectName, 'name' => $name, 'filter' => $filter]);
        return new Metric($this->connection, $name, $this->projectId, $response);
    }