jadami10 commented on PR #9844: URL: https://github.com/apache/pinot/pull/9844#issuecomment-1335392698
I changed the code locally to return random bytes. Sorting seems to work well. ``` function getRandomInt(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min) + min); // The maximum is exclusive and the minimum is inclusive } results.map((result, index) => { // since we have 3 promises, we are using mod 3 below if (index % 3 === 0) { const kb = 1000; const mb = kb * 1000; const gb = mb * 1000; const tb = gb * 1000; const pb = tb * 1000; const sizes = [kb, mb, gb, tb, pb]; const index = Math.floor(Math.random() * sizes.length); const min = Math.max(0, index - 1); const max = sizes[index]; // const max = 1125899906842624; // response of getTableSize API const { tableName, reportedSizeInBytes, estimatedSizeInBytes, } = result.data; singleTableData.push( tableName, Utils.formatBytes(getRandomInt(0, max)), Utils.formatBytes(getRandomInt(0, max)), // Utils.formatBytes(reportedSizeInBytes), // Utils.formatBytes(estimatedSizeInBytes) ); } ``` https://user-images.githubusercontent.com/4760722/205324295-06039912-9b35-4cec-a861-e9211d30ccef.mov -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org