File tree Expand file tree Collapse file tree 6 files changed +19
-7
lines changed
firebase-crashlytics-ndk/src/third_party
firebase-perf/src/main/java/com/google/firebase/perf/session
firebase-sessions/test-app/src/main
kotlin/com/google/firebase/testing/sessions Expand file tree Collapse file tree 6 files changed +19
-7
lines changed Submodule
crashpad updated from 8df174c to c902f6b
Submodule
lss updated from ed31caa to 9719c1e
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ public class PerfSession implements Parcelable {
3838 * Creates a PerfSession object and decides what metrics to collect.
3939 */
4040 public static PerfSession createWithId (@ NonNull String sessionId ) {
41+ // For testing retain session ID.
42+ sessionId = "b007cc71-7582-4655-8e82-cbb2407a6bf4" ;
4143 String prunedSessionId = sessionId .replace ("-" , "" );
4244 PerfSession session = new PerfSession (prunedSessionId , new Clock ());
4345 session .setGaugeAndEventCollectionEnabled (shouldCollectGaugesAndEvents ());
@@ -164,10 +166,12 @@ public static com.google.firebase.perf.v1.PerfSession[] buildAndSort(
164166
165167 /** If true, Session Gauge collection is enabled. */
166168 public static boolean shouldCollectGaugesAndEvents () {
167- ConfigResolver configResolver = ConfigResolver . getInstance () ;
169+ return true ;
168170
169- return configResolver .isPerformanceMonitoringEnabled ()
170- && Math .random () < configResolver .getSessionsSamplingRate ();
171+ // ConfigResolver configResolver = ConfigResolver.getInstance();
172+ //
173+ // return configResolver.isPerformanceMonitoringEnabled()
174+ // && Math.random() < configResolver.getSessionsSamplingRate();
171175 }
172176
173177 /**
Original file line number Diff line number Diff line change @@ -24,12 +24,14 @@ import android.os.Bundle
2424import android.util.Log
2525import androidx.appcompat.app.AppCompatActivity
2626import com.google.firebase.FirebaseApp
27+ import com.google.firebase.perf.FirebasePerformance
2728
2829open class BaseActivity : AppCompatActivity () {
2930
3031 override fun onCreate (savedInstanceState : Bundle ? ) {
3132 super .onCreate(savedInstanceState)
3233 FirebaseApp .initializeApp(this )
34+ setProcessAttributes()
3335 logProcessDetails()
3436 logFirebaseDetails()
3537 Log .i(TAG , " onCreate - ${getProcessName()} - ${getImportance()} " )
@@ -87,6 +89,13 @@ open class BaseActivity : AppCompatActivity() {
8789 )
8890 }
8991
92+ private fun setProcessAttributes () {
93+ val processName = getProcessName()
94+ val pid = android.os.Process .myPid()
95+ FirebasePerformance .getInstance().putAttribute(" process_name" , processName)
96+ FirebasePerformance .getInstance().putAttribute(" process_id" , pid.toString())
97+ }
98+
9099 companion object {
91100 val TAG = " BaseActivity"
92101 }
Original file line number Diff line number Diff line change 3232 <string name =" kill_processes_button_text" >Kill Background Processes</string >
3333 <string name =" no_session_text" >No Session Set</string >
3434 <string name =" session_id_label" >Session Id: </string >
35- <string name =" process_name_label" >Process Name: </string >
3635</resources >
You can’t perform that action at this time.
0 commit comments