Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitor 0.1 #104

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
709e231
Compression feature, raw code finish
Mar 15, 2016
65c7c84
Compression feature, compile PASS
Mar 15, 2016
ce9888f
Compression feature, compile PASS
Mar 15, 2016
47bfeda
Support data vector write Interface, Compile PASS
Mar 16, 2016
58b3549
Merge branch 'trace0.5' of github.com:caijieming-baidu/mdt into trace0.5
Mar 16, 2016
6ecee5f
Change go interface to export vector writer interface, compile PASS
Mar 16, 2016
3face73
support compress Interface, PASS
Mar 18, 2016
291b809
support compress Interface, write benchmark PASS
Mar 18, 2016
8e4a052
bugfix for galaxy trace
Mar 22, 2016
11025e4
add retry after fs addrecord fail
Mar 23, 2016
b5380e8
scheduler show info bugfix
Mar 23, 2016
4059903
show galaxy pb
Mar 24, 2016
678a17f
add watch path in galaxy env
Mar 28, 2016
30790db
debug collector's write bandwidth for rtg trace
Mar 29, 2016
f6f1e73
debug collector's write bandwidth for rtg trace
Mar 29, 2016
90df381
Merge branch 'collector_debug_0.2' of github.com:caijieming-baidu/mdt…
Mar 29, 2016
9cac85c
debug collector's write bandwidth for rtg trace, add cost time
Mar 30, 2016
c5b7008
add agent info collect, and limit fd use in agent
Apr 6, 2016
a067282
add agent info collect, and limit fd use in agent
Apr 6, 2016
26ed466
Merge branch 'collector_enhance_0.3' of github.com:caijieming-baidu/m…
Apr 6, 2016
3dc5402
stable agent,collector,scheduler, code use in rtg-trace
Apr 11, 2016
f497fe3
monitor compile PASS
Apr 22, 2016
cd5df6a
nuomi monitor TEST PASS
May 5, 2016
21717bc
nuomi monitor TEST PASS
May 5, 2016
5383671
sharigon PASS
May 5, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 56 additions & 42 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
include depends.mk

# OPT ?= -O2 -DNDEBUG # (A) Production use (optimized mode)
OPT ?= -g2 -Wall -Werror # (B) Debug mode, w/ full line-level debugging symbols
#OPT ?= -g2 -Wall -Werror # (B) Debug mode, w/ full line-level debugging symbols
OPT ?= -g2 # (B) Debug mode, w/ full line-level debugging symbols
# OPT ?= -O2 -g2 -DNDEBUG # (C) Profiling mode: opt, but w/debugging symbols

CC = gcc
CXX = g++

SHARED_CFLAGS = -fPIC
SHARED_LDFLAGS = -shared -Wl,-soname -Wl,

INCPATH += -I./src -I./include -I./src/leveldb/include -I./src/leveldb $(DEPS_INCPATH)
CFLAGS += -std=c99 $(OPT) $(SHARED_CFLAGS) $(INCPATH)
CXXFLAGS += $(OPT) $(SHARED_CFLAGS) $(INCPATH)
LDFLAGS += -rdynamic $(DEPS_LDPATH) $(DEPS_LDFLAGS) -lpthread -lrt -lz -ldl
PLATFORM=OS_LINUX
PLATFORM_LDFLAGS=-pthread
PLATFORM_LIBS=
PLATFORM_CCFLAGS= -fno-builtin-memcmp -pthread -DOS_LINUX -DLEVELDB_PLATFORM_POSIX -DLEVELDB_ATOMIC_PRESENT -DSNAPPY
PLATFORM_CXXFLAGS=-std=c++0x -fno-builtin-memcmp -lpthread -DLEVELDB_PLATFORM_POSIX -DLEVELDB_ATOMIC_PRESENT -DSNAPPY
PLATFORM_SHARED_CFLAGS=-fPIC
PLATFORM_SHARED_EXT=so
PLATFORM_SHARED_LDFLAGS=-shared -Wl,-soname -Wl,
PLATFORM_SHARED_VERSIONED=true

SHARED_CFLAGS = -fPIC
SHARED_LDFLAGS = -shared -Wl,-soname -Wl,

INCPATH += -I./src/leveldb -I./src/leveldb/include -I./src -I./include $(DEPS_INCPATH)
#### CFLAGS += -std=c99 $(OPT) $(SHARED_CFLAGS) $(INCPATH) $(PLATFORM_CCFLAGS)
CFLAGS += $(OPT) $(SHARED_CFLAGS) $(INCPATH) $(PLATFORM_CCFLAGS)
CXXFLAGS += $(OPT) $(DEPS_LDPATH) $(DEPS_LDFLAGS) $(SHARED_CFLAGS) $(INCPATH) $(PLATFORM_CXXFLAGS)
LDFLAGS += -rdynamic $(DEPS_LDPATH) $(DEPS_LDFLAGS) -lpthread -lrt -lz -ldl

