18 struct zbuf : std::filebuf
20 void rewind() { std::filebuf::seekpos(0, std::ios_base::out); }
30int main(
int argc,
char **argv)
44 JParser<> zap(
"Auxiliary program to continually monitor processes.");
49 zap[
'n'] =
make_field(prescale,
"pre-scale for logging") = 1000;
55 catch(
const exception &error) {
59 if (process.empty()) {
68 os <<
"ps -o comm= -o pid=";
99 const auto start = chrono::system_clock::now();
111 for (
string buffer;
shell.getline(buffer); ) {
128 ERROR(
"Error reading \"" << buffer <<
"\"" <<
endl);
136 if (count%prescale == 0) {
140 os <<
"top " <<
FIXED(9,1) << chrono::duration<double>(chrono::system_clock::now() - start).count() <<
" [s]" <<
endl;
146 const long int value =
top[*i];
148 os <<
setw(24) << left << *i <<
' ' <<
FIXED(5,3) << (
double) value / (
double) count <<
endl;
153 os <<
setw(24) << left <<
"Total" <<
' ' <<
FIXED(5,3) << (
double) total / (
double) count <<
endl;
std::ostream & rewind(std::ostream &out)
Rewind character.
General purpose messaging.
#define DEBUG(A)
Message macros.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
Shell interaction via I/O streams.
int main(int argc, char **argv)
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
The JShell clas can be used to interact with the shell via I/O streams.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.