Xcssr Catia Session Statistics Report

written by M.Liberi

26 Ottobre 1999

Michele Liberi
cell: 3400833493
email: mliberi@gmail.com
Xcssr
Catia Session Statistics Report

Indice

  • Descrizione generale
  • Descrizione delle componenti
  • installazione e configurazione
  • formato file statistiche ridotto
  • Licensing


    Descrizione generale

    Questo pacchetto permette all'amministratore di un gruppo di stazioni di lavoro CATIA in ambiente AIX di ottenere informazioni sull'effettivo utilizzo delle stazioni.

    L'interfaccia utente del pacchetto è il programma Xcssr che è in grado di generare quattro tipi di grafici a video o in formato stampante (HPGL,PostScript,etc.), o il programma cpug che è in grado di visualizzare graficamente i soli dati di sistema.

    La raccolta dei dati di sistema avviene, su ogni stazione, per mezzo del programma cpudc che normalmente dovrà essere attivato alla partenza della macchina e rimarrà sempre attivo. Esso genera tre files contenenti

    La raccolta dei dati relativi alle attività del CATIA avviene, su ogni stazione, a cura del CATIA stesso che si avrà cura di configurare attivando i seguenti parametri:

    STAT_DIR   = '/tmp';
    CATIA.STAT_FILE  = 'stat';/* /tmp/stat.account will be generated */
    CATIA.STATISTICS = TRUE  ;
    CATIA.VISU_STAT  = TRUE  ;
    CATIA.DURATION_STAT   =    5; /* min. */
    CATIA.MAX_TABLES_STAT = 1500; /* max number of interactions */
    

    Poiché il CATIA genera dei file enormi è opportuno estrarre da essi i soli dati che potranno essere visualizzati. Tale operazione viene fatta dal programma cssr che genera un file circa cento volte più piccolo del file originale.

    Tutti i dati così raccolti dovranno essere messi in un'unica directory che costituisce il database di riferimento per il programma di visualizzazione e stampa.


    Descrizione delle componenti

    Ogni componente del pacchetto, se attivato con l'opzione -h, genera una schermata che ne spiega la funzione e gli eventuali parametri di configurazione.

    I componenti del pacchetto sono:


    installazione e configurazione

    Il pacchetto è in formato tar compresso, per estrarne il contenuto dare il comando:

    gzip -dc Xcssr.tgz | tar xvpf -
    

    I file kce e kcr dovranno essere copiati nella directory /bin come utente root

    cp -p kce kcr /bin
    

    Ogni macchina di cui si vorranno visualizzare i dati deve essere predisposta alla raccolta degli stessi tramite l'inserimento nel file /etc/inittab della riga che fa partire il comando cpudc, e tramite opportuna configurazione del CATIA affinché generi il file di statistiche.

    Ogni macchina dovrà poi alimentare con i propri dati il database da cui il comando Xcssr andrà a leggerli. Consiglio di inserire nel crontab di root il lancio di una procedura che, a intervalli di tempo regolari, copia i dati raccolti nel DB.

    Se, ad esempio, il file generato da CATIA è /tmp/stat.account ed il file generato da cpudc è /tmp/cpudc.dat, ed il database è nella directory (nfs?) /archivio/Xcssr.db, ogni macchina dovrà eseguire i seguenti comandi:

    cp -p /tmp/cpudc.dat /archivio/Xcssr.db/$(hostname).cpudc.dat
    cssr -E /archivio/Xcssr.db/$(hostname).cssr.dat /tmp/stat.account
    

    formato file statistiche ridotto

    Il file di statistiche generato da CATIA tende rapidamente a diventare enorme e quindi ingestibile. Ciò mi ha indotto a progettare un sistema di estrazione che producesse un file molto più compatto e che contenesse tuttavia tutte le informazioni utili per la generazione dei grafici gestiti da questo pacchetto.

    L'operazione di estrazione, che si attua tramite il comando cssr chiamato con l'opzione -e o -E genera un file con il seguente formato:

    I primi quattro byte contengono un numero fisso (magic number) che permette il riconoscimento del file da parte del programma cssr. Modificando opportunamente il file di sistema /etc/magic il comando file riconoscerà il formato.

    0	long	0x21222324	compressed CATIA statistics file
    

    Segue una lista di sessioni ognuna formata da una testata ed un numero arbitrario di rilevamenti, il cui numero è scritto nella testata.

    Il tracciato record della testata è il seguente (C syntax):

    struct
    {
      byte      username[8],
                account[8],
                hostname[3];
      float     punto_medio,
                ampiezza;
      longword  onwork,
                elapsed,
                DDTnum;
    }
    
    mentre il tracciato record di ogni singolo rilevamento è il seguente:
    struct
    {
      byte      PF[12];      /* PRODUCT+FUNCTION */
      longword  T3_T2;       /* T3-T2            */
    }
    

    I campi username, account, hostname sono, rispettivamente, il nome dell'utente che ha attivato la sessione, il valore della variabile 'CATIA.ACCOUNT_NUMBER' della sessione, ed infine i primi tre caratteri del 'hostname' sul quale la sessione è stata attivata.

    I campi punto_medio, ampiezza servono a posizionare nel tempo la sessione. Entrambi sono espressi in numero di giorni dal 1/1/1996.

    I campi onwork,elapsed sono dati consuntivi non presenti nel file di statistiche generato da CATIA. Sono calcolati come somma dei tempi rilevati per ogni singola chiamata a funzione. onwork è il tempo di elaborazione puro, elapsed è invece la durata effettiva. L'unità di misura è il centesimo dei secondo.

    Il campo DDTnum indica semplicemente il numero di chiamate a funzione effettuate nella sessione.

    Il campo PF contiene il nome del prodotto (4 bytes), e della funzione attivata (8 bytes).

    Il campo T3_T2 è il tempo di elaborazione puro della funzione, espresso in centesimi di secondo.


    Licensing

    End-User Agreement

    Software Products: Michele Liberi programs and accompanying documentation "Freeware".

    Licensor: Michele Liberi, Viale Roma 6, Battaglia Terme (PD), Italy.

    This is a legal agreement between you, an end user, and licensor.

    By downloading and installing the freeware, you are agreeing to be bound by the terms of this agreement. If you do not agree to the terms of this agreement, do not install this freeware and delete any copies of the freeware that you have downloaded.

    This freeware is provided to you free of charge for both commercial and non-commercial purposes. Obtaining a license to this freeware from any party other than licensor and/or paying a fee for such license is strictly forbidden. If you are aware of any unauthorized third party distributing this freeware and/or charging a fee for this freeware, please report such violations to your consumer protection authorities.

    Distribution on internet and CD-ROM

    1. The Licensor grants you the right to make this freeware available on an internet site for the purpose of downloading, as long as NO FEE IS CHARGED for said download.
    2. The Licensor grants you the royalty-free right to reproduce and distribute this freeware as part of a CD-ROM to be enclosed with the print issue of any magazine, book or printed publication, as long as said CD-ROM and printed publication contain material that would have been distributed regardless of the inclusion of this freeware, and NO EXTRA FEE IS CHARGED for inclusion of this freeware.

    License terms and conditions

    1. Grant of license

      This Agreement permits you to use one copy of the Freeware acquired with this license on any single computer ("License") for both commercial and non-commercial purposes, provided the Freeware is in use on only one computer at any given time. The Freeware is "in use" on a computer when it is loaded into the temporary memory or installed into the permanent memory (e.g. hard disk, CD ROM, or other storage device) of that computer, except that a copy installed on a network server for the sole purpose of distribution to other computers is not considered "in use".

    2. Copyright

      The Freeware is owned by Licensor and is protected by copyright laws, international treaty provisions, and other national laws. You agree that you have no right, title or interest in the Freeware, except as set forth in Subsection I.

    3. Other restrictions

      You may not rent, lease, sell or transfer the Freeware to any third party. You may not reverse engineer, decompile or disassemble the Freeware.

    4. Warranties

      You acknowledge that you have licensed this freeware free of charge and that licensor makes no warranties to you in connection with this license, including but not limited to implied warranties of merchantability, fitness for a particular purpose, title, non-infringement and legality in your country. You agree to defend, indemnify and hold harmless licensor from any and all claims of infringement (including those made by third parties) resulting in whole or in part from your use of the freeware.

    5. No liability for consequential damages

      In no event shall Licensor be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the Freeware, even if Licensor has been advised of the possibility of such damages.

    6. Governing Law

      This Agreement shall be governed by and interpreted in accordance with the laws of Italy. If any dispute shall arise pursuant to any provision of this Agreement, said dispute shall be settled by binding arbitration in accordance with the rules and regulations of the courts, located in Italy. If any term or provision of this Agreement shall be declared invalid in arbitration or by a court of competent jurisdiction, such invalidity shall be limited solely to the specific term or provision invalidated, and the remainder of this Agreement shall remain in full force and effect, according to its terms. Any provision declared invalid shall be modified to the fullest extent possible to reflect the parties intent as of the Effective Date.

    Copyright © M.Liberi. All rights reserved.