doomsower / react-native-startup-time Goto Github PK
View Code? Open in Web Editor NEWmeasure startup time of your react-native app
License: MIT License
measure startup time of your react-native app
License: MIT License
Hi!
We've discovered another issue where we're seeing unrealistic high numbers for Android (we're talking multiple minutes).
If I understand the lifecycle mechanics of Android correctly, I believe there will be cases where the app is pushed to the background and the Android OS will clean up the Activity context while the Application context is still available. When the app is later returned to the foreground, the Activity context (which will execute any JavaScript calling the API for getting startup time data) gets re-created. Since the Application context was still available, the new calculation will be based on the old timestamp generated when the Application context was created.
This means that the concept of startup time is a bit more complex in the Android domain compared to on iOS. One need to distinguish between "hot" case (Application context is already available, Activity gets created) and "cold" case (Application context needs to be created, Activity gets created). The "unified" way to treat startup time between platforms would be to only care about the "cold" case.
One way of resolving this could be to only calculate and resolve the value once from the native side. Subsequent calls would then either return the same value or reject the call (allowing conditional reporting on the JavaScript side of things).
master
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can fix this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here are some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
An npm token must be created and set in the NPM_TOKEN
environment variable on your CI environment.
Please make sure to create an npm token and to set it in the NPM_TOKEN
environment variable on your CI environment. The token must allow to publish to the registry https://registry.npmjs.org/
.
Good luck with your project β¨
Your semantic-release bot π¦π
"peerDependencies": {
"react": "^16.8.3",
"react-native": ">=0.59.0"
}
Your library is amazing.
Based on your experience do you recommend using it in Simulator or it will be completely off with native experience on the device?
We have been facing lots of unrealistic app load times in our mobile application for iOS users. As per our investigation, it is commonly occurring in the iOS version 15 or above. We have also tested with the lower version of iOS but it was working fine for them. I think we need to make some updates to the package as the latest version of the package is 2.0.0 which was launched 10 months ago and iOS 15 was launched on 20th Sep 2021. Could you please suggest?
I am using vscode. I don't use android studio at all, but the instructions are strictly for android studio it seems. I didn't see anyone who use android studio for that anyway. You don't even use anything related with android studio much in react. You don't need it. This is javascript anyway, android studio has nothing to do with this. Even in youtube tutorials none uses android studio for that.
Anyway here s what I did and what didn't work.
import { StartupTime } from 'react-native-startup-time';
...
<StartupTime
ready={true /* optional, defaults to true /}
style={styles.startupTime / optional*/}
/>
a=StartupTime
console.log(a)
import { getTimeSinceStartup } from 'react-native-startup-time';
// when you app is ready:
getTimeSinceStartup().then((time) => {
console.log(Time since startup: ${time} ms
);
});
a=getTimeSinceStartup()
console.log(a)
Both returns null. I tried various things, its just a small thing I didn't expect it give so much errors at start. That's why I think a little more documentation would be good. I even copy pasted that and it still doesn't work.
I tried everything but this just doesn't work. Your docs isn't very clear. No good example aswell. Tried putting that function into a variable but it doesn't work. Console log doesn't work. Nothing works. I literally wasted a lot of time with this.
Hi!
We tried out the package while implementing performance instrumentation but ran into issues with the following exception:
uid xxxxx does not have android.permission.UPDATE_DEVICE_STATS.
Affected OS versions seem to be KitKat
(as has been reported by other users of reportFullyDrawn()
) and when going through the implementation, I noticed the check for that specific range of versions. However, the check seem to include KitKat
- should it not be
>= Build.VERSION_CODES.LOLLIPOP
instead?
Thanks in advance!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.