@@ -13,7 +13,6 @@ use std::borrow::Cow;
13
13
use std:: str;
14
14
use std:: sync:: atomic:: Ordering ;
15
15
use std:: sync:: { Arc , Barrier } ;
16
- use std:: time:: Duration ;
17
16
18
17
pub struct Uploader {
19
18
fork_barrier : Arc < Barrier > ,
@@ -70,7 +69,7 @@ impl Uploader {
70
69
let endpoint = Endpoint :: try_from ( agent_endpoint) ?;
71
70
72
71
let tags = Some ( Arc :: unwrap_or_clone ( index. tags ) ) ;
73
- let exporter = datadog_profiling:: exporter:: ProfileExporter :: new (
72
+ let mut exporter = datadog_profiling:: exporter:: ProfileExporter :: new (
74
73
profiling_library_name,
75
74
profiling_library_version,
76
75
"php" ,
@@ -87,7 +86,7 @@ impl Uploader {
87
86
name : "profile.pprof" ,
88
87
bytes : serialized. buffer . as_slice ( ) ,
89
88
} ] ;
90
- let timeout = Duration :: from_secs ( 10 ) ;
89
+ exporter . set_timeout ( 10000 ) ; // 10 seconds in milliseconds
91
90
let request = exporter. build (
92
91
start,
93
92
end,
@@ -97,7 +96,6 @@ impl Uploader {
97
96
endpoint_counts,
98
97
Self :: create_internal_metadata ( ) ,
99
98
self . create_profiler_info ( ) ,
100
- timeout,
101
99
) ?;
102
100
debug ! ( "Sending profile to: {agent_endpoint}" ) ;
103
101
let result = exporter. send ( request, None ) ?;
0 commit comments