Skip to content

Commit

Permalink
Change RAND_MAX to MAX_RANDOM_VALUE
Browse files Browse the repository at this point in the history
Co-authored-by: Jelte Fennema <jelte.fennema@microsoft.com>
  • Loading branch information
gokhangulbiz and JelteF committed Jun 22, 2023
1 parent bc602c4 commit 012e259
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/distributed/utils/citus_stat_tenants.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ AttributeTask(char *tenantId, int colocationId, CmdType commandType)
srandom((unsigned int) time(NULL));

/* Generate a random double between 0 and 1 */
double randomValue = (double) random() / RAND_MAX;
double randomValue = (double) random() / MAX_RANDOM_VALUE;
#endif
bool shouldTrackQuery = randomValue < StatTenantsSampleRateForNewTenants;
if (!shouldTrackQuery)
Expand Down

0 comments on commit 012e259

Please sign in to comment.