We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
As of now cpu instantaneous usage metrics are computed on the fly, in the REST handler. Instead they should be computed in the core.
cc @timstclair @pwittrock
The text was updated successfully, but these errors were encountered:
the only way I found to get the cpu usage per container is doing like following in Java:
public static double getInstantPercentCPUUsage(JSONObject obj0) throws ParseException { JSONObject obj = obj0.getJSONObject(obj0.keys().next()) ; JSONObject firstValue = obj.getJSONArray("stats").getJSONObject(obj.getJSONArray("stats").length()-1); JSONObject secondValue = obj.getJSONArray("stats").getJSONObject(obj.getJSONArray("stats").length()-2); String ts1 = firstValue.getString("timestamp"); String ts2 = secondValue.getString("timestamp"); int cpuUsage1 = firstValue.getJSONObject("cpu").getJSONObject("usage").getInt("total"); int cpuUsage2 = secondValue.getJSONObject("cpu").getJSONObject("usage").getInt("total"); DateTimeFormatter parser = ISODateTimeFormat.dateTime(); DateTime dt1 = parser.parseDateTime(ts1); DateTime dt2 = parser.parseDateTime(ts2); DateTimeFormatter formatter = DateTimeFormat.mediumDateTime(); return (cpuUsage1-cpuUsage2)/((dt1.getSecondOfDay()-dt2.getSecondOfDay())*10000000) ; }
It is the derivative cpu usage over time. I don't know if that right !!
Sorry, something went wrong.
No branches or pull requests
As of now cpu instantaneous usage metrics are computed on the fly, in the REST handler. Instead they should be computed in the core.
cc @timstclair @pwittrock
The text was updated successfully, but these errors were encountered: