Skip to content

Commit

Permalink
fix_redis_key (#2337)
Browse files Browse the repository at this point in the history
Co-authored-by: wuxianrong <[email protected]>
  • Loading branch information
Mixficsol and wuxianrong authored Jan 23, 2024
1 parent e787eff commit 1d71542
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
12 changes: 5 additions & 7 deletions codis/cmd/fe/assets/dashboard-fe.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ function isValidInput(text) {
function processGroupStats(codis_stats) {
var group_array = codis_stats.group.models;
var group_stats = codis_stats.group.stats;
var keys = 0, memory = 0;
var keys = 0, memory = 0, pika_memory = 0;
var dbkeyRegexp = /db\d+/
for (var i = 0; i < group_array.length; i++) {
var g = group_array[i];
Expand Down Expand Up @@ -504,7 +504,7 @@ function processGroupStats(codis_stats) {
if (s.stats["used_memory"]) {
var v = parseInt(s.stats["used_memory"], 10);
if (j == 0) {
memory += v;
pika_memory += v;
}
x.memory = humanSize(v);
}
Expand Down Expand Up @@ -552,7 +552,7 @@ function processGroupStats(codis_stats) {
x.server_text = x.server;
}
}
return {group_array: group_array, keys: keys, memory: memory};
return {group_array: group_array, keys: keys, pika_memory: pika_memory};
}

dashboard.config(['$interpolateProvider',
Expand Down Expand Up @@ -588,8 +588,7 @@ dashboard.controller('MainCodisCtrl', ['$scope', '$http', '$uibModal', '$timeout
$scope.codis_coord_addr = "NA";
$scope.codis_qps = "NA";
$scope.codis_sessions = "NA";
$scope.redis_mem = "NA";
$scope.redis_keys = "NA";
$scope.pika_mem = "NA";
$scope.slots_array = [];
$scope.proxy_array = [];
$scope.group_array = [];
Expand Down Expand Up @@ -662,8 +661,7 @@ dashboard.controller('MainCodisCtrl', ['$scope', '$http', '$uibModal', '$timeout

$scope.codis_qps = proxy_stats.qps;
$scope.codis_sessions = proxy_stats.sessions;
$scope.redis_mem = humanSize(group_stats.memory);
$scope.redis_keys = group_stats.keys.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
$scope.pika_mem = humanSize(group_stats.pika_memory);
$scope.slots_array = merge($scope.slots_array, codis_stats.slots);
$scope.proxy_array = merge($scope.proxy_array, proxy_stats.proxy_array);
$scope.group_array = merge($scope.group_array, group_stats.group_array);
Expand Down
8 changes: 2 additions & 6 deletions codis/cmd/fe/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,8 @@ <h4 style="padding-left:20px;"><b>Overview</b></h4>
<td>[[codis_sessions]]</td>
</tr>
<tr>
<td>Redis Memory</td>
<td>[[redis_mem]]</td>
</tr>
<tr>
<td>Redis Keys</td>
<td>[[redis_keys]]</td>
<td>Pika Memory</td>
<td>[[pika_mem]]</td>
</tr>
<tr>
<td>Slot Nums</td>
Expand Down
1 change: 1 addition & 0 deletions codis/config/proxy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,4 @@ metrics_report_statsd_prefix = ""

# Maximum delay statistical time interval.(This value must be greater than 0.)
max_delay_refresh_time_interval = "15s"

2 changes: 0 additions & 2 deletions src/pika_command.cc
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,6 @@ void Cmd::Execute() {
}

void Cmd::ProcessCommand(const HintKeys& hint_keys) {
LOG(INFO) << "lmz";
if (stage_ == kNone) {
InternalProcessCommand(hint_keys);
} else {
Expand All @@ -868,7 +867,6 @@ void Cmd::ProcessCommand(const HintKeys& hint_keys) {
}

void Cmd::InternalProcessCommand(const HintKeys& hint_keys) {
LOG(INFO) << db_->GetDBName();
pstd::lock::MultiRecordLock record_lock(db_->LockMgr());
if (is_write()) {
record_lock.Lock(current_key());
Expand Down

0 comments on commit 1d71542

Please sign in to comment.