-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #205 from Countly/apm_configs
[Android] Rework apm configs
- Loading branch information
Showing
5 changed files
with
144 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package ly.count.android.sdk; | ||
|
||
public class ConfigApm { | ||
/** | ||
* Whether to track the app start time | ||
*/ | ||
protected boolean trackAppStartTime = false; | ||
/** | ||
* Whether to track the app foreground / background state | ||
*/ | ||
protected boolean trackForegroundBackground = false; | ||
/** | ||
* Whether to track the app foreground / background state manually | ||
*/ | ||
protected boolean manualForegroundBackgroundTrigger = false; | ||
/** | ||
* Whether to track the app start time manually | ||
*/ | ||
protected boolean appLoadedManualTrigger = false; | ||
/** | ||
* Whether to track the app start time manually | ||
*/ | ||
protected Long appStartTimestampOverride = null; | ||
|
||
//we enable features | ||
|
||
/** | ||
* Enable the recording of the app start time | ||
* | ||
* @return Returns the same config object for convenient linking | ||
*/ | ||
public synchronized ConfigApm enableAppStartTimeTracking() { | ||
this.trackAppStartTime = true; | ||
return this; | ||
} | ||
|
||
/** | ||
* Enable the recording of the app foreground / background state | ||
* | ||
* @return Returns the same config object for convenient linking | ||
*/ | ||
public synchronized ConfigApm enableForegroundBackgroundTracking() { | ||
this.trackForegroundBackground = true; | ||
return this; | ||
} | ||
|
||
//we configure features / set manual overrides | ||
|
||
/** | ||
* Set to manually trigger the moment when the app has finished loading | ||
* | ||
* @return Returns the same config object for convenient linking | ||
*/ | ||
public synchronized ConfigApm enableManualAppLoadedTrigger() { | ||
appLoadedManualTrigger = true; | ||
return this; | ||
} | ||
|
||
/** | ||
* Override the app start timestamp in case you have a more precise way to measure it | ||
* | ||
* @param appStartTimestampOverride The timestamp to use as the app start timestamp | ||
* @return Returns the same config object for convenient linking | ||
*/ | ||
public synchronized ConfigApm setAppStartTimestampOverride(long appStartTimestampOverride) { | ||
this.appStartTimestampOverride = appStartTimestampOverride; | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters