 
         if (settings.stats)
         {
-            printStats(queues[i], times[i], blockSize, i == 0);
-
+            printStats(queues[i], times[i], blockSize, settings);
         }
     }
 

        
        double bw = (blocks * blockSize) / time;

        fprintf(stdout, " %5x; %8u; %12zu; %12.3f; %12.3f;\n",
                queue->no, t.commands, t.blocks, time, bw);
    }
}


    std::sort(data.begin(), data.end(), std::greater<double>());
    std::reverse(data.begin(), data.end());

    fprintf(stderr, " max: %14.3f\n", data.back());
    for (auto p: {.99, .97, .95, .90, .75, .50, .25})
    {
        fprintf(stderr, "%4.2f: %14.3f\n", p, percentile(data, p));
    }
    fprintf(stderr, " min: %14.3f\n", data.front());
}

static void printStats(const QueuePtr& queue, const Times& times, size_t blockSize, const Settings& settings)
{
    if (queue->no == 1)
    {
        fprintf(stdout, "#%5s; %6s; %4s; %13s; %8s; %8s; %12s; %12s; %12s;\n",
                "queue", "sqhost", "type", "pattern", "depth", "cmds", "blocks", "lat", "bw");
    }

    auto pattern = patternString(settings);
    auto patternPtr = pattern.c_str();

#ifdef __DIS_CLUSTER__
    bool local = !settings.remote;
#else
    bool local = true;
#endif

    bool gpu = settings.cudaDevice != -1;

    for (const auto& t: times)
    {
        auto time = t.time.count();
