New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get device memory information #137
Comments
Hi Opeoluwa, I would like to give solving this issue a try. |
Hi @zoo868e thanks for reaching out ❤️ I'd assign the issue to you. Let me know if you have any questions |
Hi @opeolluwa, I would like to define the details about these feature requests. Refactor the structure that includes the informations.
|
The first one, |
Device battery uptime in hh mm before each transfer, the battery uptime will be checked to inform the user of the likelihood of incomplete transfer due to device power outage |
I hope these answers the questions, let me know if you need more clarification |
Hi @opeolluwa, in relation to the uptime, I believe the information about whether the device will run out of power or not can be determined. I think it would be more useful to include the device's charging status and the remaining battery time as additional information. |
Here's what I intend to do, once the average transfer rate and the device uptime is known, an estimate of the time it will take to transfer the file can made. Supposed the transfer rate is 100MB/min and I'm sending a 1.2GB (1200MB, approximately) file, all thing being equal, the transfer should be completed in 1.2min, if the device uptime is at 0.8 min, the application should prompt user to charge device. |
Basically, this issue focuses on getting the uptime. At the core(Rust code), the implementation was initially provided in seconds, to allow ease of interconversion |
@zoo868e it would be great if you could implement the charging status, also by the device uptime, I mean the battery uptime which would mean the same thing as you pointed out |
Hi @zoo868e, how is it going? |
Hi @opeolluwa , I'm trying to mock the structure for unit test. |
Alright, well done. And thank you so much for your time and effort ❤️ |
Hi @opeolluwa, I have sent the pull request #154 . Thank you for waiting. |
Hi, @zoo868e I think there might be a bit of a glitch in this solution. I ran the test again on my machine, I got the following results. |
The available memory returned is 2MB in place of 8.7 GB and 116 MB in place of 124.9 GB. It could be an OS compatibility issue. Please let me know if all works fine at your end |
Hi @opeolluwa , thanks for finding, let me check it |
I have reviewed the source code of the crate used to retrieve Linux disk information, and I found the following pseudocode:
However, based on the implementation, it appears that the code returns the total space of all mounted disks. For our specific project, we need to focus on a specific device from which we will download files and verify if that device has sufficient space. Therefore, I will implement a function that can retrieve disk information for a specific mounted filesystem. Indeed, to obtain the disk information for a specific device, we will need to pass the device name as a parameter to the new function. Considering that the project aims to support various platforms, it is necessary to have platform-specific implementations. |
All noted, thanks for taking your time to look at this again! I appreciate your time and effort ❤️ |
Hi @zoo868e, any fix? |
Hi @opeolluwa, I have tested the function on my laptop and it appears to be working incorrectly as well. I am considering finding alternative crates to sys_info. Another option would be to implement our own library for retrieving system information. However, I believe this would be a significant project as it would need to be implemented cross-platform. |
Furthermore, if we decide to implement our own library, I suggest focusing on retrieving the disk information of each device instead of just the total space. This is because we may not know the specific path where the file will be downloaded, and having information about individual disks would provide more flexibility. |
I'd look into a custom library to do this... |
See this conversation on Reddit, it might help out https://www.reddit.com/r/rust/comments/o757bv/is_there_a_way_to_get_a_list_of_storage_devices/?utm_source=share&utm_medium=android_app&utm_name=androidcss&utm_term=1&utm_content=share_button |
Files are uploaded to a "sendfile" in the OS default download path. See implement here |
The library I'd be writing would retrieve the size and available storage information of the storage media, on which the default download dir is. What do you think of this |
Well done! 💯 I think it has solved this issue! I think the structure of Drives can be a part of SystemInformation. |
I'd be writing exams over the next few weeks, I might not have enough time to fix the issue, but I'd certainly look into it as soon as I'm done with the exams and I'd be available to attend to questions you might have |
Hi @opeolluwa, I replaced |
Hello @zoo868e I'd look into that, thank you for reviewing it |
Hi @opeolluwa, I have implemented a new function (#204) in the |
Hi @zoo868e this works fine. Is there any refactoring you'd like to make or I can close the issue |
No, please close the issue. Thank you. |
Solved |
To resolve this issue,
return the following information correctly:
The text was updated successfully, but these errors were encountered: