public void SetRawValue(string eventName, long value) { PCWrapper.CountingEvent countingEvent = this.events.TryGetValue(eventName); if (countingEvent == null) { return; } countingEvent.RawValue = value; if (this.InnerInstance != null) { this.InnerInstance.SetRawValue(eventName, value); } }
public void IncrementBy(string eventName, long value) { PCWrapper.CountingEvent countingEvent = this.events.TryGetValue(eventName); if (countingEvent == null) { return; } countingEvent.IncrementBy(value); if (this.InnerInstance != null) { this.InnerInstance.IncrementBy(eventName, value); } }
public void Init() { PCWrapper.CountingEvent countingEvent = new PCWrapper.CountingEvent { Name = "Operation count" }; PCWrapper.CountingEvent countingEvent2 = new PCWrapper.CountingEvent { Name = "Operation time" }; PCWrapper.CountingEvent countingEvent3 = new PCWrapper.CountingEvent { Name = "Step count" }; PCWrapper.CountingEvent countingEvent4 = new PCWrapper.CountingEvent { Name = "Step time" }; PCWrapper.CountingEvent countingEvent5 = new PCWrapper.CountingEvent { Name = "Operation success" }; this.events[countingEvent.Name] = countingEvent; this.events[countingEvent2.Name] = countingEvent2; this.events[countingEvent3.Name] = countingEvent3; this.events[countingEvent4.Name] = countingEvent4; this.events[countingEvent5.Name] = countingEvent5; PCWrapper.SimpleCounter simpleCounter = new PCWrapper.SimpleCounter("Operation Count", this.InstanceName); PCWrapper.FractionCounter fractionCounter = new PCWrapper.FractionCounter("Step per Operation", "Step per Operation base", this.InstanceName); PCWrapper.FractionCounter fractionCounter2 = new PCWrapper.FractionCounter("Time per Operation", "Time per Operation base", this.InstanceName); PCWrapper.FractionCounter fractionCounter3 = new PCWrapper.FractionCounter("Time per Step", "Time per Step base", this.InstanceName); PCWrapper.FractionCounter fractionCounter4 = new PCWrapper.FractionCounter("Success Ratio", "Success Ratio base", this.InstanceName); countingEvent.AddCounter(simpleCounter.PC); countingEvent3.AddCounter(fractionCounter.PC); countingEvent.AddCounter(fractionCounter.BasePC); countingEvent2.AddCounter(fractionCounter2.PC); countingEvent.AddCounter(fractionCounter2.BasePC); countingEvent4.AddCounter(fractionCounter3.PC); countingEvent3.AddCounter(fractionCounter3.BasePC); countingEvent5.AddCounter(fractionCounter4.PC); countingEvent.AddCounter(fractionCounter4.BasePC); }