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"]