Package com.google.cloud.logging
Class MetricInfo
- java.lang.Object
-
- com.google.cloud.logging.MetricInfo
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Metric
public class MetricInfo extends Object implements Serializable
Cloud Logging metrics describe logs-based metric. The value of the metric is the number of log entries that match a logs filter (seegetFilter()).- See Also:
- Logs-based Metrics , Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMetricInfo.BuilderA builder forMetricInfoobjects.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)StringgetDescription()Returns an optional description for this metric.StringgetFilter()Returns an advanced logs filter.StringgetName()Returns the name of the metric.inthashCode()static MetricInfo.BuildernewBuilder(String name, String filter)Returns a builder forMetricInfoobjects given the name of the metric and its filter.static MetricInfoof(String name, String filter)Creates aMetricInfoobject given the name of the metric and its filter.MetricInfo.BuildertoBuilder()Returns a builder for thisMetricInfoobject.StringtoString()
-
-
-
Method Detail
-
getName
public String getName()
Returns the name of the metric. Example:severe-errors. Metric identifiers are limited to 1000 characters and can include only the following characters:A-Z,a-z,0-9, and the special characters_-.,+!*',()%/\. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.
-
getDescription
public String getDescription()
Returns an optional description for this metric. Used for documentation purpose.
-
getFilter
public String getFilter()
Returns an advanced logs filter. The value of the metric is the number of log entries that match this filter. Example:logName=projects/my-projectid/logs/syslog AND severity>=ERROR.- See Also:
- Advanced Log Filters
-
toBuilder
public MetricInfo.Builder toBuilder()
Returns a builder for thisMetricInfoobject.
-
newBuilder
public static MetricInfo.Builder newBuilder(String name, String filter)
Returns a builder forMetricInfoobjects given the name of the metric and its filter.
-
of
public static MetricInfo of(String name, String filter)
Creates aMetricInfoobject given the name of the metric and its filter.
-
-