Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,51 @@ Value of the `Tcp: OutSegs` field in `/proc/net/snmp`. Represents the number of
Use `(NEW_tcp_retrans_segs - OLD_tcp_retrans_segs) / (NEW_tcp_out_segs - OLD_tcp_out_segs)` can calculate the retrans rate of TCP packets.

Usually used to troubleshoot network problems.

### `jvm_thread{type="count"}`

Value of the `count` type in `jvm_thread`. Represents the current number of live threads including both daemon and non-daemon threads.

Usually used to troubleshoot jvm threads problems for FE.

### `jvm_thread{type="peak_count"}`

Value of the `peak_count` type in `jvm_thread`. Represents the current number of live threads including both daemon and non-daemon threads.

Usually used to troubleshoot jvm threads problems for FE.

### `jvm_thread{type="new_count"}`

Value of the `new_count` type in `jvm_thread`. Represents the current number of threads which state is NEW.

Usually used to troubleshoot jvm threads problems for FE.

### `jvm_thread{type="runnable_count"}`

Value of the `runnable_count` type in `jvm_thread`. Represents the current number of threads which state is RUNNABLE.

Usually used to troubleshoot jvm threads problems for FE.

### `jvm_thread{type="blocked_count"}`

Value of the `blocked_count` type in `jvm_thread`. Represents the current number of threads which state is BLOCKED.

Usually used to troubleshoot jvm threads problems for FE.

### `jvm_thread{type="waiting_count"}`

Value of the `waiting_count` type in `jvm_thread`. Represents the current number of threads which state is WAITING.

Usually used to troubleshoot jvm threads problems for FE.

### `jvm_thread{type="timed_waiting_count"}`

Value of the `timed_waiting_count` type in `jvm_thread`. Represents the current number of threads which state is TIMED_WAITING.

Usually used to troubleshoot jvm threads problems for FE.

### `jvm_thread{type="terminated_count"}`

Value of the `terminated_count` type in `jvm_thread`. Represents the current number of threads which state is TERMINATED.

Usually used to troubleshoot jvm threads problems for FE.
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,51 @@ FE 的监控项可以通过以下方式访问:
通过 `(NEW_tcp_tcp_retrans_segs - OLD_tcp_retrans_segs) / (NEW_tcp_out_segs - OLD_tcp_out_segs)` 可以计算 TCP 重传率。

通常用于排查网络问题。

### `jvm_thread{type="count"}`

该监控项表示FE节点当前JVM总的线程数量,包含daemon线程和非daemon线程。

通常用于排查FE节点的JVM线程运行问题。

### `jvm_thread{type="peak_count"}`

该监控项表示FE节点从JVM启动以来的最大峰值线程数量。

通常用于排查FE节点的JVM线程运行问题。

### `jvm_thread{type="new_count"}`

该监控项表示FE节点JVM中处于NEW状态的线程数量。

通常用于排查FE节点的JVM线程运行问题。

### `jvm_thread{type="runnable_count"}`

该监控项表示FE节点JVM中处于RUNNABLE状态的线程数量。

通常用于排查FE节点的JVM线程运行问题。

### `jvm_thread{type="blocked_count"}`

该监控项表示FE节点JVM中处于BLOCKED状态的线程数量。

通常用于排查FE节点的JVM线程运行问题。

### `jvm_thread{type="waiting_count"}`

该监控项表示FE节点JVM中处于WAITING状态的线程数量。

通常用于排查FE节点的JVM线程运行问题。

### `jvm_thread{type="timed_waiting_count"}`

该监控项表示FE节点JVM中处于TIMED_WAITING状态的线程数量。

通常用于排查FE节点的JVM线程运行问题。

### `jvm_thread{type="terminated_count"}`

该监控项表示FE节点JVM中处于TERMINATED状态的线程数量。

