我正在Firebase Performance Monitoring为我的项目使用插件,以便跟踪/检查我的代码。
Trace我在onPreExecute()自定义方法上创建了一个AsyncTask(这里我只发布我使用的方法Trace):
@Override
protected void onPreExecute() {
// Start trace which track the analysis of raw data
Trace trace = FirebasePerformance.getInstance().newTrace(traceTag);
mTraceMaps.put(traceTag, trace);
trace.start();
trace.incrementCounter(counterTag, totalItems);
}
@Override
protected void onPostExecute(Bundle result) {
// Stop trace which track the analysis of raw data
Trace trace = mTraceMaps.get(traceTag);
if (trace != null) {
trace.stop();
mTraceMaps.remove(traceTag);
}
}
请注意,traceTagandcounterTag是我课堂上的常量。
问题是我在Firebase 控制台上看不到任何东西。我期待int向我展示我收集了多少原始数据。
我错过了什么吗?我的代码是否正确?