Skip to content

instance CPU usage exceeds 100% in 8.3.0 #7602

@amwyyyy

Description

@amwyyyy

Please answer these questions before submitting your issue.

  • Why do you submit this issue?
  • Question or discussion
  • Bug
  • Requirement
  • Feature or performance improvement

The cpu usage rate exceeds 100%. From the source code of the agent, it will not exceed 100%. What might be the cause?

图片

    public CPU getCPUMetrics() {
        long cpuTime = this.getCpuTime();
        long cpuCost = cpuTime - lastCPUTimeNs;
        long now = System.nanoTime();

        try {
            CPU.Builder cpuBuilder = CPU.newBuilder();
            return cpuBuilder.setUsagePercent(cpuCost * 1.0d / ((now - lastSampleTimeNs) * cpuCoreNum) * 100).build();
        } finally {
            lastCPUTimeNs = cpuTime;
            lastSampleTimeNs = now;
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions