PHP Class Google\Cloud\Logging\Metric

Example: use Google\Cloud\ServiceBuilder; $cloud = new ServiceBuilder(); $logging = $cloud->logging(); $metric = $logging->metric('my-metric');
Afficher le fichier Open project: GoogleCloudPlatform/gcloud-php

Protected Properties

Свойство Type Description
$connection Represents a connection to Stackdriver Logging.

Méthodes publiques

Méthode Description
__construct ( Google\Cloud\Logging\Connection\ConnectionInterface $connection, string $name, string $projectId, array $info = [] )
delete ( array $options = [] ) Delete the metric.
exists ( array $options = [] ) : boolean Check whether or not the metric exists.
info ( array $options = [] ) : array Retrieves the metric's details. If no metric data is cached a network request will be made to retrieve it.
name ( ) : string Returns the metric's name.
reload ( array $options = [] ) : array Triggers a network request to reload the metric's details.
update ( array $metadata, array $options = [] ) : array Update the metric. Please note this will trigger a network request if cached data is not available to perform the update with.

Method Details

__construct() public méthode

public __construct ( Google\Cloud\Logging\Connection\ConnectionInterface $connection, string $name, string $projectId, array $info = [] )
$connection Google\Cloud\Logging\Connection\ConnectionInterface Represents a connection to Cloud Logging.
$name string The metric's name.
$projectId string The project's ID.
$info array [optional] The metric's metadata.

delete() public méthode

Example: $metric->delete();
See also: https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.metrics/delete projects.metrics delete API documentation.
public delete ( array $options = [] )
$options array [optional] Configuration Options.

exists() public méthode

Example: if ($metric->exists()) { echo "Metric exists!"; }
public exists ( array $options = [] ) : boolean
$options array [optional] Configuration Options
Résultat boolean

info() public méthode

Example: $info = $metric->info(); echo $info['description'];
See also: https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.metrics#resource-logmetric LogMetric resource API documentation.
public info ( array $options = [] ) : array
$options array [optional] Configuration Options.
Résultat array

name() public méthode

Example: echo $metric->name();
public name ( ) : string
Résultat string

reload() public méthode

Example: $metric->reload(); $info = $metric->info(); echo $info['description'];
See also: https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.metrics/get projects.metrics get API documentation.
public reload ( array $options = [] ) : array
$options array [optional] Configuration Options.
Résultat array

update() public méthode

Example: $metric->update([ 'description' => 'A description for my metric.' ]);
See also: https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.metrics/update projects.metrics update API documentation.
public update ( array $metadata, array $options = [] ) : array
$metadata array { The data to update. @type string $description A description of the metric. @type string $filter An [advanced logs filter](https://cloud.google.com/logging/docs/view/advanced_filters). }
$options array [optional] Configuration Options.
Résultat array

Property Details

$connection protected_oe property

Represents a connection to Stackdriver Logging.
protected $connection