kopia lustrzana https://github.com/cyoung/stratux
Add disk usage webUI warning.
rodzic
e8f8a27bc3
commit
23619fad1b
|
@ -1091,6 +1091,7 @@ func openReplay(fn string, compressed bool) (WriteCloser, error) {
|
|||
|
||||
func printStats() {
|
||||
statTimer := time.NewTicker(30 * time.Second)
|
||||
diskUsageWarning := false
|
||||
for {
|
||||
<-statTimer.C
|
||||
var memstats runtime.MemStats
|
||||
|
@ -1104,6 +1105,12 @@ func printStats() {
|
|||
log.Printf(" - Last GPS fix: %s, GPS solution type: %d using %d satellites (%d/%d seen/tracked), NACp: %d, est accuracy %.02f m\n", stratuxClock.HumanizeTime(mySituation.LastFixLocalTime), mySituation.Quality, mySituation.Satellites, mySituation.SatellitesSeen, mySituation.SatellitesTracked, mySituation.NACp, mySituation.Accuracy)
|
||||
log.Printf(" - GPS vertical velocity: %.02f ft/sec; GPS vertical accuracy: %v m\n", mySituation.GPSVertVel, mySituation.AccuracyVert)
|
||||
}
|
||||
// Check if we're using more than 95% of the free space. If so, throw a warning (only once).
|
||||
if !diskUsageWarning && usage.Usage() > 95.0 {
|
||||
err_p := fmt.Errorf("Disk bytes used = %s (%.1f %%), Disk bytes free = %s (%.1f %%)", humanize.Bytes(usage.Used()), 100*usage.Usage(), humanize.Bytes(usage.Free()), 100*(1-usage.Usage()))
|
||||
addSystemError(err_p)
|
||||
diskUsageWarning = true
|
||||
}
|
||||
logStatus()
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue