Exemplo n.º 1
0
        public void MergeFrom(TraceConfig other)
        {
            if (other == null)
            {
                return;
            }
            if (other.MaxNumberOfAttributes != 0L)
            {
                MaxNumberOfAttributes = other.MaxNumberOfAttributes;
            }
            if (other.MaxNumberOfAnnotations != 0L)
            {
                MaxNumberOfAnnotations = other.MaxNumberOfAnnotations;
            }
            if (other.MaxNumberOfMessageEvents != 0L)
            {
                MaxNumberOfMessageEvents = other.MaxNumberOfMessageEvents;
            }
            if (other.MaxNumberOfLinks != 0L)
            {
                MaxNumberOfLinks = other.MaxNumberOfLinks;
            }
            switch (other.SamplerCase)
            {
            case SamplerOneofCase.ProbabilitySampler:
                if (ProbabilitySampler == null)
                {
                    ProbabilitySampler = new global::OpenTelemetry.Proto.Trace.V1.ProbabilitySampler();
                }
                ProbabilitySampler.MergeFrom(other.ProbabilitySampler);
                break;

            case SamplerOneofCase.ConstantSampler:
                if (ConstantSampler == null)
                {
                    ConstantSampler = new global::OpenTelemetry.Proto.Trace.V1.ConstantSampler();
                }
                ConstantSampler.MergeFrom(other.ConstantSampler);
                break;

            case SamplerOneofCase.RateLimitingSampler:
                if (RateLimitingSampler == null)
                {
                    RateLimitingSampler = new global::OpenTelemetry.Proto.Trace.V1.RateLimitingSampler();
                }
                RateLimitingSampler.MergeFrom(other.RateLimitingSampler);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
Exemplo n.º 2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (samplerCase_ == SamplerOneofCase.ProbabilitySampler)
            {
                hash ^= ProbabilitySampler.GetHashCode();
            }
            if (samplerCase_ == SamplerOneofCase.ConstantSampler)
            {
                hash ^= ConstantSampler.GetHashCode();
            }
            if (samplerCase_ == SamplerOneofCase.RateLimitingSampler)
            {
                hash ^= RateLimitingSampler.GetHashCode();
            }
            if (MaxNumberOfAttributes != 0L)
            {
                hash ^= MaxNumberOfAttributes.GetHashCode();
            }
            if (MaxNumberOfAnnotations != 0L)
            {
                hash ^= MaxNumberOfAnnotations.GetHashCode();
            }
            if (MaxNumberOfMessageEvents != 0L)
            {
                hash ^= MaxNumberOfMessageEvents.GetHashCode();
            }
            if (MaxNumberOfLinks != 0L)
            {
                hash ^= MaxNumberOfLinks.GetHashCode();
            }
            hash ^= (int)samplerCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }