Commit c032dc45 authored by meir@redislabs.com's avatar meir@redislabs.com
Browse files

changed GetUsedMemoryPresentage -> GetUsedMemoryRatio and return value between 0 and 1.

parent aded138a
......@@ -5905,10 +5905,10 @@ size_t RM_MallocSize(void* ptr){
* 0 - no memory limit
* 100 and above, memory limit reached.
*/
float RM_GetUsedMemoryPercentage(){
float RM_GetUsedMemoryRatio(){
float level;
getMaxmemoryState(NULL, NULL, NULL, &level);
return level * 100;
return level;
}
/* --------------------------------------------------------------------------
......@@ -6991,6 +6991,6 @@ void moduleRegisterCoreAPI(void) {
REGISTER_API(BlockClientOnKeys);
REGISTER_API(SignalKeyAsReady);
REGISTER_API(GetBlockedClientReadyKey);
REGISTER_API(GetUsedMemoryPercentage);
REGISTER_API(GetUsedMemoryRatio);
REGISTER_API(MallocSize);
}
......@@ -633,7 +633,7 @@ int REDISMODULE_API_FUNC(RedisModule_CommandFilterArgDelete)(RedisModuleCommandF
int REDISMODULE_API_FUNC(RedisModule_Fork)(RedisModuleForkDoneHandler cb, void *user_data);
int REDISMODULE_API_FUNC(RedisModule_ExitFromChild)(int retcode);
int REDISMODULE_API_FUNC(RedisModule_KillForkChild)(int child_pid);
float REDISMODULE_API_FUNC(RedisModule_GetUsedMemoryPercentage)();
float REDISMODULE_API_FUNC(RedisModule_GetUsedMemoryRatio)();
size_t REDISMODULE_API_FUNC(RedisModule_MallocSize)(void* ptr);
#endif
......@@ -844,7 +844,7 @@ static int RedisModule_Init(RedisModuleCtx *ctx, const char *name, int ver, int
REDISMODULE_GET_API(Fork);
REDISMODULE_GET_API(ExitFromChild);
REDISMODULE_GET_API(KillForkChild);
REDISMODULE_GET_API(GetUsedMemoryPercentage);
REDISMODULE_GET_API(GetUsedMemoryRatio);
REDISMODULE_GET_API(MallocSize);
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment