# Is there a way to get the upload bytes last second in real time?

**URL:** <https://forum.rclone.org/t/is-there-a-way-to-get-the-upload-bytes-last-second-in-real-time/43020>\
**Category:** Dev Discussions\
**Created:** [November 23, 2023, 3:59am UTC](https://forum.rclone.org/t/is-there-a-way-to-get-the-upload-bytes-last-second-in-real-time/43020 "2023-11-23T03:59:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkonfj](https://forum.rclone.org/user_avatar/forum.rclone.org/rkonfj/32/16424_2.png) [@rkonfj](https://forum.rclone.org/u/rkonfj)\
**Post date:** [November 23, 2023, 3:59am UTC](https://forum.rclone.org/t/is-there-a-way-to-get-the-upload-bytes-last-second-in-real-time/43020/1 "2023-11-23T03:59:07Z")

</div>

Thanks to the nice rclone , I'm using it to develop a sync program, below is the core part of my code:

```auto
fs, err := fs.NewFs(ctx, "s3:")
checkErr(err)
fs1 := vfs.New(fs, nil)

src, err := os.Open("/home/rkonfj/a-5g-file.bin")
checkErr(err)
defer src.Close()
dst, err := fs1.OpenFile("/abc/a-5g-file.bin", os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)
checkErr(err)

n, err := io.Copy(dst, src)
checkErr(err)

err = dst.Close()
checkErr(err)

fmt.Println(n, "bytes copied")

```

How to get the upload speed last second in real time?

Thanks again!

---

<div class="post-metadata">

**Author:** ![rkonfj](https://forum.rclone.org/user_avatar/forum.rclone.org/rkonfj/32/16424_2.png) [@rkonfj](https://forum.rclone.org/u/rkonfj)\
**Post date:** [November 23, 2023, 4:04am UTC](https://forum.rclone.org/t/is-there-a-way-to-get-the-upload-bytes-last-second-in-real-time/43020/2 "2023-11-23T04:04:47Z")

</div>

I have implemented a `WriterWrapper` to get the number of bytes transferred in the last second, but because of the chunks cache, it is the number of bytes copied to RAM, not the number of bytes copied to the remote.

Is there a way to get the correct last second number of bytes copied?

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [November 23, 2023, 9:36am UTC](https://forum.rclone.org/t/is-there-a-way-to-get-the-upload-bytes-last-second-in-real-time/43020/3 "2023-11-23T09:36:27Z")

</div>

Take a look at the result of `accounting.GlobalStats()`.

Note that we don't provide a stable interface to the rclone code like this - if you want that you will need to use librclone

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [January 23, 2024, 5:36am UTC](https://forum.rclone.org/t/is-there-a-way-to-get-the-upload-bytes-last-second-in-real-time/43020/4 "2024-01-23T05:36:59Z")

</div>

Closed on January 23, 2024, 5:36am UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
