Anzeige:
Ergebnis 1 bis 9 von 9

Thema: Resourcenverbrauch eines Prozesses messen von Start bis Ende

  1. #1
    Registrierter Benutzer
    Registriert seit
    Aug 2017
    Beiträge
    15

    Resourcenverbrauch eines Prozesses messen von Start bis Ende

    Hallo,
    ich suche eine Lösung, um den Resourcenverbrauch eines Jobs/Prozesse zu messen. top, ps,etc. kommt nicht in Frage, da hier nur der Verbrauch eines noch laufenden Prozesses gemessen werden kann.
    Gibt es eine Lösung, wo ich ein Messtool mit dem Prozess starten und Stoppen kann. Z.B. eine Kommandokette wie ps -ef;date ? Das Kommando ist zwar Unsinn zeigt aber die Idee.

    Der Hintergrund ist, ich habe eine Grafik die derzeit über gnuplot erzeugt wird und ein Pytonprogramm was das gleiche macht, nun will ich feststellen, welche Version wenige Resourcen verbraucht.

  2. #2
    Registrierter Benutzer
    Registriert seit
    Dec 2003
    Ort
    Dettenhausen
    Beiträge
    22.068
    Code:
    time
    *10Zeichen*
    Ich bin root - ich darf das.

  3. #3
    Registrierter Benutzer
    Registriert seit
    Aug 2017
    Beiträge
    15
    Das gibt ja nur die Laufzeit aus. Unter Resourcenverbrauch verstehe ich CPU,IO,Memory und Laufzeit als Minimum.

  4. #4
    Registrierter Benutzer
    Registriert seit
    Dec 2003
    Ort
    Dettenhausen
    Beiträge
    22.068
    dann schau Dir die man-page nochmals genauer an.
    Ich bin root - ich darf das.

  5. #5
    Registrierter Benutzer
    Registriert seit
    Aug 2017
    Beiträge
    15
    Zitat Zitat von marce Beitrag anzeigen
    dann schau Dir die man-page nochmals genauer an.
    In der Man-Page steht time() returns the time as the number of seconds since the Epoch,
    1970-01-01 00:00:00 +0000 (UTC).

    Ich wiederhole mich ungern, ich will CPU-Verbrauch, IO-Zugriffe, und Speicherverbrauch wissen, und zwar von einem Prozess vom Start bis zum Ende.
    Bei einem IBM-Grossrechner würde ich jetzt die SMF-Sätze auswerten, in welchen diese Daten vermerkt sind.

  6. #6
    Registrierter Benutzer
    Registriert seit
    Dec 2003
    Ort
    Dettenhausen
    Beiträge
    22.068
    Code:
    time(1)                                          General Commands Manual                                          time(1)
    
    NAME
           time - time a simple command or give resource usage
    
    SYNOPSIS
           time [option ...] command [argument ...]
    
    DESCRIPTION
           The  time command runs the specified program command with the given arguments.  When command finishes, time writes
           a message to standard error giving timing statistics about this program run.  These statistics consist of (i)  the
           elapsed real time between invocation and termination, (ii) the user CPU time (the sum of the tms_utime and tms_cu‐
           time  values in a struct tms as returned by times(2)), and (iii) the system CPU time (the sum of the tms_stime and
           tms_cstime values in a struct tms as returned by times(2)).
    
           Note: some shells (e.g., bash(1)) have a built-in time command that provides similar information on the  usage  of
           time  and  possibly  other resources.  To access the real command, you may need to specify its pathname (something
           like /usr/bin/time).
    
    OPTIONS
           -p     When in the POSIX locale, use the precise traditional format
    
                      "real %f\nuser %f\nsys %f\n"
    
                  (with numbers in seconds) where the number of decimals in the output for %f is unspecified  but  is  suffi‐
                  cient to express the clock tick accuracy, and at least one.
    
    EXIT STATUS
           If  command  was invoked, the exit status is that of command.  Otherwise, it is 127 if command could not be found,
           126 if it could be found but could not be invoked, and some other nonzero value (1–125)  if  something  else  went
           wrong.
    
    ENVIRONMENT
           The variables LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, LC_NUMERIC, and NLSPATH are used for the text and formatting of
           the output.  PATH is used to search for command.
    
    GNU VERSION
           Below  a  description  of  the GNU 1.7 version of time.  Disregarding the name of the utility, GNU makes it output
           lots of useful information, not only about time used, but also on other resources like memory, I/O and  IPC  calls
           (where available).  The output is formatted using a format string that can be specified using the -f option or the
           TIME environment variable.
    
           The default format string is:
    
               %Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k
               %Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps
    
           When the -p option is given, the (portable) output format is used:
    
               real %e
               user %U
               sys %S
    
       The format string
           The  format  is  interpreted in the usual printf-like way.  Ordinary characters are directly copied, tab, newline,
           and backslash are escaped using \t, \n, and \\, a percent sign is represented by %%, and otherwise %  indicates  a
           conversion.   The  program  time will always add a trailing newline itself.  The conversions follow.  All of those
           used by tcsh(1) are supported.
    
           Time
    
           %E     Elapsed real time (in [hours:]minutes:seconds).
    
           %e     (Not in tcsh(1).)  Elapsed real time (in seconds).
    
           %S     Total number of CPU-seconds that the process spent in kernel mode.
    
           %U     Total number of CPU-seconds that the process spent in user mode.
    
           %P     Percentage of the CPU that this job got, computed as (%U + %S) / %E.
    
           Memory
    
           %M     Maximum resident set size of the process during its lifetime, in Kbytes.
    
           %t     (Not in tcsh(1).)  Average resident set size of the process, in Kbytes.
    
           %K     Average total (data+stack+text) memory use of the process, in Kbytes.
    
           %D     Average size of the process's unshared data area, in Kbytes.
    
           %p     (Not in tcsh(1).)  Average size of the process's unshared stack space, in Kbytes.
    
           %X     Average size of the process's shared text space, in Kbytes.
    
           %Z     (Not in tcsh(1).)  System's page size, in bytes.  This is a per-system constant, but  varies  between  sys‐
                  tems.
    
           %F     Number  of  major page faults that occurred while the process was running.  These are faults where the page
                  has to be read in from disk.
    
           %R     Number of minor, or recoverable, page faults.  These are faults for pages that are not valid but which have
                  not yet been claimed by other virtual pages.  Thus the data in the page is still valid but the  system  ta‐
                  bles must be updated.
    
           %W     Number of times the process was swapped out of main memory.
    
           %c     Number of times the process was context-switched involuntarily (because the time slice expired).
    
           %w     Number of waits: times that the program was context-switched voluntarily, for instance while waiting for an
                  I/O operation to complete.
    
           I/O
    
           %I     Number of filesystem inputs by the process.
    
           %O     Number of filesystem outputs by the process.
    
           %r     Number of socket messages received by the process.
    
           %s     Number of socket messages sent by the process.
    
           %k     Number of signals delivered to the process.
    
           %C     (Not in tcsh(1).)  Name and command-line arguments of the command being timed.
    
           %x     (Not in tcsh(1).)  Exit status of the command.
    
       GNU options
           -f format, --format=format
                  Specify output format, possibly overriding the format specified in the environment variable TIME.
    
           -p, --portability
                  Use the portable output format.
    
           -o file, --output=file
                  Do not send the results to stderr, but overwrite the specified file.
    
           -a, --append
                  (Used together with -o.) Do not overwrite but append.
    
           -v, --verbose
                  Give very verbose output about all the program knows about.
    
           -q, --quiet
                  Don't report abnormal program termination (where command is terminated by a signal) or nonzero exit status.
    
       GNU standard options
           --help Print a usage message on standard output and exit successfully.
    
           -V, --version
                  Print version information on standard output, then exit successfully.
    
           --     Terminate option list.
    
    BUGS
           Not  all  resources  are  measured  by all versions of UNIX, so some of the values might be reported as zero.  The
           present selection was mostly inspired by the data provided by 4.2 or 4.3BSD.
    
           GNU time version 1.7 is not yet localized.  Thus, it does not implement the POSIX requirements.
    
           The environment variable TIME was badly chosen.  It is not unusual for systems like autoconf(1) or make(1) to  use
           environment  variables  with the name of a utility to override the utility to be used.  Uses like MORE or TIME for
           options to programs (instead of program pathnames) tend to lead to difficulties.
    
           It seems unfortunate that -o overwrites instead of appends.  (That is, the -a option should be the default.)
    
           Mail suggestions and bug reports for GNU time to bug-time@gnu.org.  Please include the version of time, which  you
           can get by running
    
               time --version
    
           and the operating system and C compiler you used.
    
    SEE ALSO
           bash(1), tcsh(1), times(2), wait3(2)
    
    Linux man-pages 6.05                                    2023-07-30                                                time(1)
    IO, Speicher, CPU - alles drin.
    Ich bin root - ich darf das.

  7. #7
    Registrierter Benutzer
    Registriert seit
    Jun 2004
    Beiträge
    1.424
    SMF im Linux == sysstat und dessen Bestandteil sar
    Siehe Doku: https://linuxwiki.de/sar

    Dunkel aus der Erinnerung:
    um 2005, als wir zLinux im Einsatz hatten und arge Troubles mit der Leistung der IFLs,
    kam IBM mit einem RMF-Client für s390x-Plattform um die Ecke.
    Wenn ich mich korrekt entsinne, hat dieser RMF-Client für Linux den sysstat als Datenbasis benutzt.

    Nachtrag:
    evtl. komm es infrage: https://www.ibm.com/docs/en/zos/2.1....rmf-xp#gpm4cim
    Geändert von temir (21.12.23 um 09:28 Uhr)

  8. #8
    Registrierter Benutzer
    Registriert seit
    Dec 2003
    Ort
    Dettenhausen
    Beiträge
    22.068
    sar ist nett, aber AFAIR nicht geeignet, einzelne Prozesse zu monitoren.
    Ich bin root - ich darf das.

  9. #9
    Registrierter Benutzer Avatar von Huhn Hur Tu
    Registriert seit
    Nov 2003
    Ort
    Karlsruhe
    Beiträge
    2.273
    Wie waere es vor das Prozessbeenden einfach ein top oder ps -ef | grep prozess ranzuhaengen, dann hast du schon mal was
    Zwischen anonym sein wollen und seine Daten nicht verkaufen wollen, liegen zwei Welten. Wenn man sich einen kostenpflichtigen Dienst sucht, dann meist, weil man für diese Dienstleistung zahlt und nicht selbst das Produkt sein will.


Ähnliche Themen

  1. PID eines Prozesses ermitteln
    Von Foley im Forum Linux Allgemein
    Antworten: 1
    Letzter Beitrag: 24.02.12, 09:05
  2. IO eines Prozesses loggen
    Von f.hassmann im Forum Anwendungen Allgemein, Software
    Antworten: 10
    Letzter Beitrag: 15.03.09, 10:34
  3. Start- und Endadresse eines Prozesses ausgeben?
    Von deb-oli im Forum Linux Allgemein
    Antworten: 6
    Letzter Beitrag: 04.05.07, 15:43
  4. Speicherverbrauch eines Prozesses ermitteln
    Von SeeksTheMoon im Forum Linux Allgemein
    Antworten: 6
    Letzter Beitrag: 22.02.06, 22:13
  5. Dateizugriffe eines Prozesses
    Von ml im Forum Linux Allgemein
    Antworten: 6
    Letzter Beitrag: 03.06.02, 13:54

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •