Logging/src/LoggingClient.php
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);
    }
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);
    }
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 ) ; }
Create a metric.

Example:
```
$metric = $logging->createMetric(
'my-metric',
'logName = projects/my-project/logs/my-log'
);
```

@codingStandardsIgnoreStart
@see https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.metrics/create projects.metrics create API documentation.
@codingStandardsIgnoreEnd

@param string $name The name of the metric.
@param string $filter An [advanced logs filter](https://cloud.google.com/logging/docs/view/advanced_filters).
@param array $options [optional] {
Configuration Options.

@type string $description A description of the metric.
}
@return Metric
Create a metric .