Splunk MINT SDK for iOS (Legacy)

Splunk MINT SDK for iOS Developer Guide

Splunk MINT is no longer available for purchase as of January 29, 2021. Customers who have already been paying to ingest and process MINT data in Splunk Enterprise will continue to receive support until December 31, 2021, which is End of Life for all MINT products: App, Web Service (Management Console), SDK and Add-On.
This documentation does not apply to the most recent version of Splunk MINT SDK for iOS (Legacy). For documentation on the most recent version, go to the latest release.

Monitor transactions

Transactions let you keep track of any process inside your application with a beginning and an end. For example, a transaction could be a process such as registration, login, or a purchase.

A transaction is basically an event that starts and then finishes in one of three ways:

  • The transaction is completed normally, resulting in a status of "SUCCESS".
  • The transaction is cancelled by the user, possibly because the process took too much time to complete, resulting in a status of "CANCEL".
  • The transaction failed because the app crashed, resulting in a status of "FAIL".

Use the following methods to work with transactions.

  • To start a transaction, use the transactionStart: method.
  • To stop a transaction, use the transactionStop: method.
  • To cancel a transaction with a reason, use the transactionCancel:reason: method.

To identify slow transactions that negatively affect the user experience, monitor how long transactions take to complete by going to the Transactions dashboard in Splunk MINT Management Console.

Example code

// Objective-C

NSString* c = @"MintTransaction";
[[Mint sharedInstance] transactionStart:transactionId andResultBlock:^(TransactionStartResult *transactionStartResult)
{
    NSString* message = [NSString stringWithFormat:@"Transaction with ID:%@ %@", transactionId, transactionStartResult.transactionStatus == SuccessfullyStartedTransaction ? @"started successfully" : @"failed to start"];
    NSLog(@"%@", message);
}];
// Continue your code...
// Do something in a block method. End the transaction so you can track that
// in your dashboard to resolve an issue or for monitoring.
[[Mint sharedInstance] transactionStop:transactionId andResultBlock:^(TransactionStopResult *transactionStopResult)
{
    NSString* message = [NSString stringWithFormat:@"Transaction with ID:%@ %@", transactionId, transactionStopResult.transactionStatus == UserSuccessfullyStoppedTransaction ? @"stopped successfully" : @"failed to stop"];
    NSLog(@"%@", message);
}];
// Swift 

let transactionID:String = "MintTransactionID"
Mint.sharedInstance().transactionStart(transactionID, andResultBlock:
{ (transactionStartResult: TransactionStartResult!) -> Void in let result = transactionStartResult.transactionStatus.value == SuccessfullyStartedTransaction.value ? "OK" : "Failed" println("Transaction Started: \(result)") }

)

Mint.sharedInstance().transactionStop("TransactionId", andResultBlock:
{ (transactionStopResult: TransactionStopResult!) -> Void in let result = transactionStopResult.transactionStatus.value == UserSuccessfullyStoppedTransaction.value ? "OK" : "Failed" println("Transaction Stopped: \(result)") }

)
Last modified on 28 August, 2015
Customize session handling   Add and report events

This documentation applies to the following versions of Splunk MINT SDK for iOS (Legacy): 4.0.x


Was this topic useful?







You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters