Skip to content

Commit

Permalink
修复dubbo 3.2.14版本使用r-nacos有报错问题 #124
Browse files Browse the repository at this point in the history
  • Loading branch information
heqingpan committed Aug 5, 2024
1 parent 348eefd commit 745ca49
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/metrics/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl MetricsManager {
fn load_sys_metrics(&mut self) {
self.system.refresh_all();
if let Some(process) = self.system.process(Pid::from_u32(self.current_process_id)) {
let cpu_usage = process.cpu_usage() as f32;
let cpu_usage = process.cpu_usage();
let rss = process.memory() as f32 / (1024.0 * 1024.0);
let vms = process.virtual_memory() as f32 / (1024.0 * 1024.0);
let rss_usage = rss / self.total_memory * 100.0;
Expand Down
7 changes: 2 additions & 5 deletions src/metrics/timeline/model.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
use crate::metrics::metrics_key::MetricsKey;
use crate::metrics::model::{
CounterValue, GaugeValue, HistogramValue, HistogramValueFmtWrap, SummaryValue,
SummaryValueFmtWrap,
};
use crate::metrics::model::{CounterValue, GaugeValue, HistogramValue, SummaryValue};
use crate::metrics::summary::DEFAULT_SUMMARY_BOUNDS;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
Expand Down Expand Up @@ -46,7 +43,7 @@ impl TimelineGroupType {
match self {
TimelineGroupType::Least => 0,
TimelineGroupType::Minute => 60_000,
TimelineGroupType::Hour => 3600_000,
TimelineGroupType::Hour => 3_600_000,
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/naming/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,11 @@ impl NamingActor {
page_index: usize,
key: &ServiceKey,
) -> (usize, Vec<Arc<String>>) {
let offset = page_size * max(page_index - 1, 0);
let offset = if page_index == 0 {
0
} else {
page_size * (page_index - 1)
};
let param = ServiceQueryParam {
offset,
limit: page_size,
Expand Down
2 changes: 1 addition & 1 deletion src/naming/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl NamingUtils {
));
}
metadata.insert(
kv.get(0).unwrap().to_string(),
kv.first().unwrap().to_string(),
kv.get(1).unwrap().to_string(),
);
}
Expand Down

0 comments on commit 745ca49

Please sign in to comment.