|
|
@@ -3,8 +3,8 @@ use std::fmt::{Formatter};
|
|
|
use chrono::Utc;
|
|
|
use rust_decimal::prelude::ToPrimitive;
|
|
|
|
|
|
-pub static mut MAX_UNLOCK_CORE_DELAY: i64 = 0;
|
|
|
-pub static mut MAX_SPAN_LINE: i64 = 0;
|
|
|
+pub static mut MAX_UNLOCK_CORE_DELAY: u128 = 0;
|
|
|
+pub static mut MAX_SPAN_LINE: u128 = 0;
|
|
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
|
pub struct TraceStack {
|
|
|
@@ -126,27 +126,27 @@ impl fmt::Display for TraceStack {
|
|
|
msg.push_str(format!("数据生成+到达rust耗时{}毫秒 ", (self.after_network - self.before_network).to_f64().unwrap() / 1000.0).as_str());
|
|
|
}
|
|
|
|
|
|
- if self.before_span_line != 0 && self.after_span_line != 0 {
|
|
|
- let span_line = self.after_span_line - self.before_span_line;
|
|
|
- unsafe {
|
|
|
- if span_line > MAX_SPAN_LINE {
|
|
|
- MAX_SPAN_LINE = span_line;
|
|
|
- }
|
|
|
-
|
|
|
- msg.push_str(format!("闭包调用耗时{}us, 最大{}us ", span_line, MAX_SPAN_LINE).as_str());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if self.before_core != 0 && self.before_unlock_core != 0 {
|
|
|
- let unlock_core_delay = self.before_core - self.before_unlock_core;
|
|
|
- unsafe {
|
|
|
- if unlock_core_delay > MAX_UNLOCK_CORE_DELAY {
|
|
|
- MAX_UNLOCK_CORE_DELAY = unlock_core_delay;
|
|
|
- }
|
|
|
-
|
|
|
- msg.push_str(format!("解锁core{}us, 最大{}us ", unlock_core_delay, MAX_UNLOCK_CORE_DELAY).as_str());
|
|
|
- }
|
|
|
- }
|
|
|
+ // if self.before_span_line != 0 && self.after_span_line != 0 {
|
|
|
+ // let span_line = self.after_span_line - self.before_span_line;
|
|
|
+ // unsafe {
|
|
|
+ // if span_line > MAX_SPAN_LINE {
|
|
|
+ // MAX_SPAN_LINE = span_line;
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // msg.push_str(format!("闭包调用耗时{}us, 最大{}us ", span_line, MAX_SPAN_LINE).as_str());
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // if self.before_core != 0 && self.before_unlock_core != 0 {
|
|
|
+ // let unlock_core_delay = self.before_core - self.before_unlock_core;
|
|
|
+ // unsafe {
|
|
|
+ // if unlock_core_delay > MAX_UNLOCK_CORE_DELAY {
|
|
|
+ // MAX_UNLOCK_CORE_DELAY = unlock_core_delay;
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // msg.push_str(format!("解锁core{}us, 最大{}us ", unlock_core_delay, MAX_UNLOCK_CORE_DELAY).as_str());
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
if self.after_format != 0 && self.before_format != 0 {
|
|
|
msg.push_str(format!("数据格式化耗时{}us ", self.after_format - self.before_format).as_str());
|