You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

speedstats_test.go 501 B

12345678910111213141516171819202122232425
  1. package speedstats
  2. import (
  3. "testing"
  4. "time"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func Test_Stats(t *testing.T) {
  8. Convey("Stats", t, func() {
  9. stats := Stats{}
  10. stats.Record(100, time.Second)
  11. So(stats.AvarageSpeed, ShouldAlmostEqual, 100, 0.01)
  12. stats.Step()
  13. So(stats.AvarageSpeed, ShouldAlmostEqual, 80, 0.01)
  14. stats.Record(200, time.Second)
  15. So(stats.AvarageSpeed, ShouldAlmostEqual, 120, 0.01)
  16. stats.Step()
  17. So(stats.AvarageSpeed, ShouldAlmostEqual, 96, 0.01)
  18. })
  19. }

本项目旨在将云际存储公共基础设施化,使个人及企业可低门槛使用高效的云际存储服务(安装开箱即用云际存储客户端即可,无需关注其他组件的部署),同时支持用户灵活便捷定制云际存储的功能细节。