package ticktock import ( "time" "gitlink.org.cn/cloudream/common/pkgs/logger" "gitlink.org.cn/cloudream/common/utils/reflect2" ) type SpeedStatsStep struct { } func (j *SpeedStatsStep) Name() string { return reflect2.TypeNameOf[SpeedStatsStep]() } func (j *SpeedStatsStep) Execute(t *TickTock) { log := logger.WithType[SpeedStatsStep]("Event") startTime := time.Now() log.Infof("job start") defer func() { log.Infof("job end, time: %v", time.Since(startTime)) }() t.speedStats.Step() status := t.speedStats.DumpStatus() log.Infof("100M: %f, %f; 1G: %f, %f; Above1G: %f, %f\n", status.Below100M[0].AvarageSpeed, status.Below100M[1].AvarageSpeed, status.Below1G[0].AvarageSpeed, status.Below1G[1].AvarageSpeed, status.Above1G[0].AvarageSpeed, status.Above1G[1].AvarageSpeed, ) }