Ejemplo n.º 1
0
 public void AssignFromObserver(Observer observer)
 {
     sentRate.Set(observer.sendRate);
     successRate.Set(observer.successRate);
     failSendRate.Set(observer.failSendRate);
     failResponseRate.Set(observer.failResponseRate);
     expiredRate.Set(observer.expiredRate);
     keyNotFoundRate.Set(observer.keyNotFoundRate);
     latency.Set(observer.latency);
 }
Ejemplo n.º 2
0
        public override void Run(RuntimeContext context, IChannel channel)
        {
            IPerfCounter    mainPoolCounter = PerfCounterFactory.Create(PerfCounterImplType.AutoPilot, "iperf_ex", "tds1", PerfCounterType.Number);
            IPerfCounter    extraCouter     = PerfCounterFactory.Create(PerfCounterImplType.Automatic, "iperf_ex", "tds2", PerfCounterType.Number);
            ProAndConsModel server          = new ProAndConsModel();
            Thread          serverThread    = new Thread(() => server.run(2, 2));

            serverThread.Start();
            while (true)
            {
                String workingDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
                InstrumentationHelper.Info("location", workingDir);

                mainPoolCounter.Set(server.getPoolValue());
                extraCouter.Set(server.getThreadNum());
                Thread.Sleep(500);
            }
        }