IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42899


Ignore:
Timestamp:
Jun 18, 2025, 8:13:15 AM (13 months ago)
Author:
eugene
Message:

add reset option to hoststats

Location:
tags/ipp-unions-20250528/Ohana/src/opihi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-unions-20250528/Ohana/src/opihi/pantasks/controller_hoststats.c

    r42897 r42899  
    33int controller_hoststats (int argc, char **argv) {
    44
    5   int status;
     5  int N, status;
    66  char command[1024];
    77  IOBuffer buffer;
     8
     9  int Reset = FALSE;
     10  if ((N = get_argument (argc, argv, "-reset"))) {
     11    remove_argument (N, &argc, argv);
     12    Reset = TRUE;
     13  }
    814
    915  if (argc != 2) {
     
    2127
    2228  // XXX this has an error?  test this out...
    23   sprintf (command, "hoststats %s", argv[1]);
     29  if (Reset) {
     30    sprintf (command, "hoststats %s -reset", argv[1]);
     31  } else {
     32    sprintf (command, "hoststats %s", argv[1]);
     33  }
    2434  InitIOBuffer (&buffer, 0x100);
    2535
  • tags/ipp-unions-20250528/Ohana/src/opihi/pcontrol/hoststats.c

    r42897 r42899  
    33int hoststats (int argc, char **argv) {
    44
    5   int i;
     5  int i, N;
    66  Stack *stack;
    77  Host *host;
    88
     9  int Reset = FALSE;
     10  if ((N = get_argument (argc, argv, "-reset"))) {
     11    remove_argument (N, &argc, argv);
     12    Reset = TRUE;
     13  }
     14
    915  if (argc != 2) {
    10     gprint (GP_ERR, "USAGE: hoststats (stack)\n");
     16    gprint (GP_ERR, "USAGE: hoststats (stack) [-reset]\n");
    1117    gprint (GP_ERR, "       (stack) : all, idle, busy, done, down, off, resp\n");
    1218    return (FALSE);
     
    2632    host = stack[0].object[i];
    2733    gprint (GP_LOG, "%lld %s %d : %f %d %d %d\n", host[0].HostID, host[0].hostname, host[0].pid, host[0].read_time, host[0].read_N_Pclient, host[0].read_N_GetJobOutput, host[0].N_jobs_total);
     34    if (Reset) {
     35      host[0].read_time = 0.0;
     36      host[0].read_N_Pclient = 0;
     37      host[0].read_N_GetJobOutput = 0;
     38      host[0].N_jobs_total = 0;
     39    }
    2840  }
    2941  UnlockStack (stack);
Note: See TracChangeset for help on using the changeset viewer.