Skip to content

Commit

Permalink
smallfix
Browse files Browse the repository at this point in the history
  • Loading branch information
qinzuoyan committed Feb 21, 2019
1 parent 58997ff commit effa441
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/shell/command_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,8 @@ inline bool parse_app_pegasus_perf_counter_name(const std::string &name,
struct row_data
{
std::string row_name;
int partition_count = 0;
int32_t app_id = 0;
int32_t partition_count = 0;
double get_qps = 0;
double multi_get_qps = 0;
double put_qps = 0;
Expand Down Expand Up @@ -604,6 +605,7 @@ get_app_stat(shell_context *sc, const std::string &app_name, std::vector<row_dat
std::map<int32_t, int> app_row_idx; // app_id --> row_idx
for (::dsn::app_info &app : apps) {
rows[idx].row_name = app.app_name;
rows[idx].app_id = app.app_id;
rows[idx].partition_count = app.partition_count;
app_row_idx[app.app_id] = idx;
idx++;
Expand Down
8 changes: 6 additions & 2 deletions src/shell/commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -4000,8 +4000,10 @@ inline bool app_stat(command_executor *e, shell_context *sc, arguments args)

::dsn::utils::table_printer tp;
tp.add_title(app_name.empty() ? "app" : "pidx");
if (app_name.empty())
if (app_name.empty()) {
tp.add_column("app_id", tp_alignment::kRight);
tp.add_column("pcount", tp_alignment::kRight);
}
tp.add_column("GET", tp_alignment::kRight);
tp.add_column("MGET", tp_alignment::kRight);
tp.add_column("PUT", tp_alignment::kRight);
Expand All @@ -4027,8 +4029,10 @@ inline bool app_stat(command_executor *e, shell_context *sc, arguments args)

for (row_data &row : rows) {
tp.add_row(row.row_name);
if (app_name.empty())
if (app_name.empty()) {
tp.append_data(row.app_id);
tp.append_data(row.partition_count);
}
tp.append_data(row.get_qps);
tp.append_data(row.multi_get_qps);
tp.append_data(row.put_qps);
Expand Down

0 comments on commit effa441

Please sign in to comment.