Reference documentation and code samples for the Stackdriver Logging Client class Metric.
A metric counts the number of log entries that match a given filter. You can use these metrics to create charts and alerting policies in Stackdriver Monitoring .
Example:
use Google\Cloud\Logging\LoggingClient;
$logging = new LoggingClient();
$metric = $logging->metric('my-metric');
Namespace
Google \ Cloud \ LoggingMethods
__construct
connection
Connection\ConnectionInterface
Represents a connection to Cloud Logging. This object is created by LoggingClient, and should not be instantiated outside of this client.
name
string
The metric's name.
projectId
string
The project's ID.
info
array
[optional] The metric's metadata.
exists
Check whether or not the metric exists.
Example:
if ($metric->exists()) {
echo 'Metric exists!';
}
options
array
[optional] Configuration Options
bool
delete
options
array
[optional] Configuration Options.
update
metadata
array
The data to update.
↳ description
string
A description of the metric.
↳ filter
options
array
[optional] Configuration Options.
array
info
See also:
options
array
[optional] Configuration Options.
array
reload
See also:
options
array
[optional] Configuration Options.
array
name
Returns the metric's name.
Example:
echo $metric->name();
string