Granville Barnett

Variance and standard deviation of process wait times with CPUSS

Getting the variance and standard deviation of process wait times over the course of the simulation is really simple, it's simply a call to a few methods.

Note: in CPUSS 0.7 there will be overloads for GetVariance and GetStandardDeviation that accept a predicate function so you can get the stats on specific processes.

    1 using System;

    2 using Cpuss;

    3 using Cpuss.Strategies;

    4 

    5 namespace ConsoleApplication1

    6 {

    7     class Program

    8     {

    9         static void Main()

   10         {

   11             Runner runner = new Runner(15, 12, 34, new ShortestJobFirstExpert(5, 25));

   12             runner.Run();

   13             Console.WriteLine("{0}ns", runner.GetVariance());

   14             Console.WriteLine("{0}ns", runner.GetStandardDeviation());

   15             // ...

   16         }

   17     }

   18 }

 

Comments

No Comments