コード例 #1
0
 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))
コード例 #2
0
 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))
コード例 #3
0
 def test_should_sample_utilizes_force_sampling(self):
     client = make_client("test-service", sample_rate=0)
     baseplate_observer = TraceBaseplateObserver(client)
     span_with_forced = Span('test-id', 'test-parent', 'test-span-id',
                             False, 1, "test", self.mock_context)
     span_without_forced = Span('test-id', 'test-parent', 'test-span-id',
                                False, 0, "test", self.mock_context)
     self.assertTrue(baseplate_observer.should_sample(span_with_forced))
     self.assertFalse(baseplate_observer.should_sample(span_without_forced))
コード例 #4
0
 def test_should_sample_utilizes_force_sampling(self):
     baseplate_observer = TraceBaseplateObserver('test-service',
                                                 sample_rate=0)
     span_with_forced = Span('test-id', 'test-parent', 'test-span-id',
                             False, 1, "test")
     span_without_forced = Span('test-id', 'test-parent', 'test-span-id',
                                False, 0, "test")
     self.assertTrue(baseplate_observer.should_sample(span_with_forced))
     self.assertFalse(baseplate_observer.should_sample(span_without_forced))
コード例 #5
0
ファイル: tracing_tests.py プロジェクト: ckwang8128/baseplate
 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))
コード例 #6
0
 def test_should_sample_utilizes_sampled_setting(self):
     client = make_client("test-service", sample_rate=0)
     baseplate_observer = TraceBaseplateObserver(client)
     span_with_sampled_flag = Span('test-id', 'test-parent', 'test-span-id',
                                   True, 0, "test", self.mock_context)
     self.assertTrue(
         baseplate_observer.should_sample(span_with_sampled_flag))
コード例 #7
0
 def test_should_sample_utilizes_sampled_setting(self):
     baseplate_observer = TraceBaseplateObserver('test-service',
                                                 sample_rate=0)
     span_with_sampled_flag = Span('test-id', 'test-parent', 'test-span-id',
                                   True, 0, "test")
     self.assertTrue(
         baseplate_observer.should_sample(span_with_sampled_flag))
コード例 #8
0
ファイル: tracing_tests.py プロジェクト: ckwang8128/baseplate
 def test_should_sample_utilizes_sampled_setting(self):
     client = make_client("test-service", sample_rate=0)
     baseplate_observer = TraceBaseplateObserver(client)
     span_with_sampled_flag = Span('test-id',
                                   'test-parent',
                                   'test-span-id',
                                   True,
                                   0,
                                   "test",
                                   self.mock_context)
     self.assertTrue(
         baseplate_observer.should_sample(span_with_sampled_flag)
     )
コード例 #9
0
ファイル: tracing_tests.py プロジェクト: ckwang8128/baseplate
 def test_should_sample_utilizes_force_sampling(self):
     client = make_client("test-service", sample_rate=0)
     baseplate_observer = TraceBaseplateObserver(client)
     span_with_forced = Span('test-id',
                             'test-parent',
                             'test-span-id',
                             False,
                             1,
                             "test",
                             self.mock_context)
     span_without_forced = Span('test-id',
                                'test-parent',
                                'test-span-id',
                                False,
                                0,
                                "test",
                                self.mock_context)
     self.assertTrue(
         baseplate_observer.should_sample(span_with_forced)
     )
     self.assertFalse(
         baseplate_observer.should_sample(span_without_forced)
     )
コード例 #10
0
ファイル: tracing_tests.py プロジェクト: reddit/baseplate
 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))
コード例 #11
0
ファイル: tracing_tests.py プロジェクト: reddit/baseplate
 def test_should_sample_utilizes_force_sampling(self):
     baseplate_observer = TraceBaseplateObserver("test-service", sample_rate=0)
     span_with_forced = Span("test-id", "test-parent", "test-span-id", False, 1, "test")
     span_without_forced = Span("test-id", "test-parent", "test-span-id", False, 0, "test")
     self.assertTrue(baseplate_observer.should_sample(span_with_forced))
     self.assertFalse(baseplate_observer.should_sample(span_without_forced))
コード例 #12
0
ファイル: tracing_tests.py プロジェクト: reddit/baseplate
 def test_should_sample_utilizes_sampled_setting(self):
     baseplate_observer = TraceBaseplateObserver("test-service", sample_rate=0)
     span_with_sampled_flag = Span("test-id", "test-parent", "test-span-id", True, 0, "test")
     self.assertTrue(baseplate_observer.should_sample(span_with_sampled_flag))