PROTO_FILES := $(wildcard src/proto/*.proto)
PROTO_OUT_CC := $(PROTO_FILES:.proto=.pb.cc)
Expand All @@ -23,10 +35,11 @@ PROTO_OUT_H := $(PROTO_FILES:.proto=.pb.h)
OTHER_SRC := src/trace_flags.cc src/fs_inotify.cc
SDK_SRC := $(wildcard src/sdk/*.cc)
COMMON_SRC := $(wildcard src/common/*.cc)
UTIL_SRC := $(wildcard src/util/*.cc)
UTIL_SRC := $(wildcard src/utils/*.cc)
PROTO_SRC := $(filter-out %.pb.cc, $(wildcard src/proto/*.cc)) $(PROTO_OUT_CC)
VERSION_SRC := src/version.cc
MDTTOOL_SRC := $(wildcard src/mdt-tool/mdt-tool.cc)
MAIL_SRC := $(wildcard src/mail/mail.cc)
UPDATESCHEMA_SRC := $(wildcard src/mdt-tool/test_update_schema.cc)
SAMPLE_SRC := $(wildcard src/sample/mdt_test.cc)
WRITE_TEST_SRC := $(wildcard src/benchmark/write_test.cc)
Expand All @@ -37,7 +50,7 @@ SCAN_TEST_SRC := $(wildcard src/benchmark/scan_test.cc)
C_SAMPLE_SRC := $(wildcard src/sample/c_sample.c)

FTRACE_SRC := $(wildcard src/ftrace/*.cc)
FTRACE_TEST_SRC := $(wildcard src/ftrace/test/*.cc)
###FTRACE_TEST_SRC := $(wildcard src/ftrace/test/*.cc)

AGENT_SRC := $(wildcard src/agent/*.cc)
COLLECTOR_SRC := $(wildcard src/collector/*.cc)
Expand All @@ -52,6 +65,7 @@ PROTO_OBJ := $(PROTO_SRC:.cc=.o)
VERSION_OBJ := $(VERSION_SRC:.cc=.o)
SAMPLE_OBJ := $(SAMPLE_SRC:.cc=.o)
MDTTOOL_OBJ := $(MDTTOOL_SRC:.cc=.o)
MAIL_OBJ := $(MAIL_SRC:.cc=.o)
UPDATESCHEMA_OBJ := $(UPDATESCHEMA_SRC:.cc=.o)
WRITE_TEST_OBJ := $(WRITE_TEST_SRC:.cc=.o)
DUMPFILE_OBJ := $(DUMPFILE_SRC:.cc=.o)
Expand All @@ -61,22 +75,22 @@ SCAN_TEST_OBJ := $(SCAN_TEST_SRC:.cc=.o)
C_SAMPLE_OBJ := $(C_SAMPLE_SRC:.c=.o)

FTRACE_OBJ := $(FTRACE_SRC:.cc=.o)
FTRACE_TEST_OBJ := $(FTRACE_TEST_SRC:.cc=.o)
#FTRACE_TEST_OBJ := $(FTRACE_TEST_SRC:.cc=.o)
AGENT_OBJ := $(AGENT_SRC:.cc=.o)
COLLECTOR_OBJ := $(COLLECTOR_SRC:.cc=.o)
SCHEDULER_OBJ := $(SCHEDULER_SRC:.cc=.o)

CXX_OBJ := $(SDK_OBJ) $(COMMON_OBJ) $(UTIL_OBJ) $(PROTO_OBJ) $(VERSION_OBJ) \
$(SAMPLE_OBJ) $(MDTTOOL_OBJ) $(WRITE_TEST_OBJ) $(MULWRITE_TEST_OBJ) \
$(SAMPLE_OBJ) $(MDTTOOL_OBJ) $(MAIL_OBJ) $(WRITE_TEST_OBJ) $(MULWRITE_TEST_OBJ) \
$(SCAN_TEST_OBJ) $(SYNC_WRITE_TEST_OBJ) $(UPDATESCHEMA_OBJ) $(DUMPFILE_OBJ) \
$(COLLECTOR_OBJ) $(SCHEDULER_OBJ)
$(COLLECTOR_OBJ) $(SCHEDULER_OBJ)
C_OBJ := $(C_SAMPLE_OBJ)
LEVELDB_LIB := src/leveldb/libleveldb.a

############################################################
PROGRAM = agent_main collector_main scheduler_main
FTRACELIBRARY = libftrace.a
FTRACE_TEST = TEST_log
#FTRACE_TEST = TEST_log

LIBRARY = libmdt.a
SAMPLE = sample
Expand Down Expand Up @@ -115,53 +129,53 @@ cleanall:
src/leveldb/libleveldb.a: FORCE
$(MAKE) -C src/leveldb

sample: $(SAMPLE_OBJ) $(LIBRARY)
$(CXX) -o $@ $(SAMPLE_OBJ) $(LIBRARY) $(LDFLAGS)
sample: $(SAMPLE_OBJ) $(LIBRARY) $(LEVELDB_LIB)
$(CXX) -o $@ $(SAMPLE_OBJ) $(LIBRARY) $(LDFLAGS) $(LEVELDB_LIB)

mdt-tool: $(MDTTOOL_OBJ) $(LIBRARY) $(OTHER_OBJ)
$(CXX) -o $@ $(MDTTOOL_OBJ) $(LIBRARY) $(OTHER_OBJ) $(LDFLAGS) -lreadline -lhistory -lncurses
mdt-tool: $(MDTTOOL_OBJ) $(LIBRARY) $(OTHER_OBJ) $(LEVELDB_LIB)
$(CXX) -o $@ $(MDTTOOL_OBJ) $(LIBRARY) $(OTHER_OBJ) $(LDFLAGS) $(LEVELDB_LIB) -lreadline -lhistory -lncurses

test_update_schema: $(UPDATESCHEMA_OBJ) $(LIBRARY)
$(CXX) -o $@ $(UPDATESCHEMA_OBJ) $(LIBRARY) $(LDFLAGS)
test_update_schema: $(UPDATESCHEMA_OBJ) $(LIBRARY) $(LEVELDB_LIB)
$(CXX) -o $@ $(UPDATESCHEMA_OBJ) $(LIBRARY) $(LDFLAGS) $(LEVELDB_LIB)

write_test: $(WRITE_TEST_OBJ) $(LIBRARY)
$(CXX) -o $@ $(WRITE_TEST_OBJ) $(LIBRARY) $(LDFLAGS)
write_test: $(WRITE_TEST_OBJ) $(LIBRARY) $(LEVELDB_LIB)
$(CXX) -o $@ $(WRITE_TEST_OBJ) $(LIBRARY) $(LDFLAGS) $(LEVELDB_LIB)

dumpfile: $(DUMPFILE_OBJ) $(LIBRARY)
$(CXX) -o $@ $(DUMPFILE_OBJ) $(LIBRARY) $(LDFLAGS)
dumpfile: $(DUMPFILE_OBJ) $(LIBRARY) $(LEVELDB_LIB) $(MAIL_OBJ)
$(CXX) -o $@ $(DUMPFILE_OBJ) $(LIBRARY) $(LDFLAGS) $(LEVELDB_LIB) $(MAIL_OBJ)

sync_write_test: $(SYNC_WRITE_TEST_OBJ) $(LIBRARY)
$(CXX) -o $@ $(SYNC_WRITE_TEST_OBJ) $(LIBRARY) $(LDFLAGS)
sync_write_test: $(SYNC_WRITE_TEST_OBJ) $(LIBRARY) $(LEVELDB_LIB)
$(CXX) -o $@ $(SYNC_WRITE_TEST_OBJ) $(LIBRARY) $(LDFLAGS) $(LEVELDB_LIB)

mulcli_write_test: $(MULWRITE_TEST_OBJ) $(LIBRARY)
$(CXX) -o $@ $(MULWRITE_TEST_OBJ) $(LIBRARY) $(LDFLAGS)
mulcli_write_test: $(MULWRITE_TEST_OBJ) $(LIBRARY) $(LEVELDB_LIB)
$(CXX) -o $@ $(MULWRITE_TEST_OBJ) $(LIBRARY) $(LDFLAGS) $(LEVELDB_LIB)

scan_test: $(SCAN_TEST_OBJ) $(LIBRARY)
$(CXX) -o $@ $(SCAN_TEST_OBJ) $(LIBRARY) $(LDFLAGS)
scan_test: $(SCAN_TEST_OBJ) $(LIBRARY) $(LEVELDB_LIB)
$(CXX) -o $@ $(SCAN_TEST_OBJ) $(LIBRARY) $(LDFLAGS) $(LEVELDB_LIB)

c_sample: $(C_SAMPLE_OBJ) $(LIBRARY)
$(CXX) -o $@ $(C_SAMPLE_OBJ) $(LIBRARY) $(LDFLAGS)
c_sample: $(C_SAMPLE_OBJ) $(LIBRARY) $(LEVELDB_LIB)
$(CXX) -o $@ $(C_SAMPLE_OBJ) $(LIBRARY) $(LDFLAGS) $(LEVELDB_LIB)

libmdt.a: $(SDK_OBJ) $(COMMON_OBJ) $(UTIL_OBJ) $(PROTO_OBJ) $(VERSION_OBJ)
$(AR) -rs $@ $(SDK_OBJ) $(COMMON_OBJ) $(UTIL_OBJ) $(PROTO_OBJ) $(VERSION_OBJ)
libmdt.a: $(SDK_OBJ) $(COMMON_OBJ) $(UTIL_OBJ) $(PROTO_OBJ) $(VERSION_OBJ) $(LEVELDB_LIB)
$(AR) -rs $@ $(SDK_OBJ) $(COMMON_OBJ) $(UTIL_OBJ) $(PROTO_OBJ) $(VERSION_OBJ) $(LEVELDB_LIB)

libftrace.a: $(FTRACE_OBJ) $(PROTO_OBJ)
$(AR) -rs $@ $(FTRACE_OBJ) $(PROTO_OBJ)

TEST_log: $(FTRACE_TEST_OBJ) $(FTRACELIBRARY)
$(CXX) -o $@ $(FTRACE_TEST_OBJ) $(FTRACELIBRARY) $(LDFLAGS)
#TEST_log: $(FTRACE_TEST_OBJ) $(FTRACELIBRARY)
# $(CXX) -o $@ $(FTRACE_TEST_OBJ) $(FTRACELIBRARY) $(LDFLAGS)

agent_main: $(AGENT_OBJ) $(PROTO_OBJ) $(VERSION_OBJ) $(LEVELDB_LIB) $(OTHER_OBJ)
$(CXX) -o agent_main $(AGENT_OBJ) $(PROTO_OBJ) $(VERSION_OBJ) $(LDFLAGS) $(LEVELDB_LIB) $(OTHER_OBJ)

collector_main: $(COLLECTOR_OBJ) $(LIBRARY) $(OTHER_OBJ)
$(CXX) -o collector_main $(COLLECTOR_OBJ) $(LIBRARY) $(OTHER_OBJ) $(LDFLAGS)
collector_main: $(COLLECTOR_OBJ) $(LIBRARY) $(OTHER_OBJ) $(LEVELDB_LIB)
$(CXX) -o collector_main $(COLLECTOR_OBJ) $(LIBRARY) $(OTHER_OBJ) $(LDFLAGS) $(LEVELDB_LIB)

scheduler_main: $(SCHEDULER_OBJ) $(PROTO_OBJ) $(VERSION_OBJ) $(OTHER_OBJ)
$(CXX) -o scheduler_main $(SCHEDULER_OBJ) $(PROTO_OBJ) $(VERSION_OBJ) $(OTHER_OBJ) $(LDFLAGS)
scheduler_main: $(SCHEDULER_OBJ) $(PROTO_OBJ) $(VERSION_OBJ) $(OTHER_OBJ) $(LEVELDB_LIB) $(MAIL_OBJ)
$(CXX) -o scheduler_main $(SCHEDULER_OBJ) $(PROTO_OBJ) $(VERSION_OBJ) $(OTHER_OBJ) $(LDFLAGS) $(LEVELDB_LIB) $(MAIL_OBJ)

$(CXX_OBJ): %.o: %.cc $(PROTO_OUT_H)
$(CXX) $(CXXFLAGS) -c $< -o $@
$(CXX_OBJ): %.o: %.cc $(PROTO_OUT_H) $(LEVELDB_LIB)
$(CXX) $(CXXFLAGS) -c $< -o $@ $(LEVELDB_LIB)

$(C_OBJ): %.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
Expand Down
17 changes: 12 additions & 5 deletions depends.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ GTEST_PREFIX=thirdparty
GPERFTOOLS_PREFIX=thirdparty
INS_PREFIX=thirdparty
TERA_PREFIX=thirdparty
GALAXY_PREFIX=thirdparty
COMMON_PREFIX=thirdparty

SOFA_PBRPC_INCDIR = $(SOFA_PBRPC_PREFIX)/include
PROTOBUF_INCDIR = $(PROTOBUF_PREFIX)/include
Expand All @@ -27,7 +29,9 @@ GTEST_INCDIR = $(GTEST_PREFIX)/include
GPERFTOOLS_INCDIR = $(GPERFTOOLS_PREFIX)/include
INS_INCDIR = $(INS_PREFIX)/include
TERA_INCDIR = $(TERA_PREFIX)/include
GALAXY_INCDIR = $(GALAXY_PREFIX)/include

BOOST_LIBDIR=$(BOOST_INCDIR)/stage/lib
SOFA_PBRPC_LIBDIR = $(SOFA_PBRPC_PREFIX)/lib
PROTOBUF_LIBDIR = $(PROTOBUF_PREFIX)/lib
SNAPPY_LIBDIR = $(SNAPPY_PREFIX)/lib
Expand All @@ -38,6 +42,8 @@ GTEST_LIBDIR = $(GTEST_PREFIX)/lib
GPERFTOOLS_LIBDIR = $(GPERFTOOLS_PREFIX)/lib
INS_LIBDIR = $(INS_PREFIX)/lib
TERA_LIBDIR = $(TERA_PREFIX)/lib
GALAXY_LIBDIR = $(GALAXY_PREFIX)/lib
COMMON_LIBDIR = $(COMMON_PREFIX)/lib

PROTOC = $(PROTOBUF_PREFIX)/bin/protoc

Expand All @@ -49,17 +55,18 @@ DEPS_INCPATH = -I$(SOFA_PBRPC_INCDIR) -I$(PROTOBUF_INCDIR) \
-I$(SNAPPY_INCDIR) -I$(ZOOKEEPER_INCDIR) \
-I$(GFLAGS_INCDIR) -I$(GLOG_INCDIR) -I$(GTEST_INCDIR) \
-I$(GPERFTOOLS_INCDIR) -I$(BOOST_INCDIR) -I$(INS_INCDIR) \
-I$(TERA_INCDIR)
-I$(TERA_INCDIR) -I$(GALAXY_INCDIR)
DEPS_LDPATH = -L$(TERA_LIBDIR) -L$(SOFA_PBRPC_LIBDIR) -L$(PROTOBUF_LIBDIR) \
-L$(SNAPPY_LIBDIR) -L$(ZOOKEEPER_LIBDIR) \
-L$(GFLAGS_LIBDIR) -L$(GLOG_LIBDIR) -L$(GTEST_LIBDIR) \
-L$(GPERFTOOLS_LIBDIR) -L$(INS_LIBDIR) \
-L$(TERA_LIBDIR)
-L$(TERA_LIBDIR) -L$(GALAXY_LIBDIR) -L$(BOOST_LIBDIR)
DEPS_LDFLAGS = -ltera -lins_sdk -lsofa-pbrpc -lprotobuf -lsnappy -lzookeeper_mt \
-lgtest_main -lgtest -lglog -lgflags
DEPS_LIBRARIES = $(TERA_LIBDIR)/libtera.a $(INS_LIBDIR)/libins_sdk.a \
-lgtest_main -lgtest -lglog -lgflags -lgalaxy -lcommon -ltcmalloc_minimal -lboost_regex
DEPS_LIBRARIES = $(COMMON_LIBDIR)/libcommon.a $(GALAXY_LIBDIR)/libgalaxy.a $(TERA_LIBDIR)/libtera.a $(INS_LIBDIR)/libins_sdk.a \
$(SOFA_PBRPC_LIBDIR)/libsofa-pbrpc.a $(PROTOBUF_LIBDIR)/libprotobuf.a \
$(SNAPPY_LIBDIR)/libsnappy.a $(ZOOKEEPER_LIBDIR)/libzookeeper_mt.a \
$(GTEST_LIBDIR)/libgtest_main.a $(GTEST_LIBDIR)/libgtest.a \
$(GLOG_LIBDIR)/libglog.a $(GFLAGS_LIBDIR)/libgflags.a
$(GLOG_LIBDIR)/libglog.a $(GFLAGS_LIBDIR)/libgflags.a $(GPERFTOOLS_LIBDIR)/libtcmalloc_minimal.a \
$(BOOST_LIBDIR)/libboost_regex.a

1 change: 0 additions & 1 deletion python/compilep-proto.sh

This file was deleted.

44 changes: 0 additions & 44 deletions python/ftrace/sdk.py

This file was deleted.

1 change: 1 addition & 0 deletions sharingan/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions sharingan/.idea/dictionaries/wanghaitao01.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions sharingan/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions sharingan/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions sharingan/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions sharingan/.idea/sharingan.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading