split things, add a rented instance class

will fix errors later
This commit is contained in:
Minecon724 2024-07-29 12:18:23 +02:00
parent 61d4dde944
commit fbdcd5b224
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8
4 changed files with 68 additions and 16 deletions

View file

@ -19,22 +19,6 @@ data class Instance(
/** "Deep Learning Performance", it's very specific like 15.679831880208411 */ /** "Deep Learning Performance", it's very specific like 15.679831880208411 */
val dlPerf: Double, val dlPerf: Double,
/** dollars per hour excluding storage costs, like 0.32 */
val dphBase: Double,
/** storage cost 1 GB / 30 days (720 hours)
* to get hourly, divide it by 720 and multiply by GBs */
val storageCostGbMo: Double,
/** dollars per 1 GB of download (on site it shows TB as 1024) **/
val inetDownCostGb: Double,
/** dollars per 1 GB of upload (on site it shows TB as 1024) **/
val inetUpCostGb: Double,
/** if you're bidding this instance, always false in marketplace (or not?) */
val isBid: Boolean,
/** the minimum bid you can make, as dph
* website shows more I don't know why */
val minBid: Double,
/** since when the instance is available for rental in unix seconds /** since when the instance is available for rental in unix seconds
* if rented by you, it's since when the machine is rented * if rented by you, it's since when the machine is rented
* at least I think because it's recent and unavailable machines don't have that */ * at least I think because it's recent and unavailable machines don't have that */

View file

@ -23,6 +23,8 @@ data class Machine(
val cpuCores: Int, val cpuCores: Int,
/** readable cpu name like xeon something */ /** readable cpu name like xeon something */
val cpuName: String, val cpuName: String,
/** only when viewing a not rented instance */
val cpuGhz: Double,
/** disk bandwidth in MB/s (TODO find out) like 1225.1 */ /** disk bandwidth in MB/s (TODO find out) like 1225.1 */
val diskBandwidth: Double, val diskBandwidth: Double,
@ -81,6 +83,7 @@ data class Machine(
json.getString("cpu_arch"), json.getString("cpu_arch"),
json.getInt("cpu_cores"), json.getInt("cpu_cores"),
json.getString("cpu_name"), json.getString("cpu_name"),
json.optDouble("cpu_ghz", -1.0),
json.getDouble("disk_bw"), json.getDouble("disk_bw"),
json.getString("disk_name"), json.getString("disk_name"),
json.getDouble("disk_space"), json.getDouble("disk_space"),

View file

@ -0,0 +1,20 @@
package eu.m724.vastapp.vastai.data
data class Pricing(
/** if you're bidding this instance, always false in marketplace (or not?) */
val isBid: Boolean,
/** the minimum bid you can make, as dph
* website shows more I don't know why */
val minBid: Double,
/** dollars per hour excluding storage costs */
val dphBase: Double,
/** storage cost 1 GB / 30 days (720 hours)
* to get hourly, divide it by 720 and multiply by GBs TODO remove this comment */
/** storage cost GB/hr */
val storageCost: Double,
/** dollars per 1 GB of download (on site it shows TB as 1024 so TODO gb or gib?) **/
val downloadCost: Double,
/** dollars per 1 GB of upload (on site it shows TB as 1024) **/
val uploadCost: Double,
)

View file

@ -0,0 +1,45 @@
package eu.m724.vastapp.vastai.data
import android.net.InetAddresses
import java.net.InetAddress
data class RentedInstance(
val instance: Instance,
/** the rental id, apparently not rented id is different */
val rentalId: Int,
/** rented disk space in MB */
val diskSpace: Int,
/** disk usage in MB */
val diskUsage: Int,
/** vram usage in MB */
val vramUsage: Int,
/** ram usage in MB */
val memoryUsage: Int,
/** gpu utilization 0.0 - 1.0 */
val gpuUsage: Double,
/** cpu utilization 0.0 - 1.0 */
val cpuUsage: Double,
/** gpu temperature in celsius */
val gpuTemperature: Double,
/** MB downloaded in the lifetime of the instance
* there is like 20 gb added and I don't know why */
val downloaded: Int,
/** MB downloaded in the lifetime of the instance
* this is also wrong but not as much */
val uploaded: Int,
/** hostname of the ssh proxy */
val sshProxyHost: String,
val sshProxyPort: Int,
/** the docker image that runs on the instance */
val image: String,
/** label set by user */
val label: String,
/** local ip addresses?
* I think if you have another instance on the same machine you can use it */
val localIpAddresses: List<InetAddress>
)