File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -346,6 +346,12 @@ impl TimeCollector {
346
346
profiles : & mut HashMap < ProfileIndex , InternalProfile > ,
347
347
started_at : & WallTime ,
348
348
) {
349
+ if message. key . sample_types . len ( ) == 0 {
350
+ // profiling disabled, this should not happen!
351
+ warn ! ( "You spot a bug in the profiler, please be so kind and report this do Datadog." ) ;
352
+ return ;
353
+ }
354
+
349
355
let profile: & mut InternalProfile = if let Some ( value) = profiles. get_mut ( & message. key ) {
350
356
value
351
357
} else {
@@ -572,12 +578,6 @@ impl Profiler {
572
578
}
573
579
574
580
pub fn send_sample ( & self , message : SampleMessage ) -> Result < ( ) , TrySendError < ProfilerMessage > > {
575
- if message. key . sample_types . len ( ) == 0 {
576
- // profiling disabled, this should not happen!
577
- warn ! ( "You spot a bug in the profiler, please be so kind and report this do Datadog." ) ;
578
- // this return is technically not correct :-(
579
- return Err ( TrySendError :: Disconnected ( ProfilerMessage :: Sample ( message) ) ) ;
580
- }
581
581
self . message_sender
582
582
. try_send ( ProfilerMessage :: Sample ( message) )
583
583
}
You can’t perform that action at this time.
0 commit comments