Inherits from NSObject
Declared in KNYMetricsService.h

Overview

KNYMetricsService

Properties

flowTag

Flow Tag for the metrics events. Set to nil to clear previously set flowTag. length cannot be more than 256.

@property (nonatomic, readwrite) NSString *flowTag

Discussion

Flow Tag for the metrics events. Set to nil to clear previously set flowTag. length cannot be more than 256.

Declared In

KNYMetricsService.h

userId

userid related to metrics. userid length cannot be more than 100.

@property (nonatomic, readwrite) NSString *userId

Discussion

userid related to metrics. userid length cannot be more than 100.

Declared In

KNYMetricsService.h

Class Methods

sharedMetricsService

Throws exception, when invoked before initialializing the KNYClient.

+ (instancetype)sharedMetricsService

Return Value

Returns the shared instance of KNYMetricsService

Discussion

Throws exception, when invoked before initialializing the KNYClient.

Declared In

KNYMetricsService.h

Instance Methods

eventsInBuffer

This method will return the a List of the buffered events.

- (NSDictionary *)eventsInBuffer

Return Value

returns dictionary of events stored in buffer.

Discussion

This method will return the a List of the buffered events.

Declared In

KNYMetricsService.h

flushEvents

This method will send the buffered events to the server at once.

- (void)flushEvents

Discussion

This method will send the buffered events to the server at once.

Declared In

KNYMetricsService.h

init

- (id)init

reportError:errorType:errorMessage:errorDetails:

report error to metrics server

- (void)reportError:(NSString *)errorCode errorType:(NSString *)errorType errorMessage:(NSString *)errorMessage errorDetails:(NSString *)errorDetails

Parameters

errorCode
  • string errorCode can be nil if not applicable.
errorType
  • string errorType can be nil if not applicable.
errorMessage
  • string errorMessage can be nil if not applicable.
errorDetails
  • string(JSON) errorDetails is a json string that can have key-value pairs for the following keys errfile, errmethod, errline, errstacktrace, errcustommsg, errcrashreport, formID, widgetID, flowTag.

Discussion

report error to metrics server

Declared In

KNYMetricsService.h

reportHandledException:exceptionType:exceptionMessage:exceptionDetails:

report exception to metrics server

- (void)reportHandledException:(NSString *)exceptionCode exceptionType:(NSString *)exceptionType exceptionMessage:(NSString *)exceptionMessage exceptionDetails:(NSString *)exceptionDetails

Parameters

exceptionCode
  • string exceptionCode can be nil if not applicable.
exceptionType
  • string type of exception. Ex: Eval Error, syntax error. Can be nil if not applicable.
exceptionMessage
  • string exceptionMessage Can be nil if not applicable.
exceptionDetails
  • string(JSON) exceptionDetails is a json string that can have key-value pairs for the following keys exceptionfile, exceptionmethod, exceptionline, exceptionstacktrace, formID, widgetID, flowTag.

Discussion

report exception to metrics server

Declared In

KNYMetricsService.h

sendCustomMetrics:andData:

Metrics API

- (void)sendCustomMetrics:(NSString *)groupId andData:(NSDictionary *)data

Parameters

groupId

group id - groupId length cannot be more than 250.

data

data to be send

Discussion

Metrics API

Declared In

KNYMetricsService.h

sendEvent:eventSubType:formID:widgetID:flowTag:

This method takes the event details from the developer and schedule it for sending to server as per Configuration values set by the developer.

- (void)sendEvent:(KNYEventType)eventType eventSubType:(NSString *)eventSubType formID:(NSString *)formID widgetID:(NSString *)widgetID flowTag:(NSString *)flowTag

Parameters

eventType
  • string literal for formID can be null.
eventSubType
  • string literal for eventSubType(max 256 Chars)
formID
  • string literal for formID(max 256 Chars)
widgetID
  • string literal for widgetID(max 256 Chars)
flowTag
  • string literal to override flow tag (max 256 Chars)

Discussion

This method takes the event details from the developer and schedule it for sending to server as per Configuration values set by the developer.

Declared In

KNYMetricsService.h

sendEvent:eventSubType:formID:widgetID:flowTag:metaData:

This method takes the event details from the developer and schedule it for sending to server as per Configuration values set by the developer.

- (void)sendEvent:(KNYEventType)eventType eventSubType:(NSString *)eventSubType formID:(NSString *)formID widgetID:(NSString *)widgetID flowTag:(NSString *)flowTag metaData:(NSString *)metaData

Parameters

eventType
  • string literal for formID can be null.
eventSubType
  • string literal for eventSubType(max 256 Chars)
formID
  • string literal for formID(max 256 Chars)
widgetID
  • string literal for widgetID(max 256 Chars)
flowTag
  • string literal to override flow tag (max 256 Chars)
metaData

– string literal that can be set by developer while setting a custom event for sending custom data as part of event.

Discussion

This method takes the event details from the developer and schedule it for sending to server as per Configuration values set by the developer.

Declared In

KNYMetricsService.h

setEventConfig:eventBufferAutoFlushCount:eventBufferMaxCount:

This method will take the required values to set the event Configuration values. When eventConfigType is - KNYEventConfigTypeBuffer eventBufferAutoFlushCount and eventBufferMaxCount are considered. - KNYEventConfigTypeIntant eventBufferAutoFlushCount and eventBufferMaxCount are ignored.

- (void)setEventConfig:(KNYEventConfigType)eventConfigType eventBufferAutoFlushCount:(NSUInteger)eventBufferAutoFlushCount eventBufferMaxCount:(NSUInteger)eventBufferMaxCount

Parameters

eventConfigType
  • sets the Current Configuration Type
eventBufferAutoFlushCount
  • event buffer count to auto flush the events possible values any positive integer Default value 15
eventBufferMaxCount
  • Maximum event buffer count to store the events possible values any positive integer Default value 1000

Discussion

This method will take the required values to set the event Configuration values. When eventConfigType is - KNYEventConfigTypeBuffer eventBufferAutoFlushCount and eventBufferMaxCount are considered. - KNYEventConfigTypeIntant eventBufferAutoFlushCount and eventBufferMaxCount are ignored.

Declared In

KNYMetricsService.h

setMetricsServiceEndPoint:serviceName:

sets the Metrics Service end-point URL

- (void)setMetricsServiceEndPoint:(NSString *)URLString serviceName:(NSString *)serviceName

Parameters

URLString

metricservice end-point URL

serviceName

metricsServiceName (values = “session”, “custom”)

Discussion

sets the Metrics Service end-point URL

Declared In

KNYMetricsService.h

setSetSessionId:

setSessionId is Used only by Kony IDE Dev

- (void)setSetSessionId:(NSString *)sessionId

Parameters

sessionID
  • string literal ex:- any GUID

Discussion

setSessionId is Used only by Kony IDE Dev

Declared In

KNYMetricsService.h