Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] API requests summary and cost estimate for each command #4871

Open
hellodword opened this issue Jun 19, 2024 · 0 comments
Open

Comments

@hellodword
Copy link

hellodword commented Jun 19, 2024

Output of restic version

restic 0.16.4 compiled with go1.22.3 on linux/amd64

What should restic do differently? Which functionality do you think we should add?

I'm using restic with some object storage services, and as you know, some operations are expensive, so sometimes I want to know how many Class-A operations or Class-B operations does restic * cost.

DEBUG_FILES=* DEBUG_FUNCS=* and --verbose=2 are helpful but not very human readable.

I think it'll be great if there're some detailed reports about command A just did 123 s3:PutObject requests and 456 s3:GetObject requests in the end.

I found a related issue #2239 but I prefer implementing it in the program instead of only documenting it.

What are you trying to do? What problem would this solve?

I made a dirty patch, see hellodword/restic@v0.16.4...printextra

$ go run ./cmd/restic init
created restic repository f7f61780d6 at s3:http://172.17.0.1:9000/test
Please note that knowledge of your password is required to access
the repository. Losing your password means that your data is
irrecoverably lost.
extra (ListObjects)(The specified bucket does not exist) 2
extra (BucketExists)(200) 1
extra (MakeBucket)(200) 1
extra (GetObject)(200) 1
extra (PutObject)(200) 2

$ go run ./cmd/restic backup ./internal
repository f7f61780 opened (version 2, compression level auto)
created new cache in /home/vscode/.cache/restic
no parent snapshot found, will read all files
Files:         432 new,     0 changed,     0 unmodified
Dirs:           58 new,     0 changed,     0 unmodified
Added to the repository: 15.863 MiB (14.588 MiB stored)
processed 432 files, 15.696 MiB in 0:00
snapshot 1874dc45 saved
extra (GetObject)(200) 3
extra (PutObject)(200) 5
extra (RemoveObject)(200) 1
extra (ListObjects)(200) 3

$ go run ./cmd/restic backup ./internal
repository f7f61780 opened (version 2, compression level auto)
using parent snapshot 1874dc45
Files:           0 new,     0 changed,   432 unmodified
Dirs:            0 new,     0 changed,    58 unmodified
Added to the repository: 0 B   (0 B   stored)
processed 432 files, 15.696 MiB in 0:00
snapshot 24386e7a saved
extra (RemoveObject)(200) 1
extra (ListObjects)(200) 5
extra (GetObject)(200) 3
extra (PutObject)(200) 2

$ go run ./cmd/restic check --with-cache
repository f7f61780 opened (version 2, compression level auto)
[0:00] 100.00%  1 / 1 index files loaded
[0:00] 100.00%  2 / 2 snapshots
no errors were found
extra (ListObjects)(200) 6
extra (GetObject)(200) 3
extra (PutObject)(200) 1
extra (RemoveObject)(200) 1

$ go run ./cmd/restic check --no-cache
repository f7f61780 opened (version 2, compression level auto)
[0:00] 100.00%  1 / 1 index files loaded
[0:00] 100.00%  2 / 2 snapshots
no errors were found
extra (ListObjects)(200) 6
extra (GetObject)(200) 65
extra (PutObject)(200) 1
extra (RemoveObject)(200) 1

It's just a PoC to show what I'm thinking, there're much more things to work with.

Also, a new option --estimate maybe useful, it estimates the costs based on the command, backend, cache... similar with --dry-run but focus on the money :)

What do you think?

Did restic help you today? Did it make you happy in any way?

Sure, I love it!

@hellodword hellodword changed the title Add statistics for each command Add requests summary for each command Jun 20, 2024
@hellodword hellodword changed the title Add requests summary for each command [Feature Request] API requests summary and cost estimate for each command Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant