We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/node/metric/MetricsReader.java
Lines 54 to 56 in 195150b
55行没必要为了获取时间戳而将字符串转成MetricNode对象, 直接通过字符串截取就行,
MetricNode
int timestampIndex = s.indexOf("|"); String timestamp = Long.parseLong(s.substring(0, timestampIndex));
Sentinel/sentinel-transport/sentinel-transport-common/src/main/java/com/alibaba/csp/sentinel/command/handler/SendMetricCommandHandler.java
Lines 97 to 100 in 195150b
ThinString
FatString
int timestampIndex = s.indexOf("|"); String timestamp = s.substring(0, timestampIndex); int i = s.indexOf("|", timestampIndex + 20); String metric = s.substring(i); System.out.println(timestamp + metric);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Sentinel/sentinel-core/src/main/java/com/alibaba/csp/sentinel/node/metric/MetricsReader.java
Lines 54 to 56 in 195150b
55行没必要为了获取时间戳而将字符串转成
MetricNode
对象, 直接通过字符串截取就行,Sentinel/sentinel-transport/sentinel-transport-common/src/main/java/com/alibaba/csp/sentinel/command/handler/SendMetricCommandHandler.java
Lines 97 to 100 in 195150b
SendMetricCommandHandler中为了得到
ThinString
, 又将MetricNode
转成字符串,MetricNode
成了冗余转换, 会增加内存占用不如直接采用
FatString
字符串分割The text was updated successfully, but these errors were encountered: