Digital Resilience Pays Off
Download this e-book to learn about the role of Digital Resilience across enterprises.
You can write very fast programs in Objective-C, but you can also write very slow ones. Performance isn’t a characteristic of a language but of a language implementation, and more importantly, of the programs written in that language. Performance optimization requires that you measure the time to perform a task, then try algorithm and coding changes to make the task faster.
The most important performance issue is the quality of the libraries used in developing applications. Good quality libraries reduce the performance impact. So to help you improve performance in your apps, we’ve updated the Splunk MINT SDK for iOS to provide an easy way to trace a method performance using MACROS.
To trace an Objective-C method, add the MINT_METHOD_TRACE_START macro to the beginning of your method and the MINT_METHOD_TRACE_STOP macro to the end of it.
For example:
- (void)anyMethod { MINT_METHOD_TRACE_START ... MINT_METHOD_TRACE_STOP }
If you are not using ARC, use the MINT_NONARC_METHOD_TRACE_STOP macro to avoid a memory leak issue.
The trace method automatically picks up performance metrics for your method and sends it to Splunk. The trace report contains following fields:
To view the event information, run following search in Splunk:
index=mint sourcetype=mint:methodinvocation
Here is an example event:
{ apiKey: 6d8c9a39 appEnvironment: Staging appRunningState: Background appVersionCode: 1 appVersionName: 3.1 batteryLevel: -100 carrier: NA connection: WIFI currentView: MainViewController device: iPad5,3 elapsedTime: 1105708 extraData: { } locale: GB method: -[MainViewController mintMeta] msFromStart: 1450 osVersion: 9.2.1 packageName: WhiteHouse platform: iOS remoteIP: 185.75.2.2 screenOrientation: Portrait sdkVersion: 5.1.0 session_id: E9F4BE3D-0CEB-4461-9442-145101E5EE67 state: CONNECTED threadID: 10759 transactions: [ ] userIdentifier: XXXXXXXX uuid: XXXXXXXX }
----------------------------------------------------
Thanks!
Michael Margulis
The Splunk platform removes the barriers between data and action, empowering observability, IT and security teams to ensure their organizations are secure, resilient and innovative.
Founded in 2003, Splunk is a global company — with over 7,500 employees, Splunkers have received over 1,020 patents to date and availability in 21 regions around the world — and offers an open, extensible data platform that supports shared data across any environment so that all teams in an organization can get end-to-end visibility, with context, for every interaction and business process. Build a strong data foundation with Splunk.