import fs from 'fs';

const dataset = JSON.parse(fs.readFileSync('dataset.json', 'utf-8'))

const pricePerPerformance = dataset.map((item) => {
    return {
        ...item,
        costPer1k: item.spotPrice / (item.vcpus * (item.cpuSpeed / 1000)),
        workloadCost10k100: (item.spotPrice / (item.vcpus * (item.cpuSpeed / 1000))) * 10 * 100,
    }
}).sort((a, b) => a.costPer1k - b.costPer1k);

console.log(pricePerPerformance.slice(0, 10));

