2022-02-13 10:52:19 +01:00
|
|
|
// Copyright 2022 - Offen Authors <hioffen@posteo.de>
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
2022-09-01 14:38:04 +02:00
|
|
|
"sync"
|
2022-02-13 10:52:19 +01:00
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
// ContainersStats stats about the docker containers
|
|
|
|
type ContainersStats struct {
|
|
|
|
All uint
|
|
|
|
ToStop uint
|
|
|
|
Stopped uint
|
|
|
|
StopErrors uint
|
|
|
|
}
|
|
|
|
|
2024-01-25 19:56:49 +01:00
|
|
|
// ServicesStats contains info about Swarm services that have been
|
|
|
|
// operated upon
|
|
|
|
type ServicesStats struct {
|
|
|
|
All uint
|
|
|
|
ToScaleDown uint
|
|
|
|
ScaledDown uint
|
|
|
|
ScaleDownErrors uint
|
|
|
|
}
|
|
|
|
|
2022-02-13 10:52:19 +01:00
|
|
|
// BackupFileStats stats about the created backup file
|
|
|
|
type BackupFileStats struct {
|
|
|
|
Name string
|
|
|
|
FullPath string
|
|
|
|
Size uint64
|
|
|
|
}
|
|
|
|
|
|
|
|
// StorageStats stats about the status of an archival directory
|
|
|
|
type StorageStats struct {
|
|
|
|
Total uint
|
|
|
|
Pruned uint
|
|
|
|
PruneErrors uint
|
|
|
|
}
|
|
|
|
|
|
|
|
// Stats global stats regarding script execution
|
|
|
|
type Stats struct {
|
2022-09-01 14:38:04 +02:00
|
|
|
sync.Mutex
|
2022-02-13 10:52:19 +01:00
|
|
|
StartTime time.Time
|
|
|
|
EndTime time.Time
|
|
|
|
TookTime time.Duration
|
2022-03-25 18:26:34 +01:00
|
|
|
LockedTime time.Duration
|
2022-02-13 10:52:19 +01:00
|
|
|
LogOutput *bytes.Buffer
|
|
|
|
Containers ContainersStats
|
2024-01-25 19:56:49 +01:00
|
|
|
Services ServicesStats
|
2022-02-13 10:52:19 +01:00
|
|
|
BackupFile BackupFileStats
|
2022-08-18 08:52:09 +02:00
|
|
|
Storages map[string]StorageStats
|
2022-02-13 10:52:19 +01:00
|
|
|
}
|