hyperledger-caliper / caliper

A blockchain benchmark framework to measure performance of multiple blockchain solutions https://wiki.hyperledger.org/display/caliper
https://hyperledger-caliper.github.io/caliper/
Apache License 2.0
653 stars 405 forks source link

Incorrect CPU percent statistics for local docker container #504

Closed vita-dounai closed 5 years ago

vita-dounai commented 5 years ago

Context

I set up a 4 blockchain nodes benchmark in which all nodes running in local docker containers. Although my machine has only 8 cores, the CPU percent statistics return by Caliper shows that the CPU usage percentage of each container had been beyond 1500%, it's not reasonable.

Expected Behavior

The CPU usage percentage of each node container should not exceed 800% with a 8 cores CPU.

Actual Behavior

image

Possible Fix

The way to calculate CPU usage for local docker container should be same as remote docker container.

Steps to Reproduce

  1. Install Caliper and Caliper CLI
  2. Run a benchmark
  3. View performance statistics result

Existing issues

Context

This problem make that Caliper can't afford accurate CPU usage statistics for me. When I try to copy code for calculating CPU usage from the code block for remote docker container, the problem is solved.

Your Environment

aklenik commented 5 years ago

Yes, you're absolutely right. There's an ongoing debate about the scope of Caliper. Specifically, whether it should collect such data at all. There're many industrial-grade tools available for resource monitoring, with a seamless integration pipeline between different tools (from metric collection to visualization).

So in the long term, it's possible that resource monitoring will be removed from Caliper, and it will only collect the client-side transaction metrics, as defined by the PSWG whitepaper. We'll see. We certainly don't want to reinvent the wheel (nor we have the resources for it).

However, in the meantime, we'd really appreciate if you'd open a PR with the fix since it looks like you got it working :)

aklenik commented 5 years ago

Resolved by #508