public class EventMetricType<ExtraObject> where ExtraObject : EventExtras
This implements the developer facing API for recording events.
Instances of this class type are automatically generated by the parsers at built time, allowing developers to record events that were previously registered in the metrics.yaml file.
The Events API only exposes the
EventMetricType.record(extra:) method, which takes care of validating the input
data and making sure that limits are enforced.
The public constructor used by automatically generated metrics.
public init(_ meta: CommonMetricData, _ allowedExtraKeys: [String]? = nil)
public func record(_ properties: ExtraObject? = nil)
Returns the stored value for testing purposes only. This function will attempt to await the last task (if any) writing to the the metric’s storage engine before returning a value.
public func testGetValue(_ pingName: String? = nil) -> [RecordedEvent]?
represents the name of the ping to retrieve the metric for. Defaults to the first value in
value of the stored metric or
nilif nothing was recorded.
Returns the number of errors recorded for the given metric.
public func testGetNumRecordedErrors(_ errorType: ErrorType) -> Int32
The type of error recorded.
The number of errors recorded for the metric for the given error type.