KNYMetricsService Class Reference
| Inherits from | NSObject |
| Declared in | KNYMetricsService.h |
Tasks
-
– init -
userIdproperty -
flowTagproperty -
+ sharedMetricsService -
– sendCustomMetrics:andData: -
– setEventConfig:eventBufferAutoFlushCount:eventBufferMaxCount: -
– flushEvents -
– sendEvent:eventSubType:formID:widgetID:flowTag: -
– sendEvent:eventSubType:formID:widgetID:flowTag:metaData: -
– setMetricsServiceEndPoint:serviceName: -
– eventsInBuffer -
– reportError:errorType:errorMessage:errorDetails: -
– reportHandledException:exceptionType:exceptionMessage:exceptionDetails: -
– setSetSessionId:
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 *flowTagDiscussion
Flow Tag for the metrics events. Set to nil to clear previously set flowTag. length cannot be more than 256.
Declared In
KNYMetricsService.hClass Methods
sharedMetricsService
Throws exception, when invoked before initialializing the KNYClient.
+ (instancetype)sharedMetricsServiceReturn Value
Returns the shared instance of KNYMetricsService
Discussion
Throws exception, when invoked before initialializing the KNYClient.
Declared In
KNYMetricsService.hInstance Methods
eventsInBuffer
This method will return the a List of the buffered events.
- (NSDictionary *)eventsInBufferReturn Value
returns dictionary of events stored in buffer.
Discussion
This method will return the a List of the buffered events.
Declared In
KNYMetricsService.hflushEvents
This method will send the buffered events to the server at once.
- (void)flushEventsDiscussion
This method will send the buffered events to the server at once.
Declared In
KNYMetricsService.hreportError:errorType:errorMessage:errorDetails:
report error to metrics server
- (void)reportError:(NSString *)errorCode errorType:(NSString *)errorType errorMessage:(NSString *)errorMessage errorDetails:(NSString *)errorDetailsParameters
- 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.hreportHandledException:exceptionType:exceptionMessage:exceptionDetails:
report exception to metrics server
- (void)reportHandledException:(NSString *)exceptionCode exceptionType:(NSString *)exceptionType exceptionMessage:(NSString *)exceptionMessage exceptionDetails:(NSString *)exceptionDetailsParameters
- 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.hsendCustomMetrics:andData:
Metrics API
- (void)sendCustomMetrics:(NSString *)groupId andData:(NSDictionary *)dataParameters
- groupId
group id - groupId length cannot be more than 250.
- data
data to be send
Discussion
Metrics API
Declared In
KNYMetricsService.hsendEvent: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 *)flowTagParameters
- 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.hsendEvent: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 *)metaDataParameters
- 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.hsetEventConfig: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)eventBufferMaxCountParameters
- 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.hsetMetricsServiceEndPoint:serviceName:
sets the Metrics Service end-point URL
- (void)setMetricsServiceEndPoint:(NSString *)URLString serviceName:(NSString *)serviceNameParameters
- URLString
metricservice end-point URL
- serviceName
metricsServiceName (values = “session”, “custom”)
Discussion
sets the Metrics Service end-point URL
Declared In
KNYMetricsService.h