通常用于排查FE节点的JVM线程运行问题。
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ public ProcResult fetchResult() throws AnalysisException {
Threads threads = jvmStats.getThreads();
result.addRow(genRow("threads count", threads.getCount()));
result.addRow(genRow("threads peak count", threads.getPeakCount()));
result.addRow(genRow("threads new count", threads.getThreadsNewCount()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update docs of fe metrics include every new metrics and means of metrics

Copy link
Contributor Author

@Dam1029 Dam1029 Dec 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jvm Thread State is an enum type. A thread can be in one of the following states: NEW, RUNNABLE, BLOCKED, WAITING, TIMED_WAITING, TERMINATED.
A fe thread can be in only one state at a given point in time. The new metrics mean how many fe threads in a specific state now. I think this will be useful when we want to analysis fe whole running status.

Copy link
Contributor Author

@Dam1029 Dam1029 Dec 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FE监控项: http://doris.apache.org/master/zh-CN/administrator-guide/operation/monitor-metrics/fe-metrics.html#%E6%9F%A5%E7%9C%8B%E7%9B%91%E6%8E%A7%E9%A1%B9

Currently, the docs about metrics contains PrometheusMetrics and SystemMetrics. The doris_fe_snmp belong to SystemMetrics, and the new metrics I added belong to PrometheusMetrics. I want to confirm did I need to add new metrics in this page?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is ok to add them in this doc.
we will reorganized this doc later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your reply. I have update the docs of fe metrics.

result.addRow(genRow("threads runnable count", threads.getThreadsRunnableCount()));
result.addRow(genRow("threads blocked count", threads.getThreadsBlockedCount()));
result.addRow(genRow("threads waiting count", threads.getThreadsWaitingCount()));
result.addRow(genRow("threads timed_waiting count", threads.getThreadsTimedWaitingCount()));
result.addRow(genRow("threads terminated count", threads.getThreadsTerminatedCount()));

return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ public void visitJvm(StringBuilder sb, JvmStats jvmStats) {
sb.append(Joiner.on(" ").join(TYPE, JVM_THREAD, "gauge\n"));
sb.append(JVM_THREAD).append("{type=\"count\"} ").append(threads.getCount()).append("\n");
sb.append(JVM_THREAD).append("{type=\"peak_count\"} ").append(threads.getPeakCount()).append("\n");
sb.append(JVM_THREAD).append("{type=\"new_count\"} ").append(threads.getThreadsNewCount()).append("\n");
sb.append(JVM_THREAD).append("{type=\"runnable_count\"} ").append(threads.getThreadsRunnableCount()).append("\n");
sb.append(JVM_THREAD).append("{type=\"blocked_count\"} ").append(threads.getThreadsBlockedCount()).append("\n");
sb.append(JVM_THREAD).append("{type=\"waiting_count\"} ").append(threads.getThreadsWaitingCount()).append("\n");
sb.append(JVM_THREAD).append("{type=\"timed_waiting_count\"} ").append(threads.getThreadsTimedWaitingCount()).append("\n");
sb.append(JVM_THREAD).append("{type=\"terminated_count\"} ").append(threads.getThreadsTerminatedCount()).append("\n");
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.lang.management.MemoryUsage;
import java.lang.management.RuntimeMXBean;
import java.lang.management.ThreadMXBean;
import java.lang.management.ThreadInfo;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -82,7 +83,28 @@ public static JvmStats jvmStats() {
}
Mem mem = new Mem(heapCommitted, heapUsed, heapMax, nonHeapCommitted, nonHeapUsed,
Collections.unmodifiableList(pools));
Threads threads = new Threads(threadMXBean.getThreadCount(), threadMXBean.getPeakThreadCount());

int threadsNew = 0;
int threadsRunnable = 0;
int threadsBlocked = 0;
int threadsWaiting = 0;
int threadsTimedWaiting = 0;
int threadsTerminated = 0;
long threadIds[] = threadMXBean.getAllThreadIds();
for (ThreadInfo threadInfo : threadMXBean.getThreadInfo(threadIds, 0)) {
if (threadInfo == null) continue; // race protection
switch (threadInfo.getThreadState()) {
case NEW: threadsNew++; break;
case RUNNABLE: threadsRunnable++; break;
case BLOCKED: threadsBlocked++; break;
case WAITING: threadsWaiting++; break;
case TIMED_WAITING: threadsTimedWaiting++; break;
case TERMINATED: threadsTerminated++; break;
default: break;
}
}
Threads threads = new Threads(threadMXBean.getThreadCount(), threadMXBean.getPeakThreadCount(), threadsNew,
threadsRunnable, threadsBlocked, threadsWaiting, threadsTimedWaiting, threadsTerminated);

List<GarbageCollectorMXBean> gcMxBeans = ManagementFactory.getGarbageCollectorMXBeans();
GarbageCollector[] collectors = new GarbageCollector[gcMxBeans.size()];
Expand Down Expand Up @@ -192,6 +214,12 @@ static final class Fields {
static final String THREADS = "threads";
static final String COUNT = "count";
static final String PEAK_COUNT = "peak_count";
static final String NEW_COUNT = "new_count";
static final String RUNNING_COUNT = "runnable_count";
static final String BLOCKED_COUNT = "blocked_count";
static final String WAITING_COUNT = "waiting_count";
static final String TIMED_WAITING_COUNT = "timed_waiting_count";
static final String TERMINATED_COUNT = "terminated_count";

static final String GC = "gc";
static final String COLLECTORS = "collectors";
Expand Down Expand Up @@ -264,10 +292,23 @@ public static class Threads {

private final int count;
private final int peakCount;

public Threads(int count, int peakCount) {
private final int threadsNewCount;
private final int threadsRunnableCount;
private final int threadsBlockedCount;
private final int threadsWaitingCount;
private final int threadsTimedWaitingCount;
private final int threadsTerminatedCount;

public Threads(int count, int peakCount, int threadsNewCount, int threadsRunnableCount, int threadsBlockedCount,
int threadsWaitingCount, int threadsTimedWaitingCount, int threadsTerminatedCount) {
this.count = count;
this.peakCount = peakCount;
this.threadsNewCount = threadsNewCount;
this.threadsRunnableCount = threadsRunnableCount;
this.threadsBlockedCount = threadsBlockedCount;
this.threadsWaitingCount = threadsWaitingCount;
this.threadsTimedWaitingCount = threadsTimedWaitingCount;
this.threadsTerminatedCount = threadsTerminatedCount;
}

public int getCount() {
Expand All @@ -278,6 +319,30 @@ public int getPeakCount() {
return peakCount;
}

public int getThreadsNewCount() {
return threadsNewCount;
}

public int getThreadsRunnableCount() {
return threadsRunnableCount;
}

public int getThreadsBlockedCount() {
return threadsBlockedCount;
}

public int getThreadsWaitingCount() {
return threadsWaitingCount;
}

public int getThreadsTimedWaitingCount() {
return threadsTimedWaitingCount;
}

public int getThreadsTerminatedCount() {
return threadsTerminatedCount;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
Expand Down