CacheRatio2JSONString converts the cache ratio map to a JSON string
()
| 71 | |
| 72 | // CacheRatio2JSONString converts the cache ratio map to a JSON string |
| 73 | func CacheRatio2JSONString() string { |
| 74 | cacheRatioMapMutex.RLock() |
| 75 | defer cacheRatioMapMutex.RUnlock() |
| 76 | jsonBytes, err := json.Marshal(cacheRatioMap) |
| 77 | if err != nil { |
| 78 | common.SysError("error marshalling cache ratio: " + err.Error()) |
| 79 | } |
| 80 | return string(jsonBytes) |
| 81 | } |
| 82 | |
| 83 | // UpdateCacheRatioByJSONString updates the cache ratio map from a JSON string |
| 84 | func UpdateCacheRatioByJSONString(jsonStr string) error { |
no test coverage detected