Skip to content

Commit 17a9265

Browse files
Rename APM APIs
1 parent 422b27b commit 17a9265

File tree

6 files changed

+29
-29
lines changed

6 files changed

+29
-29
lines changed

android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import com.facebook.react.bridge.ReactContextBaseJavaModule;
1010
import com.facebook.react.bridge.ReactMethod;
1111
import com.instabug.apm.APM;
12-
import com.instabug.apm.model.Trace;
12+
import com.instabug.apm.model.ExecutionTrace;
1313
import com.instabug.bug.BugReporting;
1414
import com.instabug.chat.Chats;
1515
import com.instabug.library.Feature;
@@ -25,7 +25,7 @@ public class RNInstabugAPMModule extends ReactContextBaseJavaModule {
2525
public RNInstabugAPMModule(ReactApplicationContext reactApplicationContext) {
2626
super(reactApplicationContext);
2727
}
28-
HashMap<String, Trace> traces = new HashMap<String, Trace>();
28+
HashMap<String, ExecutionTrace> traces = new HashMap<String, ExecutionTrace>();
2929

3030
@Nonnull
3131
@Override
@@ -70,16 +70,16 @@ public void run() {
7070
}
7171

7272
/**
73-
* Starts a trace
73+
* Starts an execution trace
7474
* @param name string name of the trace.
7575
*/
7676
@ReactMethod
77-
public void startTrace(final String name, final String id) {
77+
public void startExecutionTrace(final String name, final String id) {
7878
MainThreadHandler.runOnMainThread(new Runnable() {
7979
@Override
8080
public void run() {
8181
try {
82-
Trace trace = APM.startTrace(name);
82+
ExecutionTrace trace = APM.startExecutionTrace(name);
8383
traces.put(id,trace);
8484
} catch (Exception e) {
8585
e.printStackTrace();
@@ -95,7 +95,7 @@ public void run() {
9595
* @param value attribute value. Null to remove attribute
9696
*/
9797
@ReactMethod
98-
public void setTraceAttribute(final String id, final String key, final String value) {
98+
public void setExecutionTraceAttribute(final String id, final String key, final String value) {
9999
MainThreadHandler.runOnMainThread(new Runnable() {
100100
@Override
101101
public void run() {
@@ -113,7 +113,7 @@ public void run() {
113113
* @param id string id of the trace.
114114
*/
115115
@ReactMethod
116-
public void endTrace(final String id) {
116+
public void endExecutionTrace(final String id) {
117117
MainThreadHandler.runOnMainThread(new Runnable() {
118118
@Override
119119
public void run() {

index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ export namespace APM {
134134
function setEnabled(isEnabled: boolean): void;
135135
function setAppLaunchEnabled(isEnabled: boolean): void;
136136
function setNetworkEnabledIOS(isEnabled: boolean): void;
137-
function setUIHangEnabled(isEnabled: boolean): void;
138-
function startTrace(name: string): Trace;
137+
function setAutoUITraceEnabled(isEnabled: boolean): void;
138+
function startExecutionTrace(name: string): Trace;
139139
function startUITrace(name: string): void;
140140
function endUITrace(): void;
141141
}

ios/RNInstabug/InstabugAPMBridge.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
- (void)setEnabled:(BOOL)isEnabled;
1515
- (void)setAppLaunchEnabled:(BOOL)isEnabled;
16-
- (void)setUIHangEnabled:(BOOL)isEnabled;
17-
- (void)startTrace:(NSString *)name:(NSString *)id;
18-
- (void)setTraceAttribute:(NSString *)id:(NSString *)key
19-
:(NSString *)value;
20-
- (void)endTrace:(NSString *)id;
16+
- (void)setAutoUITraceEnabled:(BOOL)isEnabled;
17+
- (void)startExecutionTrace:(NSString *)name:(NSString *)id;
18+
- (void)setExecutionTraceAttribute:(NSString *)id:(NSString *)key
19+
:(NSString *)value;
20+
- (void)endExecutionTrace:(NSString *)id;
2121
- (void)startUITrace:(NSString *)name;
2222
- (void)endUITrace;
2323

ios/RNInstabug/InstabugAPMBridge.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#import "InstabugAPMBridge.h"
44
#import <Instabug/IBGAPM.h>
5-
#import <Instabug/IBGTrace.h>
5+
#import <Instabug/IBGExecutionTrace.h>
66
#import <asl.h>
77
#import <React/RCTLog.h>
88
#import <os/log.h>
@@ -43,22 +43,22 @@ - (id) init
4343
IBGAPM.appLaunchEnabled = isEnabled;
4444
}
4545

46-
RCT_EXPORT_METHOD(setUIHangEnabled:(BOOL)isEnabled) {
47-
IBGAPM.UIHangEnabled = isEnabled;
46+
RCT_EXPORT_METHOD(setAutoUITraceEnabled:(BOOL)isEnabled) {
47+
IBGAPM.autoUITraceEnabled = isEnabled;
4848
}
4949

50-
RCT_EXPORT_METHOD(startTrace:(NSString *)name :(NSString *)id) {
51-
IBGTrace *trace = [IBGAPM startTraceWithName:name];
50+
RCT_EXPORT_METHOD(startExecutionTrace:(NSString *)name :(NSString *)id) {
51+
IBGExecutionTrace *trace = [IBGAPM startExecutionTraceWithName:name];
5252
[traces setObject: trace forKey: id];
5353
}
5454

55-
RCT_EXPORT_METHOD(setTraceAttribute:(NSString *)id :(NSString *)key :(NSString *)value) {
56-
IBGTrace *trace = [traces objectForKey:id];
55+
RCT_EXPORT_METHOD(setExecutionTraceAttribute:(NSString *)id :(NSString *)key :(NSString *)value) {
56+
IBGExecutionTrace *trace = [traces objectForKey:id];
5757
[trace setAttributeWithKey:key value:value];
5858
}
5959

60-
RCT_EXPORT_METHOD(endTrace:(NSString *)id) {
61-
IBGTrace *trace = [traces objectForKey:id];
60+
RCT_EXPORT_METHOD(endExecutionTrace:(NSString *)id) {
61+
IBGExecutionTrace *trace = [traces objectForKey:id];
6262
[trace end];
6363
}
6464

models/Trace.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default class Trace {
1919
* @param {string} value
2020
*/
2121
setAttribute(key, value) {
22-
IBGAPM.setTraceAttribute(this.id, key, value);
22+
IBGAPM.setExecutionTraceAttribute(this.id, key, value);
2323
this.attributes[key] = value;
2424
}
2525

@@ -29,6 +29,6 @@ export default class Trace {
2929
* @param {string} value
3030
*/
3131
end() {
32-
IBGAPM.endTrace(this.id);
32+
IBGAPM.endExecutionTrace(this.id);
3333
}
3434
}

modules/APM.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ export default {
4141
* Enables or disables APM UI Responsivenes tracking feature
4242
* @param {boolean} isEnabled
4343
*/
44-
setUIHangEnabled(isEnabled) {
44+
setAutoUITraceEnabled(isEnabled) {
4545
if (Platform.OS === 'ios') {
46-
IBGAPM.setUIHangEnabled(isEnabled);
46+
IBGAPM.setAutoUITraceEnabled(isEnabled);
4747
}
4848
},
4949

5050
/**
5151
* Starts a custom trace
5252
* @param {string} name
5353
*/
54-
startTrace(name) {
54+
startExecutionTrace(name) {
5555
const id = Date.now() + '';
56-
IBGAPM.startTrace(name, id);
56+
IBGAPM.startExecutionTrace(name, id);
5757
return new Trace(id, name);
5858
},
5959

0 commit comments

Comments
 (0)