> On Nov. 4, 2013, 6:18 p.m., Ben Mahler wrote: > > src/cli/mesos-ps, line 93 > > <https://reviews.apache.org/r/15200/diff/1/?file=377026#file377026line93> > > > > 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.
Thanks Ben! I didn't know usage.json was deprecated. sorry about that. > 1. %CPU This value could be accumulated percentage, isn't it?? Memory usage printed by mesos-ps is 'present' memory usage. So, to keep values reported by mesos-ps be consistent, I think it's good mesos-ps also report present cpu usage. Therefore, about cpu usage, I choose that mesos-ps only report allocated CPU. I will also leave a TODO comment for CPU usage. - Shingo ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/15200/#review28124 ----------------------------------------------------------- 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 > >
