def test_should_sample_utilizes_sample_rate(self): baseplate_observer = TraceBaseplateObserver('test-service', sample_rate=1) span = Span('test-id', 'test-parent', 'test-span-id', None, 0, "test") self.assertTrue(baseplate_observer.should_sample(span)) baseplate_observer.sample_rate = 0 self.assertFalse(baseplate_observer.should_sample(span))
def test_should_sample_utilizes_sample_rate(self): client = make_client("test-service", sample_rate=1) baseplate_observer = TraceBaseplateObserver(client) span = Span('test-id', 'test-parent', 'test-span-id', None, 0, "test", self.mock_context) self.assertTrue(baseplate_observer.should_sample(span)) baseplate_observer.sample_rate = 0 self.assertFalse(baseplate_observer.should_sample(span))
def test_should_sample_utilizes_sample_rate(self): baseplate_observer = TraceBaseplateObserver("test-service", sample_rate=1) span = Span("test-id", "test-parent", "test-span-id", None, 0, "test") self.assertTrue(baseplate_observer.should_sample(span)) baseplate_observer.sample_rate = 0 self.assertFalse(baseplate_observer.should_sample(span))