xiangdong Huang created IOTDB-170:
-------------------------------------
Summary: Operation Trace and Performance Profiling Tool
Key: IOTDB-170
URL: https://issues.apache.org/jira/browse/IOTDB-170
Project: Apache IoTDB
Issue Type: Wish
Reporter: xiangdong Huang
As we know, tuning a database (especially in the product environment) is quite
a trouble..
Logging the trace of an operation is quite useful. However, it is too detailed
for the database if there is no need to tune.
Therefore, a flexible switch to print or disable the log is important. Slf4j
has the ability.
In most case, we use slf4j like this:
{code:java}
// code placeholder
class A {
Logger logger = LoggerFactory.getLogger(A.class);
fun1() {
logger.info("this log is useful for tracing a query.");
logger.info("this log is for other purpose.");
}
}
class B {
Logger logger = LoggerFactory.getLogger(B.class);
fun2() {
logger.info("this log is for other purpose.");
logger.info("this log is useful for tracing a query.");
}
}
{code}
The problem is, if we want to disable the trace, all other log records are also
disabled. (E.g., two log records in the above example).
Maybe, we can do like this:
{code:java}
// code placeholder
class QueryTrace {
}
class InsertionTrace {
}
class A {
Logger logger = LoggerFactory.getLogger(A.class);
Logger qlogger = LoggerFactory.getLogger(QueryTrace.class);
fun1() {
if(qlogger.isInfoEnable()) {
qlogger.info("this log is useful for tracing a query.");
}
logger.info("this log is for other purpose.");
}
}
class B {
Logger logger = LoggerFactory.getLogger(B.class);
Logger ilogger = LoggerFactory.getLogger(InsertionTrace.class);
fun2() {
logger.info("this log is for other purpose.");
if(ilogger.isInfoEnable()) {
ilogger.info("this log is useful for tracing a query.");
}
}
}
{code}
Then, we can disable the log for query trace like:
<logger name="org.apache.iotdb.QueryTrace" level="error" />
Then, a log analyzer is needed to:
# visualize the operation trace;
# calculate the time cost;
# (If there is CPU/memory utilization data), align the log with computing
resource utilization.
The log analyzer tool will play important role especially for the distributed
version.
--
This message was sent by Atlassian Jira
(v8.3.2#803003)