mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat: host metrics part 2 (#1972)
This commit is contained in:
parent
e31d4170b6
commit
f48e127019
2 changed files with 24 additions and 11 deletions
|
|
@ -134,16 +134,20 @@ fun HostMetricsItem(
|
|||
value = formatBytes(hostMetrics.diskfree1Bytes),
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
)
|
||||
LogLine(
|
||||
label = stringResource(R.string.disk_free) + " 2",
|
||||
value = formatBytes(hostMetrics.diskfree2Bytes),
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
)
|
||||
LogLine(
|
||||
label = stringResource(R.string.disk_free) + " 3",
|
||||
value = formatBytes(hostMetrics.diskfree3Bytes),
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
)
|
||||
if (hostMetrics.hasDiskfree2Bytes()) {
|
||||
LogLine(
|
||||
label = stringResource(R.string.disk_free) + " 2",
|
||||
value = formatBytes(hostMetrics.diskfree2Bytes),
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
)
|
||||
}
|
||||
if (hostMetrics.hasDiskfree3Bytes()) {
|
||||
LogLine(
|
||||
label = stringResource(R.string.disk_free) + " 3",
|
||||
value = formatBytes(hostMetrics.diskfree3Bytes),
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
)
|
||||
}
|
||||
LogLine(
|
||||
label = stringResource(R.string.load) + " 1",
|
||||
value = (hostMetrics.load1 / 100.0).toString(),
|
||||
|
|
@ -186,6 +190,13 @@ fun HostMetricsItem(
|
|||
trackColor = ProgressIndicatorDefaults.linearTrackColor,
|
||||
strokeCap = ProgressIndicatorDefaults.LinearStrokeCap,
|
||||
)
|
||||
if (hostMetrics.hasUserString()) {
|
||||
LogLine(
|
||||
label = stringResource(R.string.user_string),
|
||||
value = hostMetrics.userString,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -241,11 +252,12 @@ private fun HostMetricsItemPreview() {
|
|||
.setUptimeSeconds(3600)
|
||||
.setFreememBytes(2048000)
|
||||
.setDiskfree1Bytes(104857600)
|
||||
.setDiskfree2Bytes(209715200)
|
||||
.setDiskfree2Bytes(2097915200)
|
||||
.setDiskfree3Bytes(44444)
|
||||
.setLoad1(30)
|
||||
.setLoad5(75)
|
||||
.setLoad15(19)
|
||||
.setUserString("test")
|
||||
.build()
|
||||
val logs = TelemetryProtos.Telemetry.newBuilder()
|
||||
.setTime((System.currentTimeMillis() / 1000L).toInt())
|
||||
|
|
|
|||
|
|
@ -637,4 +637,5 @@
|
|||
<string name="free_memory">Free Memory</string>
|
||||
<string name="disk_free">Disk Free</string>
|
||||
<string name="load">Load</string>
|
||||
<string name="user_string">User String</string>
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue