----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/15200/#review28124 -----------------------------------------------------------
Hey Shingo, this is really cool! However, usage.json is deprecated in favor of statistics.json, I've made a few suggestions below related to this. src/cli/mesos-ps <https://reviews.apache.org/r/15200/#comment54711> usage.json is now deprecated in favor of statistics.json statistics.json returns snapshot information, which means you will not be able to pull out a recent CPU usage % like you can with usage.json. However, different flavors of 'ps' return different CPU % information. FreeBSD: The CPU utilization of the process; this is a decaying average over up to a minute of previous (real) time. Since the time base over which this is computed varies (since processes may be very young) it is possible for the sum of all %cpu fields to exceed 100%. Linux: CPU usage is currently expressed as the percentage of time spent running during the entire lifetime of a process. This is not ideal, and it does not conform to the standards that ps otherwise conforms to. CPU usage is unlikely to add up to exactly 100%. So I see a few options here: 1. We could update this to only use the statistics.json endpoint, and mimic the behavior of Linux ps when showing % CPU, that is: % CPU = (user_cpu_time_secs + system_cpu_time_secs) / (running_time) But we'll need the running_time which we can figure out from Brenden's change here (which : https://reviews.apache.org/r/14434/ 2. Leave this change as is, and I can remove the usage.json request when I remove that endpoint completely. I don't prefer this solution since usage.json is deprecated. 3. Only show memory usage and total cpu time, no CPU usage for now. - Ben Mahler On Nov. 3, 2013, 5:17 a.m., Shingo Omura wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/15200/ > ----------------------------------------------------------- > > (Updated Nov. 3, 2013, 5:17 a.m.) > > > Review request for mesos, Benjamin Hindman, Ben Mahler, Du Li, and Niklas > Nielsen. > > > Repository: mesos-git > > > Description > ------- > > I think it would be better mesos-ps reports used/allocated memory and cpus. > Column class in mesos-ps was changed slightly in this refactoring. > > > Diffs > ----- > > src/cli/mesos-ps b7dca14 > > Diff: https://reviews.apache.org/r/15200/diff/ > > > Testing > ------- > > tested on my laptop, single host deployment. > -(~/Documents/githubs/everpeace/mesos/build)- > $ ./bin/mesos.sh ps --master=10.0.1.15:5050 > USER FRAMEWORK TASK SLAVE CPUS MEM > TIME > everp... echo2 everpeaces-ima... 0.0/1.0 7.8/128.0 MB > 00:00:01.460 > everp... echo everpeaces-ima... 0.0/1.0 6.7/128.0 MB > 00:00:04.592 > > > Thanks, > > Shingo Omura > >
