Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions agent/app/dto/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ type DashboardCurrent struct {
GPUData []GPUInfo `json:"gpuData"`
XPUData []XPUInfo `json:"xpuData"`

TopCPUItems []Process `json:"topCPUItems"`
TopMemItems []Process `json:"topMemItems"`

ShotTime time.Time `json:"shotTime"`
}

Expand Down
7 changes: 5 additions & 2 deletions agent/app/service/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (u *DashboardService) LoadCurrentInfoForNode() *dto.NodeCurrent {
memoryInfo, _ := mem.VirtualMemory()
currentInfo.MemoryTotal = memoryInfo.Total
currentInfo.MemoryAvailable = memoryInfo.Available
currentInfo.MemoryUsed = memoryInfo.Used + memoryInfo.Shared
currentInfo.MemoryUsed = memoryInfo.Used
currentInfo.MemoryUsedPercent = memoryInfo.UsedPercent

swapInfo, _ := mem.SwapMemory()
Expand Down Expand Up @@ -194,7 +194,7 @@ func (u *DashboardService) LoadCurrentInfo(ioOption string, netOption string) *d

memoryInfo, _ := mem.VirtualMemory()
currentInfo.MemoryTotal = memoryInfo.Total
currentInfo.MemoryUsed = memoryInfo.Used + memoryInfo.Shared
currentInfo.MemoryUsed = memoryInfo.Used
currentInfo.MemoryFree = memoryInfo.Free
currentInfo.MemoryCache = memoryInfo.Cached + memoryInfo.Buffers
currentInfo.MemoryShard = memoryInfo.Shared
Expand All @@ -211,6 +211,9 @@ func (u *DashboardService) LoadCurrentInfo(ioOption string, netOption string) *d
currentInfo.GPUData = loadGPUInfo()
currentInfo.XPUData = loadXpuInfo()

currentInfo.TopCPUItems = loadTopCPU()
currentInfo.TopMemItems = loadTopMem()

if ioOption == "all" {
diskInfo, _ := disk.IOCounters()
for _, state := range diskInfo {
Expand Down
8 changes: 4 additions & 4 deletions agent/app/service/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func (m *MonitorService) Run() {
if len(totalPercent) == 1 {
itemModel.Cpu = totalPercent[0]
}
topCPU := m.loadTopCPU()
topCPU := loadTopCPU()
if len(topCPU) != 0 {
topItemCPU, err := json.Marshal(topCPU)
if err == nil {
Expand All @@ -199,7 +199,7 @@ func (m *MonitorService) Run() {

memoryInfo, _ := mem.VirtualMemory()
itemModel.Memory = memoryInfo.UsedPercent
topMem := m.loadTopMem()
topMem := loadTopMem()
if len(topMem) != 0 {
topMemItem, err := json.Marshal(topMem)
if err == nil {
Expand Down Expand Up @@ -350,7 +350,7 @@ func (m *MonitorService) saveNetDataToDB(ctx context.Context, interval float64)
}
}

func (m *MonitorService) loadTopCPU() []dto.Process {
func loadTopCPU() []dto.Process {
processes, err := process.Processes()
if err != nil {
return nil
Expand Down Expand Up @@ -400,7 +400,7 @@ func (m *MonitorService) loadTopCPU() []dto.Process {
return top5
}

func (m *MonitorService) loadTopMem() []dto.Process {
func loadTopMem() []dto.Process {
processes, err := process.Processes()
if err != nil {
return nil
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/api/interface/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,22 @@ export namespace Dashboard {
gpuData: Array<GPUInfo>;
xpuData: Array<XPUInfo>;

topCPUItems: Array<Process>;
topMemItems: Array<Process>;

netBytesSent: number;
netBytesRecv: number;

shotTime: Date;
}
export interface Process {
name: string;
pid: number;
percent: number;
memory: number;
cmd: string;
user: string;
}
export interface DiskInfo {
path: string;
type: string;
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ const message = {
ioDelay: 'I/O latency',
uptime: 'Uptime',
runningTime: 'Up since',
mem: 'System',
mem: 'System Memory',
swapMem: 'Swap Partition',

runSmoothly: 'Low load',
Expand All @@ -435,6 +435,9 @@ const message = {

core: 'Physical core',
logicCore: 'Logical core',
corePercent: 'Core Usage',
cpuTop: 'Top 5 Processes by CPU Usage',
memTop: 'Top 5 Processes by Memory Usage',
loadAverage: 'Load average in the last 1 minute | Load average in the last {n} minutes',
load: 'Load',
mount: 'Mount point',
Expand Down Expand Up @@ -3008,6 +3011,9 @@ const message = {
stopProcess: 'End',
viewDetails: 'View details',
stopProcessWarn: 'Are you sure you want to end this process (PID:{0})?',
kill: 'Kill Process',
killNow: 'Kill Now',
killHelper: 'Killing process {0} may cause some programs to malfunction. Continue?',
processName: 'Process name',
},
tool: {
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/lang/modules/es-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,14 +433,17 @@ const message = {
ioDelay: 'Latencia de E/S',
uptime: 'Tiempo en funcionamiento',
runningTime: 'Desde',
mem: 'Sistema',
mem: 'Memoria del Sistema',
swapMem: 'Partición swap',
runSmoothly: 'Carga baja',
runNormal: 'Carga moderada',
runSlowly: 'Carga alta',
runJam: 'Carga pesada',
core: 'Núcleo físico',
logicCore: 'Núcleo lógico',
corePercent: 'Uso del Núcleo',
cpuTop: 'Top 5 de Procesos por Uso de CPU',
memTop: 'Top 5 de Procesos por Uso de Memoria',
loadAverage: 'Promedio de carga en el último minuto | Promedio de carga en los últimos {n} minutos',
load: 'Carga',
mount: 'Punto de montaje',
Expand Down Expand Up @@ -2981,6 +2984,9 @@ const message = {
stopProcess: 'Finalizar',
viewDetails: 'Ver detalles',
stopProcessWarn: '¿Seguro que deseas finalizar este proceso (PID:{0})?',
kill: 'Terminar Proceso',
killNow: 'Terminar Ahora',
killHelper: 'Terminar el proceso {0} puede hacer que algunos programas funcionen incorrectamente. ¿Continuar?',
processName: 'Nombre del proceso',
},
tool: {
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ const message = {
ioDelay: 'I/Oレイテンシ',
uptime: 'それ以来',
runningTime: '稼働時間',
mem: 'システム',
mem: 'システムメモリ',
swapMem: 'パーティションを交換します',

runSmoothly: '低負荷',
Expand All @@ -424,6 +424,9 @@ const message = {

core: '物理コア',
logicCore: '論理コア',
corePercent: 'コア使用率',
cpuTop: 'CPU使用率トップ5のプロセス情報',
memTop: 'メモリ使用率トップ5のプロセス情報',
loadAverage: '最後の1分で平均を積み込みます|最後の{n}分で平均を読み込みます',
load: '負荷',
mount: 'マウントポイント',
Expand Down Expand Up @@ -2906,6 +2909,9 @@ const message = {
stopProcess: '終わり',
viewDetails: '詳細',
stopProcessWarn: 'このプロセスを終了したいですか(PID:{0})?',
kill: 'プロセス終了',
killNow: '今すぐ終了',
killHelper: 'プロセス {0} を終了すると一部のプログラムが正常に動作しなくなる可能性があります。続行しますか?',
processName: 'プロセス名',
},
tool: {
Expand Down
9 changes: 8 additions & 1 deletion frontend/src/lang/modules/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ const message = {
ioDelay: 'I/O 지연 시간',
uptime: '작동 시간',
runningTime: '가동 시간',
mem: '시스템',
mem: '시스템 메모리',
swapMem: '스왑 파티션',

runSmoothly: '낮은 부하',
Expand All @@ -427,6 +427,9 @@ const message = {

core: '물리적 코어',
logicCore: '논리 코어',
corePercent: '코어 사용률',
cpuTop: 'CPU 사용률 상위 5개 프로세스 정보',
memTop: '메모리 사용률 상위 5개 프로세스 정보',
loadAverage: '지난 1분의 평균 부하 | 지난 {n} 분의 평균 부하',
load: '부하',
mount: '마운트 지점',
Expand Down Expand Up @@ -2855,6 +2858,10 @@ const message = {
stopProcess: '종료',
viewDetails: '세부 사항',
stopProcessWarn: '이 프로세스(PID:{0})를 종료하시겠습니까?',
kill: '프로세스 종료',
killNow: '즉시 종료',
killHelper:
'프로세스 {0}을(를) 종료하면 일부 프로그램이 정상적으로 작동하지 않을 수 있습니다. 계속하시겠습니까?',
processName: '프로세스 이름',
},
tool: {
Expand Down
9 changes: 8 additions & 1 deletion frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ const message = {
ioDelay: 'I/O latency',
uptime: 'Up since',
runningTime: 'Uptime',
mem: 'System',
mem: 'Memori Sistem',
swapMem: 'Swap partition',

runSmoothly: 'Beban rendah',
Expand All @@ -432,6 +432,9 @@ const message = {
runJam: 'Beban berat',

core: 'Teras Fizikal',
corePercent: 'Penggunaan Teras',
cpuTop: 'Maklumat Proses 5 Teratas Mengikut Penggunaan CPU',
memTop: 'Maklumat Proses 5 Teratas Mengikut Penggunaan Memori',
logicCore: 'Teras Logik',
loadAverage: 'Purata beban dalam 1 minit terakhir | Purata beban dalam {n} minit terakhir',
load: 'Beban',
Expand Down Expand Up @@ -2972,6 +2975,10 @@ const message = {
stopProcess: 'End',
viewDetails: 'Details',
stopProcessWarn: 'Are you sure you want to end this process (PID:{0})?',
kill: 'Hentikan Proses',
killNow: 'Hentikan Sekarang',
killHelper:
'Menghentikan proses {0} mungkin menyebabkan beberapa program tidak berfungsi dengan normal. Teruskan?',
processName: 'Process name',
},
tool: {
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ const message = {
ioDelay: 'Latência de I/O',
uptime: 'Tempo de atividade',
runningTime: 'Tempo de execução',
mem: 'Memória',
mem: 'Memória do Sistema',
swapMem: 'Partição Swap',

runSmoothly: 'Baixo carregamento',
Expand All @@ -431,6 +431,9 @@ const message = {

core: 'Núcleo físico',
logicCore: 'Núcleo lógico',
corePercent: 'Uso do Núcleo',
cpuTop: 'Top 5 Processos por Uso de CPU',
memTop: 'Top 5 Processos por Uso de Memória',
loadAverage: 'Média de carga nos últimos 1 minuto | Média de carga nos últimos {n} minutos',
load: 'Carga',
mount: 'Ponto de montagem',
Expand Down Expand Up @@ -2977,6 +2980,9 @@ const message = {
stopProcess: 'Encerrar',
viewDetails: 'Detalhes',
stopProcessWarn: 'Tem certeza de que deseja encerrar este processo (PID:{0})?',
kill: 'Encerrar Processo',
killNow: 'Encerrar Agora',
killHelper: 'Encerrar o processo {0} pode fazer com que alguns programas funcionem incorretamente. Continuar?',
processName: 'Nome do Processo',
},
tool: {
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ const message = {
ioDelay: 'Задержка ввода/вывода',
uptime: 'Работает с',
runningTime: 'Время работы',
mem: 'Память',
mem: 'Системная Память',
swapMem: 'Раздел подкачки',

runSmoothly: 'Низкая нагрузка',
Expand All @@ -428,6 +428,9 @@ const message = {

core: 'Физических ядер',
logicCore: 'Логических ядер',
corePercent: 'Использование Ядра',
cpuTop: 'Топ 5 Процессов по Использованию ЦПУ',
memTop: 'Топ 5 Процессов по Использованию Памяти',
loadAverage: 'Средняя нагрузка за последнюю минуту | Средняя нагрузка за последние {n} минут',
load: 'Нагрузка',
mount: 'Точка монтирования',
Expand Down Expand Up @@ -2970,6 +2973,9 @@ const message = {
stopProcess: 'Завершить',
viewDetails: 'Подробности',
stopProcessWarn: 'Вы уверены, что хотите завершить этот процесс (PID:{0})?',
kill: 'Завершить Процесс',
killNow: 'Завершить Сейчас',
killHelper: 'Завершение процесса {0} может привести к некорректной работе некоторых программ. Продолжить?',
processName: 'Имя процесса',
},
tool: {
Expand Down
9 changes: 8 additions & 1 deletion frontend/src/lang/modules/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ const message = {
ioDelay: 'G/Ç gecikmesi',
uptime: 'Çalışma süresi',
runningTime: 'Şu tarihten beri açık',
mem: 'Sistem',
mem: 'Sistem Belleği',
swapMem: 'Swap Bölümü',

runSmoothly: 'Düşük yük',
Expand All @@ -439,6 +439,9 @@ const message = {

core: 'Fiziksel çekirdek',
logicCore: 'Mantıksal çekirdek',
corePercent: 'Çekirdek Kullanımı',
cpuTop: 'CPU Kullanımına Göre İlk 5 İşlem',
memTop: 'Bellek Kullanımına Göre İlk 5 İşlem',
loadAverage: 'Son 1 dakikadaki yük ortalaması | Son {n} dakikadaki yük ortalaması',
load: 'Yük',
mount: 'Bağlama noktası',
Expand Down Expand Up @@ -3050,6 +3053,10 @@ const message = {
stopProcess: 'Sonlandır',
viewDetails: 'Detayları görüntüle',
stopProcessWarn: 'Bu işlemi (PID:{0}) sonlandırmak istediğinizden emin misiniz?',
kill: 'İşlemi Sonlandır',
killNow: 'Hemen Sonlandır',
killHelper:
'{0} işlemini sonlandırmak bazı programların düzgün çalışmamasına neden olabilir. Devam etmek istiyor musunuz?',
processName: 'İşlem adı',
},
tool: {
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/lang/modules/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ const message = {
ioDelay: '讀寫延遲',
uptime: '啟動時間',
runningTime: '執行時間',
mem: '系統',
mem: '系統記憶體',
swapMem: 'Swap 分區',

runSmoothly: '執行流暢',
Expand All @@ -422,6 +422,9 @@ const message = {

core: '物理核心',
logicCore: '邏輯核心',
corePercent: '核心使用率',
cpuTop: 'CPU 佔用率 Top5 的行程資訊',
memTop: '記憶體佔用率 Top5 的行程資訊',
loadAverage: '最近 {0} 分鐘平均負載',
load: '負載',
mount: '掛載點',
Expand Down Expand Up @@ -2795,6 +2798,9 @@ const message = {
stopProcess: '結束',
viewDetails: '查看詳情',
stopProcessWarn: '是否確定結束此行程 (PID:{0})?',
kill: '結束行程',
killNow: '立即結束',
killHelper: '結束行程 {0} 可能導致部分程式無法正常運作,是否繼續?',
processName: '行程名稱',
},
tool: {
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ const message = {
ioDelay: '读写延迟',
uptime: '启动时间',
runningTime: '运行时间',
mem: '系统',
mem: '系统内存',
swapMem: 'Swap 分区',

runSmoothly: '运行流畅',
Expand All @@ -422,6 +422,9 @@ const message = {

core: '物理核心',
logicCore: '逻辑核心',
corePercent: '核心使用率',
cpuTop: 'CPU 占用率 Top5 的进程信息',
memTop: '内存占用率 Top5 的进程信息',
loadAverage: '最近 {0} 分钟平均负载',
load: '负载',
mount: '挂载点',
Expand Down Expand Up @@ -2789,6 +2792,9 @@ const message = {
stopProcess: '结束',
viewDetails: '查看详情',
stopProcessWarn: '是否确定结束此进程 (PID:{0})?',
kill: '结束进程',
killNow: '立即结束',
killHelper: '结束进程 {0} 可能导致部分程序无法正常运行,是否继续?',
processName: '进程名称',
},
tool: {
Expand Down
Loading
Loading