Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

add rc cache/stats

seuffertd9c13bff83b3
diff --git a/backend/cache/cache.go b/backend/cache/cache.go
index f8766d2c2..e40611a0a 100644
--- a/backend/cache/cache.go
+++ b/backend/cache/cache.go
@@ -431,9 +431,29 @@ Params:
`,
})
+ rc.Add(rc.Call{
+ Path: "cache/stats",
+ Fn: f.httpStats,
+ Title: "Get cache stats",
+ Help: `
+Show statistics for the cache remote.
+`,
+ })
+
return f, fsErr
}
+func (f *Fs) httpStats(in rc.Params) (out rc.Params, err error) {
+ out = make(rc.Params)
+ m, err := f.Stats()
+ if err != nil {
+ return out, errors.Errorf("error while getting cache stats")
+ }
+ out["status"] = "ok"
+ out["stats"] = m
+ return out, nil
+}
+
func (f *Fs) httpExpireRemote(in rc.Params) (out rc.Params, err error) {
out = make(rc.Params)
remoteInt, ok := in["remote"]