mirror of
https://github.com/rclone/rclone.git
synced 2025-06-06 04:44:35 +08:00
accounting: isolate stats to groups
Introduce stats groups that will isolate accounting for logically different transferring operations. That way multiple accounting operations can be done in parallel without interfering with each other stats. Using groups is optional. There is dedicated global stats that will be used by default if no group is specified. This is operating mode for CLI usage which is just fire and forget operation. For running rclone as rc http server each request will create it's own group. Also there is an option to specify your own group.
This commit is contained in:

committed by
Nick Craig-Wood

parent
be0464f5f1
commit
8243ff8bc8
@ -60,8 +60,8 @@ func TestMultithreadCopy(t *testing.T) {
|
||||
|
||||
src, err := r.Fremote.NewObject(context.Background(), "file1")
|
||||
require.NoError(t, err)
|
||||
accounting.Stats.ResetCounters()
|
||||
tr := accounting.Stats.NewTransfer(src)
|
||||
accounting.GlobalStats().ResetCounters()
|
||||
tr := accounting.GlobalStats().NewTransfer(src)
|
||||
|
||||
defer func() {
|
||||
tr.Done(err)
|
||||
|
Reference in New Issue
Block a user