public ProbabilisticSamplingStrategy DeepCopy() { var tmp0 = new ProbabilisticSamplingStrategy(); tmp0.SamplingRate = this.SamplingRate; return(tmp0); }
public void JaegerThriftProbabilisticSamplingStrategy_FromThrift() { var strat = new JaegerThriftProbabilisticSamplingStrategy(0.25); var from = strat.FromThrift(); Assert.Equal(strat.SamplingRate, from.SamplingRate); }
public void JaegerThriftOperationSamplingStrategy_FromThrift() { var pss = new JaegerThriftProbabilisticSamplingStrategy(0.75); var strat = new JaegerThriftOperationSamplingStrategy("opName", pss); var from = strat.FromThrift(); Assert.Equal(strat.Operation, from.Operation); Assert.Equal(pss.SamplingRate, from.ProbabilisticSampling.SamplingRate); }
public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) { iprot.IncrementRecursionDepth(); try { bool isset_strategyType = false; TField field; await iprot.ReadStructBeginAsync(cancellationToken); while (true) { field = await iprot.ReadFieldBeginAsync(cancellationToken); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.I32) { StrategyType = (SamplingStrategyType)await iprot.ReadI32Async(cancellationToken); isset_strategyType = true; } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 2: if (field.Type == TType.Struct) { ProbabilisticSampling = new ProbabilisticSamplingStrategy(); await ProbabilisticSampling.ReadAsync(iprot, cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 3: if (field.Type == TType.Struct) { RateLimitingSampling = new RateLimitingSamplingStrategy(); await RateLimitingSampling.ReadAsync(iprot, cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; case 4: if (field.Type == TType.Struct) { OperationSampling = new PerOperationSamplingStrategies(); await OperationSampling.ReadAsync(iprot, cancellationToken); } else { await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); } break; default: await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); break; } await iprot.ReadFieldEndAsync(cancellationToken); } await iprot.ReadStructEndAsync(cancellationToken); if (!isset_strategyType) { throw new TProtocolException(TProtocolException.INVALID_DATA); } } finally { iprot.DecrementRecursionDepth(); } }
public OperationSamplingStrategy(string operation, ProbabilisticSamplingStrategy probabilisticSampling) : this() { this.Operation = operation; this.ProbabilisticSampling = probabilisticSampling; }