Skip to content

Commit

Permalink
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/common/src/heap_profiling/mod.rs
Original file line number Diff line number Diff line change
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

pub const MANUALLY_DUMP_MID_NAME: &str = "manually-dump.compute.heap";
pub const AUTO_DUMP_MID_NAME: &str = "auto-dump.compute.heap";
pub const MANUALLY_DUMP_SUFFIX: &str = "manual.heap";
pub const AUTO_DUMP_SUFFIX: &str = "auto.heap";
pub const COLLAPSED_SUFFIX: &str = "collapsed";

pub mod jeprof;
6 changes: 2 additions & 4 deletions src/compute/src/memory_management/policy.rs
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ use std::sync::Arc;
use chrono;
use risingwave_batch::task::BatchManager;
use risingwave_common::config::HeapProfilingConfig;
use risingwave_common::heap_profiling::AUTO_DUMP_MID_NAME;
use risingwave_common::heap_profiling::AUTO_DUMP_SUFFIX;
use risingwave_common::util::epoch::Epoch;
use risingwave_stream::task::LocalStreamManager;
use tikv_jemalloc_ctl::{
@@ -43,7 +43,6 @@ pub struct JemallocMemoryControl {
jemalloc_active_mib: jemalloc_stats::active_mib,
jemalloc_dump_mib: jemalloc_prof::dump_mib,

dump_seq: u64,
heap_profiling_config: HeapProfilingConfig,
}

@@ -73,7 +72,6 @@ impl JemallocMemoryControl {
jemalloc_allocated_mib,
jemalloc_active_mib,
jemalloc_dump_mib,
dump_seq: 0,
heap_profiling_config,
}
}
@@ -114,7 +112,7 @@ impl JemallocMemoryControl {
}

let time_prefix = chrono::Local::now().format("%Y-%m-%d-%H-%M-%S").to_string();
let file_name = format!("{}.{}.{}\0", time_prefix, AUTO_DUMP_MID_NAME, self.dump_seq,);
let file_name = format!("{}.{}\0", time_prefix, AUTO_DUMP_SUFFIX);

let file_path = Path::new(&self.heap_profiling_config.dir)
.join(Path::new(&file_name))
8 changes: 4 additions & 4 deletions src/compute/src/rpc/service/monitor_service.rs
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ use std::time::Duration;
use itertools::Itertools;
use risingwave_common::config::ServerConfig;
use risingwave_common::heap_profiling::{
self, AUTO_DUMP_MID_NAME, COLLAPSED_SUFFIX, MANUALLY_DUMP_MID_NAME,
self, AUTO_DUMP_SUFFIX, COLLAPSED_SUFFIX, MANUALLY_DUMP_SUFFIX,
};
use risingwave_pb::monitor_service::monitor_service_server::MonitorService;
use risingwave_pb::monitor_service::{
@@ -140,7 +140,7 @@ impl MonitorService for MonitorServiceImpl {
}

let time_prefix = chrono::Local::now().format("%Y-%m-%d-%H-%M-%S").to_string();
let file_name = format!("{}.{}\0", time_prefix, MANUALLY_DUMP_MID_NAME);
let file_name = format!("{}.{}\0", time_prefix, MANUALLY_DUMP_SUFFIX);
let arg_dir = request.into_inner().get_dir().clone();
let dir = PathBuf::from(if arg_dir.is_empty() {
&self.server_config.heap_profiling.dir
@@ -181,7 +181,7 @@ impl MonitorService for MonitorServiceImpl {
})
.filter(|name| {
if let Ok(name) = name {
name.contains(AUTO_DUMP_MID_NAME) && !name.ends_with(COLLAPSED_SUFFIX)
name.contains(AUTO_DUMP_SUFFIX) && !name.ends_with(COLLAPSED_SUFFIX)
} else {
true
}
@@ -194,7 +194,7 @@ impl MonitorService for MonitorServiceImpl {
})
.filter(|name| {
if let Ok(name) = name {
name.contains(MANUALLY_DUMP_MID_NAME) && !name.ends_with(COLLAPSED_SUFFIX)
name.contains(MANUALLY_DUMP_SUFFIX) && !name.ends_with(COLLAPSED_SUFFIX)
} else {
true
}

0 comments on commit 0363005

Please sign in to comment.