Skip to content

Commit

Permalink
Merge pull request #1363 from janhq/chore/format-ram-usage-for-cortex-ps
Browse files Browse the repository at this point in the history
chore: some format for cortex ps
  • Loading branch information
namchuai authored Sep 30, 2024
2 parents 4bc1aa7 + d5e2567 commit e3f2f46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions engine/commands/ps_cmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <string>
#include <tabulate/table.hpp>
#include "nlohmann/json.hpp"
#include "utils/format_utils.h"
#include "utils/logging_utils.h"
#include "utils/string_utils.h"

Expand Down Expand Up @@ -52,8 +53,8 @@ void PsCmd::PrintModelStatusList(
table.add_row({
model_status.model,
model_status.engine,
model_status.ram,
model_status.vram,
format_utils::BytesToHumanReadable(model_status.ram),
format_utils::BytesToHumanReadable(model_status.vram),
string_utils::FormatTimeElapsed(model_status.start_time),
});
}
Expand Down
5 changes: 3 additions & 2 deletions engine/commands/ps_cmd.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <cstdint>
#include <string>
#include <vector>

Expand All @@ -8,9 +9,9 @@ namespace commands {
struct ModelLoadedStatus {
std::string engine;
std::string model;
std::string ram;
uint64_t ram;
uint64_t start_time;
std::string vram;
uint64_t vram;
};

class PsCmd {
Expand Down

0 comments on commit e3f2f46

Please sign in to comment.