File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class SpanBatcher(Batcher["StreamedSpan"]):
1717 # TODO[span-first]: adjust flush/drop defaults
1818 MAX_BEFORE_FLUSH = 1000
1919 MAX_BEFORE_DROP = 1000
20- MAX_KB_BEFORE_FLUSH = 5 * 1024 # 5 MB
20+ MAX_BYTES_BEFORE_FLUSH = 5 * 1024 * 1024 # 5 MB
2121 FLUSH_WAIT_TIME = 5.0
2222
2323 TYPE = "span"
@@ -70,15 +70,15 @@ def add(self, span: "StreamedSpan") -> None:
7070 return
7171
7272 self ._running_size [span .trace_id ] += self ._estimate_size (span )
73- if self ._running_size [span .trace_id ] >= self .MAX_KB_BEFORE_FLUSH :
73+ if self ._running_size [span .trace_id ] >= self .MAX_BYTES_BEFORE_FLUSH :
7474 self ._flush_event .set ()
7575 return
7676
7777 @staticmethod
7878 def _estimate_size (item : "StreamedSpan" ) -> int :
7979 # This is just a quick approximation
8080 span_dict = SpanBatcher ._to_transport_format (item )
81- return len (str (span_dict )) // 1024
81+ return len (str (span_dict ))
8282
8383 @staticmethod
8484 def _to_transport_format (item : "StreamedSpan" ) -> "Any" :
You can’t perform that action at this time.
0 commit comments