Skip to content

Commit

Permalink
1) move rpath to Makefile.global;
Browse files Browse the repository at this point in the history
2) modify used_memory of InfoCmd to the sum of db_memtable and db_tablereader;
  • Loading branch information
flabby committed Sep 9, 2016
1 parent 7e3ff49 commit e687f41
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

RPATH = /usr/local/pika21/lib/
LFLAGS = -Wl,-rpath=$(RPATH)
include Makefile.global
#RPATH = /usr/local/pika21/lib/
#LFLAGS = -Wl,-rpath=$(RPATH)


UNAME := $(shell if [ -f "/etc/redhat-release" ]; then echo "CentOS"; else echo "Ubuntu"; fi)
Expand Down
2 changes: 2 additions & 0 deletions Makefile.global
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
RPATH = /usr/local/pika21/lib/
LFLAGS = -Wl,-rpath=$(RPATH)
13 changes: 7 additions & 6 deletions src/pika_admin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -627,14 +627,15 @@ void InfoCmd::InfoData(std::string &info) {
tmp_stream << "# Data" << "\r\n";
tmp_stream << "db_size:" << (db_size >> 20) << "M\r\n";
tmp_stream << "compression:" << g_pika_conf->compression() << "\r\n";
tmp_stream << "used_memory:" << db_size << "\r\n";

uint64_t usage;
g_pika_server->db()->GetUsage(nemo::USAGE_TYPE_ROCKSDB_MEMTABLE, &usage);
tmp_stream << "db_memtable_usage:" << usage << "Bytes\r\n";
// rocksdb related memory usage
uint64_t memtable_usage, table_reader_usage;
g_pika_server->db()->GetUsage(nemo::USAGE_TYPE_ROCKSDB_MEMTABLE, &memtable_usage);
g_pika_server->db()->GetUsage(nemo::USAGE_TYPE_ROCKSDB_TABLE_READER, &table_reader_usage);

g_pika_server->db()->GetUsage(nemo::USAGE_TYPE_ROCKSDB_TABLE_READER, &usage);
tmp_stream << "db_tablereader_usage:" << usage << "Bytes\r\n";
tmp_stream << "used_memory:" << (memtable_usage + table_reader_usage) << "\r\n";
tmp_stream << "db_memtable_usage:" << memtable_usage << "Bytes\r\n";
tmp_stream << "db_tablereader_usage:" << table_reader_usage << "Bytes\r\n";

info.append(tmp_stream.str());
return;
Expand Down
4 changes: 1 addition & 3 deletions tools/binlog_sync/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

RPATH = /usr/local/pika20/lib/
LFLAGS = -Wl,-rpath=$(RPATH)

include ../../Makefile.global

UNAME := $(shell if [ -f "/etc/redhat-release" ]; then echo "CentOS"; else echo "Ubuntu"; fi)

Expand Down
4 changes: 1 addition & 3 deletions tools/binlog_tools/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@

RPATH = /usr/local/pika20/lib/
LFLAGS = -Wl,-rpath=$(RPATH)

include ../../Makefile.global

UNAME := $(shell if [ -f "/etc/redhat-release" ]; then echo "CentOS"; else echo "Ubuntu"; fi)

Expand Down

0 comments on commit e687f41

Please sign in to comment.