Documentation ¶
Index ¶
- Constants
- func CollectDuration(name string, t time.Duration)
- func CollectFailureUnit(name string, reason error)
- func CollectInt(name string, t int)
- func CollectSuccessUnit(name string, unitCount int, arg interface{})
- func CollectUint(name string, t uint64)
- func InitCollector(hasLogFile bool)
- func SetLogCollector(l LogCollector)
- func SetSuccessStatus(success bool)
- func SetUnit(unit string)
- func Summary(name string)
- type LogCollector
Constants ¶
View Source
const ( // BackupUnit tells summary in backup BackupUnit = "backup" // RestoreUnit tells summary in restore RestoreUnit = "restore" // TotalKV is a field we collect during backup/restore TotalKV = "total kv" // TotalBytes is a field we collect during backup/restore TotalBytes = "total bytes" // BackupDataSize is a field we collect after backup finish BackupDataSize = "backup data size(after compressed)" // RestoreDataSize is a field we collection after restore finish RestoreDataSize = "restore data size(after decompressed)" )
Variables ¶
This section is empty.
Functions ¶
func CollectDuration ¶
CollectDuration collects log time field.
func CollectFailureUnit ¶
CollectFailureUnit collects fail reason.
func CollectSuccessUnit ¶
CollectSuccessUnit collects success time costs.
func InitCollector ¶
func InitCollector( hasLogFile bool, )
InitCollector initilize global collector instance.
func SetLogCollector ¶
func SetLogCollector(l LogCollector)
SetLogCollector allow pass LogCollector outside.
func SetSuccessStatus ¶
func SetSuccessStatus(success bool)
SetSuccessStatus sets final success status.
Types ¶
type LogCollector ¶
type LogCollector interface { SetUnit(unit string) CollectSuccessUnit(name string, unitCount int, arg interface{}) CollectFailureUnit(name string, reason error) CollectDuration(name string, t time.Duration) CollectInt(name string, t int) CollectUInt(name string, t uint64) SetSuccessStatus(success bool) Summary(name string) }
LogCollector collects infos into summary log.
func NewLogCollector ¶
func NewLogCollector(log logFunc) LogCollector
NewLogCollector returns a new LogCollector.
Click to show internal directories.
Click to hide internal directories.