public override int GetHashCode() { int hash = 1; if (HasBoolValue) { hash ^= BoolValue.GetHashCode(); } if (HasIntValue) { hash ^= IntValue.GetHashCode(); } if (HasFloatValue) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FloatValue); } if (HasStringValue) { hash ^= StringValue.GetHashCode(); } if (HasBlobValue) { hash ^= BlobValue.GetHashCode(); } if (HasUintValue) { hash ^= UintValue.GetHashCode(); } hash ^= (int)typeCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public override int GetHashCode() { int hash = 1; if (kindCase_ == KindOneofCase.StringValue) { hash ^= StringValue.GetHashCode(); } if (kindCase_ == KindOneofCase.FloatValue) { hash ^= FloatValue.GetHashCode(); } if (kindCase_ == KindOneofCase.DoubleValue) { hash ^= DoubleValue.GetHashCode(); } if (kindCase_ == KindOneofCase.IntValue) { hash ^= IntValue.GetHashCode(); } if (kindCase_ == KindOneofCase.UintValue) { hash ^= UintValue.GetHashCode(); } if (kindCase_ == KindOneofCase.SintValue) { hash ^= SintValue.GetHashCode(); } if (kindCase_ == KindOneofCase.BoolValue) { hash ^= BoolValue.GetHashCode(); } hash ^= (int)kindCase_; return(hash); }
public void CompareEqualsTest() { UintValue uintValue1 = new UintValue(12); UintValue uintValue2 = new UintValue(12); Assert.AreEqual(0, uintValue1.CompareTo(uintValue2)); }
public void CompareMoreThanTest() { UintValue uintValue1 = new UintValue(13); UintValue uintValue2 = new UintValue(12); Assert.AreEqual(1, uintValue1.CompareTo(uintValue2)); }
public void ConvertToZeroOneScaleZeroTestTest() { UintValue uintValue1 = new UintValue(50); UintValue uintValue2 = new UintValue(0); var convertToZeroOneScale = uintValue1.ConvertToZeroOneScale(uintValue2); Assert.AreEqual(0.0, convertToZeroOneScale); }
public SamplingCriteriaContext(UintValue maxTopStackOccurrence, DoubleValue maxDuration) { Contract.Requires(maxTopStackOccurrence != null); Contract.Requires(maxDuration != null); _maxTopStackOccurrence = maxTopStackOccurrence; _maxDuration = maxDuration; _availableCriteria = new Criterion[]{TopStackOccurrenceCriterion, DurationCriterion}; }
public SamplingCriteriaContext(UintValue maxTopStackOccurrence, DoubleValue maxDuration) { Contract.Requires(maxTopStackOccurrence != null); Contract.Requires(maxDuration != null); _maxTopStackOccurrence = maxTopStackOccurrence; _maxDuration = maxDuration; _availableCriteria = new Criterion[] { TopStackOccurrenceCriterion, DurationCriterion }; }
public void SetUp() { _enterCount = new UintValue(1); _wallClockDurationHns = new Uint64Value(2); _activeTime = new DoubleValue(3); Mock<IEnumerable<Method>> mockCallingMethods = new Mock<IEnumerable<Method>>(MockBehavior.Strict); Mock<IEnumerable<Method>> mockCalledMethods = new Mock<IEnumerable<Method>>(MockBehavior.Strict); _method = new TracingMethod(1,"stub", 20, 50, "MethodFull", @"C:\code\source.cs",_enterCount,_wallClockDurationHns,_activeTime );//, mockCallingMethods.Object, //mockCalledMethods.Object); }
public TracingCriteriaContext(UintValue maxCallCount, Uint64Value maxTimeWallClock, DoubleValue maxTimeActive) { Contract.Requires(maxCallCount != null); Contract.Requires(maxTimeWallClock != null); Contract.Requires(maxTimeActive != null); _maxCallCount = maxCallCount; _maxTimeWallClock = maxTimeWallClock; _maxTimeWallClock = maxTimeWallClock; _maxTimeActive = maxTimeActive; _availableCriteria = new Criterion[] { CallCountCriterion, TimeWallClockCriterion, TimeActiveCriterion }; }
public void SetUp() { _enterCount = new UintValue(1); _wallClockDurationHns = new Uint64Value(2); _activeTime = new DoubleValue(3); Mock <IEnumerable <Method> > mockCallingMethods = new Mock <IEnumerable <Method> >(MockBehavior.Strict); Mock <IEnumerable <Method> > mockCalledMethods = new Mock <IEnumerable <Method> >(MockBehavior.Strict); _method = new TracingMethod(1, "stub", 20, 50, "MethodFull", @"C:\code\source.cs", _enterCount, _wallClockDurationHns, _activeTime);//, mockCallingMethods.Object, //mockCalledMethods.Object); }
public void SetUp() { _callCountCriterion = new CallCountCriterion(); _timeActiveCriterion = new TimeActiveCriterion(); _timeWallClockCriterion = new TimeWallClockCriterion(); _maxCallCount = new UintValue(50); _maxTimeWallClock = new Uint64Value(100); _maxTimeActive = new DoubleValue(150); _tracingCriteriaContext = new TracingCriteriaContext(_maxCallCount, _maxTimeWallClock, _maxTimeActive); }
public SamplingMethod( uint id, string name, int firstLineNumber, int lineExtend, string classFullName, string sourceFile, UintValue topStackOccurrence, DoubleValue duration) : base(id, name, firstLineNumber, lineExtend, classFullName, sourceFile) { _topStackOccurrence = topStackOccurrence; _duration = duration; }
public TracingMethod( uint id, string name, int firstLineNumber, int lineExtend, string classFullName, string sourceFile, UintValue callCountValue, Uint64Value timeWallClockValue, DoubleValue timeActiveValue) : base(id, name, firstLineNumber, lineExtend,classFullName,sourceFile) { _callCountValue = callCountValue; _timeWallClockValue = timeWallClockValue; _timeActiveValue = timeActiveValue; }
public TracingMethod( uint id, string name, int firstLineNumber, int lineExtend, string classFullName, string sourceFile, UintValue callCountValue, Uint64Value timeWallClockValue, DoubleValue timeActiveValue) : base(id, name, firstLineNumber, lineExtend, classFullName, sourceFile) { _callCountValue = callCountValue; _timeWallClockValue = timeWallClockValue; _timeActiveValue = timeActiveValue; }
public override int GetHashCode() { int hash = 1; if (HasBoolValue) { hash ^= BoolValue.GetHashCode(); } if (HasIntValue) { hash ^= IntValue.GetHashCode(); } if (HasFloatValue) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FloatValue); } if (HasStringValue) { hash ^= StringValue.GetHashCode(); } if (HasBlobValue) { hash ^= BlobValue.GetHashCode(); } if (HasMessageValue) { hash ^= MessageValue.GetHashCode(); } if (HasFourccValue) { hash ^= FourccValue.GetHashCode(); } if (HasUintValue) { hash ^= UintValue.GetHashCode(); } if (HasEntityIdValue) { hash ^= EntityIdValue.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
protected void CreateCriteriaContext() { var maxTopStackOccurrence = new UintValue(uint.MinValue); var maxDuration = new DoubleValue(uint.MinValue); foreach (Method method in _methodDictionary.Values) { maxTopStackOccurrence = (UintValue)Max(method.GetValueFor(SamplingCriteriaContext.TopStackOccurrenceCriterion), maxTopStackOccurrence); maxDuration = (DoubleValue) Max(method.GetValueFor(SamplingCriteriaContext.DurationCriterion), maxDuration); } CriteriaContext = new SamplingCriteriaContext( maxTopStackOccurrence, maxDuration); }
protected void CreateCriteriaContext() { var maxTopStackOccurrence = new UintValue(uint.MinValue); var maxDuration = new DoubleValue(uint.MinValue); foreach (Method method in _methodDictionary.Values) { maxTopStackOccurrence = (UintValue) Max(method.GetValueFor(SamplingCriteriaContext.TopStackOccurrenceCriterion), maxTopStackOccurrence); maxDuration = (DoubleValue) Max(method.GetValueFor(SamplingCriteriaContext.DurationCriterion), maxDuration); } CriteriaContext = new SamplingCriteriaContext( maxTopStackOccurrence, maxDuration); }
public override int GetHashCode() { int hash = 1; if (BoolValue != false) { hash ^= BoolValue.GetHashCode(); } if (IntValue != 0L) { hash ^= IntValue.GetHashCode(); } if (FloatValue != 0D) { hash ^= FloatValue.GetHashCode(); } if (StringValue.Length != 0) { hash ^= StringValue.GetHashCode(); } if (BlobValue.Length != 0) { hash ^= BlobValue.GetHashCode(); } if (MessageValue.Length != 0) { hash ^= MessageValue.GetHashCode(); } if (FourccValue.Length != 0) { hash ^= FourccValue.GetHashCode(); } if (UintValue != 0UL) { hash ^= UintValue.GetHashCode(); } if (entityIdValue_ != null) { hash ^= EntityIdValue.GetHashCode(); } return(hash); }
protected void CreateCriteriaContext() { var maxCallCount = new UintValue(uint.MinValue); var maxWallClockDuration = new Uint64Value(uint.MinValue); var maxActiveTime = new DoubleValue(double.MinValue); foreach (Method method in _methodDictionary.Values) { maxCallCount = (UintValue) Max(method.GetValueFor(TracingCriteriaContext.CallCountCriterion), maxCallCount); maxWallClockDuration = (Uint64Value) Max(method.GetValueFor(TracingCriteriaContext.TimeWallClockCriterion), maxWallClockDuration); maxActiveTime = (DoubleValue) Max(method.GetValueFor(TracingCriteriaContext.TimeActiveCriterion), maxActiveTime); } CriteriaContext = new TracingCriteriaContext( maxCallCount, maxWallClockDuration, maxActiveTime); }
protected void CreateCriteriaContext() { var maxCallCount = new UintValue(uint.MinValue); var maxWallClockDuration = new Uint64Value(uint.MinValue); var maxActiveTime = new DoubleValue(double.MinValue); foreach (Method method in _methodDictionary.Values) { maxCallCount = (UintValue)Max(method.GetValueFor(TracingCriteriaContext.CallCountCriterion), maxCallCount); maxWallClockDuration = (Uint64Value) Max(method.GetValueFor(TracingCriteriaContext.TimeWallClockCriterion), maxWallClockDuration); maxActiveTime = (DoubleValue)Max(method.GetValueFor(TracingCriteriaContext.TimeActiveCriterion), maxActiveTime); } CriteriaContext = new TracingCriteriaContext( maxCallCount, maxWallClockDuration, maxActiveTime); }
public override int GetHashCode() { int hash = 1; if (StringValue.Length != 0) { hash ^= StringValue.GetHashCode(); } if (FloatValue != 0F) { hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FloatValue); } if (DoubleValue != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleValue); } if (IntValue != 0L) { hash ^= IntValue.GetHashCode(); } if (UintValue != 0UL) { hash ^= UintValue.GetHashCode(); } if (SintValue != 0L) { hash ^= SintValue.GetHashCode(); } if (BoolValue != false) { hash ^= BoolValue.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public void SetUp() { _maxTopStackOccurrence = new UintValue(50); _maxDuration = new DoubleValue(100); _samplingCriteriaContext = new SamplingCriteriaContext(_maxTopStackOccurrence, _maxDuration); }