Get the value of a field from data collected with RM_GetServerInfo(). If the * field is not found, or is not numerical or out of range, return value will be * 0, and the optional out_err argument will be set to REDISMODULE_ERR. */
| 7174 | * field is not found, or is not numerical or out of range, return value will be |
| 7175 | * 0, and the optional out_err argument will be set to REDISMODULE_ERR. */ |
| 7176 | unsigned long long RM_ServerInfoGetFieldUnsigned(RedisModuleServerInfoData *data, const char* field, int *out_err) { |
| 7177 | unsigned long long ll; |
| 7178 | sds val = raxFind(data->rax, (unsigned char *)field, strlen(field)); |
| 7179 | if (val == raxNotFound) { |
| 7180 | if (out_err) *out_err = REDISMODULE_ERR; |
| 7181 | return 0; |
| 7182 | } |
| 7183 | if (!string2ull(val,&ll)) { |
| 7184 | if (out_err) *out_err = REDISMODULE_ERR; |
| 7185 | return 0; |
| 7186 | } |
| 7187 | if (out_err) *out_err = REDISMODULE_OK; |
| 7188 | return ll; |
| 7189 | } |
| 7190 | |
| 7191 | /* Get the value of a field from data collected with RM_GetServerInfo(). If the |
| 7192 | * field is not found, or is not a double, return value will be 0, and the |
nothing calls this directly
no test coverage detected