public void MergeFrom(TraceConfig other)
        {
            if (other == null)
            {
                return;
            }
            switch (other.SamplerCase)
            {
            case SamplerOneofCase.ProbabilitySampler:
                if (ProbabilitySampler == null)
                {
                    ProbabilitySampler = new global::Opencensus.Proto.Trace.V1.ProbabilitySampler();
                }
                ProbabilitySampler.MergeFrom(other.ProbabilitySampler);
                break;

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

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

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
Ejemplo n.º 2
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::Opencensus.Proto.Trace.V1.ProbabilitySampler();
                }
                ProbabilitySampler.MergeFrom(other.ProbabilitySampler);
                break;

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

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

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;

                case 10: {
                    global::Opencensus.Proto.Trace.V1.ProbabilitySampler subBuilder = new global::Opencensus.Proto.Trace.V1.ProbabilitySampler();
                    if (samplerCase_ == SamplerOneofCase.ProbabilitySampler)
                    {
                        subBuilder.MergeFrom(ProbabilitySampler);
                    }
                    input.ReadMessage(subBuilder);
                    ProbabilitySampler = subBuilder;
                    break;
                }

                case 18: {
                    global::Opencensus.Proto.Trace.V1.ConstantSampler subBuilder = new global::Opencensus.Proto.Trace.V1.ConstantSampler();
                    if (samplerCase_ == SamplerOneofCase.ConstantSampler)
                    {
                        subBuilder.MergeFrom(ConstantSampler);
                    }
                    input.ReadMessage(subBuilder);
                    ConstantSampler = subBuilder;
                    break;
                }

                case 26: {
                    global::Opencensus.Proto.Trace.V1.RateLimitingSampler subBuilder = new global::Opencensus.Proto.Trace.V1.RateLimitingSampler();
                    if (samplerCase_ == SamplerOneofCase.RateLimitingSampler)
                    {
                        subBuilder.MergeFrom(RateLimitingSampler);
                    }
                    input.ReadMessage(subBuilder);
                    RateLimitingSampler = subBuilder;
                    break;
                }
                }
            }
        }