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:
parent
be0464f5f1
commit
8243ff8bc8
25 changed files with 551 additions and 281 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue