Skip to content

Commit e3f2f46

Browse files
authored
Merge pull request #1363 from janhq/chore/format-ram-usage-for-cortex-ps
chore: some format for cortex ps
2 parents 4bc1aa7 + d5e2567 commit e3f2f46

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

engine/commands/ps_cmd.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <string>
55
#include <tabulate/table.hpp>
66
#include "nlohmann/json.hpp"
7+
#include "utils/format_utils.h"
78
#include "utils/logging_utils.h"
89
#include "utils/string_utils.h"
910

@@ -52,8 +53,8 @@ void PsCmd::PrintModelStatusList(
5253
table.add_row({
5354
model_status.model,
5455
model_status.engine,
55-
model_status.ram,
56-
model_status.vram,
56+
format_utils::BytesToHumanReadable(model_status.ram),
57+
format_utils::BytesToHumanReadable(model_status.vram),
5758
string_utils::FormatTimeElapsed(model_status.start_time),
5859
});
5960
}

engine/commands/ps_cmd.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#pragma once
22

3+
#include <cstdint>
34
#include <string>
45
#include <vector>
56

@@ -8,9 +9,9 @@ namespace commands {
89
struct ModelLoadedStatus {
910
std::string engine;
1011
std::string model;
11-
std::string ram;
12+
uint64_t ram;
1213
uint64_t start_time;
13-
std::string vram;
14+
uint64_t vram;
1415
};
1516

1617
class PsCmd {

0 commit comments

Comments
 (0)