You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our test team looking for UI render times and api response times. I have added performance lib but not sure how to implement custom trace. In our react-native app it has multiple class and functional components for one screen. I am not able find a way to track all UI render times and api responses.
--> Can some one share sample code how to implement customtrace.
--> Where can we see once we add custom traces.
--> Where can we see axios metrics on firebase dashboard.
sample code:
async function customTrace() {
// Define & start a trace
const trace = await perf().startTrace('custom_trace');
// Define trace meta details
trace.putAttribute('user', 'abcd');
trace.putMetric('credits', 30);
// Stop the trace
await trace.stop();
}
My code:
let appStartTrace:any;
export default class App extends React.Component{
async UNSAFE_componentWillMount(){
appStartTrace= await perf().startTrace('custom_app_start_trace');
appStartTrace.putAttribute('user', 'abcd');
appStartTrace.putMetric('credits', 30);
console.log("app Start")
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Our test team looking for UI render times and api response times. I have added performance lib but not sure how to implement custom trace. In our react-native app it has multiple class and functional components for one screen. I am not able find a way to track all UI render times and api responses.
--> Can some one share sample code how to implement customtrace.
--> Where can we see once we add custom traces.
--> Where can we see axios metrics on firebase dashboard.
sample code:
async function customTrace() {
// Define & start a trace
const trace = await perf().startTrace('custom_trace');
// Define trace meta details
trace.putAttribute('user', 'abcd');
trace.putMetric('credits', 30);
// Stop the trace
await trace.stop();
}
My code:
let appStartTrace:any;
export default class App extends React.Component{
async UNSAFE_componentWillMount(){
appStartTrace= await perf().startTrace('custom_app_start_trace');
appStartTrace.putAttribute('user', 'abcd');
appStartTrace.putMetric('credits', 30);
console.log("app Start")
}
async componentDidMount(){
await appStartTrace.stop();
console.log("app completed")
}
render() {
return (
);
}
}
rewrelic implementation:
https://blog.newrelic.com/engineering/measure-performance-metrics-in-react-native-apps/
Beta Was this translation helpful? Give feedback.
All reactions