Skip to content

Commit

Permalink
config for bench
Browse files Browse the repository at this point in the history
Signed-off-by: zhongzc <zhongzc_arch@outlook.com>
  • Loading branch information
zhongzc committed Nov 6, 2020
1 parent c5d0a72 commit a389d5e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2213,10 +2213,10 @@ impl TraceConfig {
impl Default for TraceConfig {
fn default() -> Self {
Self {
jaeger_thrift_compact_agent: "".to_owned(),
jaeger_thrift_compact_agent: "127.0.0.1:6831".to_owned(),
num_report_threads: 1,
duration_threshold: ReadableDuration::millis(100),
spans_max_length: 1000,
duration_threshold: ReadableDuration::millis(5),
spans_max_length: 100,
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions src/server/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ impl JaegerReporter {
agent: SocketAddr,
mut spans: Vec<Span>,
spans_max_length: usize,
) -> Result<()> {
let local_addr: SocketAddr = if agent.is_ipv4() {
"0.0.0.0:0"
} else {
"[::]:0"
}
.parse()?;
let mut udp_socket = UdpSocket::bind(local_addr).await?;
) -> Result<Vec<u8>> {
// let local_addr: SocketAddr = if agent.is_ipv4() {
// "0.0.0.0:0"
// } else {
// "[::]:0"
// }
// .parse()?;
// let mut udp_socket = UdpSocket::bind(local_addr).await?;

// Check if len of spans reaches `spans_max_length`
if spans.len() > spans_max_length {
Expand All @@ -89,8 +89,8 @@ impl JaegerReporter {
spans,
)?;

udp_socket.send_to(&bytes, agent).await?;
Ok(())
// udp_socket.send_to(&bytes, agent).await?;
Ok(bytes)
}
}

Expand Down

0 comments on commit a389d5e

Please sign in to comment.