MetricsManager
public class MetricsManager
Class responsible for buffering and sending metrics to the API. Metrics are stored in a buffer and then sent at periodic intervals and only if the device has a working internect connection.
-
Controls how often buffered metrics are sent to the API. Changing this value causes the current timer to be reset.
Declaration
Swift
public var timeInterval: Int { get set } -
Current connection status
Declaration
Swift
public var connectedToNetwork: Bool { get set } -
Initialises the metrics manager
Declaration
Swift
public init(engine: QPEngine, timeInterval: Int) -
Starts the internal scheduled timer to send API data
Declaration
Swift
func start() -
Stops the current scheduled timer
Declaration
Swift
func stop() -
Queues a metric object into the internal buffer, waiting to be syncronised
Declaration
Swift
func queue(metric: BaseMetric) -
Empties the metrics buffer, serialises the events to JSON and sends them to the API.
Declaration
Swift
func flush()
MetricsManager Class Reference