public void Setup() { udp = MockRepository.GenerateMock <IStatsdUDP>(); _randomGenerator = MockRepository.GenerateMock <IRandomGenerator>(); _randomGenerator.Stub(x => x.ShouldSend(Arg <double> .Is.Anything)).Return(true); _stopwatch = MockRepository.GenerateMock <IStopWatchFactory>(); }
public Statsd(IStatsdUDP udp, IRandomGenerator randomGenerator, IStopWatchFactory stopwatchFactory, string prefix) { StopwatchFactory = stopwatchFactory; Udp = udp; RandomGenerator = randomGenerator; _prefix = prefix; }
public void Setup() { _udp = MockRepository.GenerateMock<IStatsdUDP>(); _randomGenerator = MockRepository.GenerateMock<IRandomGenerator>(); _randomGenerator.Stub(x => x.ShouldSend(Arg<double>.Is.Anything)).Return(true); _stopwatch = MockRepository.GenerateMock<IStopWatchFactory>(); }
public void Setup() { _udp = Mock.Of <IStatsdUDP>(); _randomGenerator = Mock.Of <IRandomGenerator>(); Mock.Get(_randomGenerator).Setup(x => x.ShouldSend(It.IsAny <double>())).Returns(true); _stopwatch = Mock.Of <IStopWatchFactory>(); }
internal Statsd( IStatsdUDP udp, IRandomGenerator randomGenerator, IStopWatchFactory stopwatchFactory, string prefix, string[] constantTags, Telemetry optionalTelemetry) { StopwatchFactory = stopwatchFactory; Udp = udp; RandomGenerator = randomGenerator; _prefix = prefix; _optionalTelemetry = optionalTelemetry; string entityId = Environment.GetEnvironmentVariable(StatsdConfig.DD_ENTITY_ID_ENV_VAR); if (string.IsNullOrEmpty(entityId)) { // copy array to prevent changes, coalesce to empty array _constantTags = constantTags?.ToArray() ?? EmptyStringArray; } else { var entityIdTags = new[] { $"{_entityIdInternalTagKey}:{entityId}" }; _constantTags = constantTags == null ? entityIdTags : constantTags.Concat(entityIdTags).ToArray(); } }
public Statsd(IStatsdUDP udp, IRandomGenerator randomGenerator, IStopWatchFactory stopwatchFactory, string prefix) { Commands = new List <string>(); StopwatchFactory = stopwatchFactory; Udp = udp; RandomGenerator = randomGenerator; _prefix = prefix; }
public Statsd( IStatsdUDP udp, IRandomGenerator randomGenerator, IStopWatchFactory stopwatchFactory, string prefix, string[] constantTags) : this(udp, randomGenerator, stopwatchFactory, prefix, constantTags, null) { }
internal Statsd( IStatsdUDP udp, IRandomGenerator randomGenerator, IStopWatchFactory stopwatchFactory, string prefix, string[] constantTags, Telemetry optionalTelemetry) { StopwatchFactory = stopwatchFactory; Udp = udp; RandomGenerator = randomGenerator; _prefix = prefix; _optionalTelemetry = optionalTelemetry; var environmentTags = new List <string>(); string entityId = Environment.GetEnvironmentVariable(StatsdConfig.DD_ENTITY_ID_ENV_VAR); if (!string.IsNullOrEmpty(entityId)) { environmentTags.Add($"{_entityIdInternalTagKey}:{entityId}"); } string service = Environment.GetEnvironmentVariable(StatsdConfig.ServiceEnvVar); if (!string.IsNullOrEmpty(service)) { environmentTags.Add($"{StatsdConfig.ServiceTagKey}:{service}"); } string env = Environment.GetEnvironmentVariable(StatsdConfig.EnvironmentEnvVar); if (!string.IsNullOrEmpty(env)) { environmentTags.Add($"{StatsdConfig.EnvironmentTagKey}:{env}"); } string version = Environment.GetEnvironmentVariable(StatsdConfig.VersionEnvVar); if (!string.IsNullOrEmpty(version)) { environmentTags.Add($"{StatsdConfig.VersionTagKey}:{version}"); } if (environmentTags.Count == 0) { // copy array to prevent changes, coalesce to empty array _constantTags = constantTags?.ToArray() ?? EmptyStringArray; } else { _constantTags = constantTags == null?environmentTags.ToArray() : constantTags.Concat(environmentTags).ToArray(); } }
public Statsd(IStatsdUDP udp) : this(udp, "") { }
public Statsd(IStatsdUDP udp, string prefix) : this(udp, new RandomGenerator(), new StopWatchFactory(), prefix) { }
public Statsd(IStatsdUDP udp, IRandomGenerator randomGenerator, IStopWatchFactory stopwatchFactory) : this(udp, randomGenerator, stopwatchFactory, string.Empty) { }
public Statsd(IStatsdUDP udp, IRandomGenerator randomGenerator, IStopWatchFactory stopwatchFactory, string prefix) : this(udp, randomGenerator, stopwatchFactory, prefix, null) { }
public Statsd(IStatsdUDP udp) : this(udp, string.Empty) { }
public void Setup() { _udp = MockRepository.GenerateMock<IStatsdUDP>(); }
public void Setup() { _udp = MockRepository.GenerateMock <IStatsdUDP>(); // _samplerFunc = MockRepository.GenerateMock<SamplerFunc>(); //_samplerFunc.Stub(x => x.ShouldSend(Arg<double>.Is.Anything)).Return(true); }
public void Setup() { _udp = MockRepository.GenerateMock <IStatsdUDP>(); }