Changeset 253

Show
Ignore:
Timestamp:
12/19/06 14:49:17 (2 years ago)
Author:
sacha
Message:

run statistics is more generic
command center supports individual b2bparties and cpas for dynamic directive creation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/message-handling-refactor-branch/bin/run-command-center.rb

    r248 r253  
    126126 
    127127def short_info_structure info_structure 
    128   sprintf("ackReg: %1$*2$s syncReply: %3$*4$s dup: %5$*2$s prot: %7$*2$s end: %9$*2$s", info_structure['info']['mc-ackRequested'], 6, info_structure['info']['mc-syncReplyMode'], 14, info_structure['info']['mc-duplicateElimination'], 6, info_structure['info']['transport-protocol-name'], 11, info_structure['info']['transport-protocol-endpoint'] ) 
     128  sprintf("ackReg: %1$*2$s ackSigReg: %3$*2$s syncReply: %5$*4$s dup: %7$*2$s prot: %9$*2$s end: %11$*2$s", info_structure['info']['mc-ackRequested'], 6, info_structure['info']['mc-ackSignatureRequested'], 6, info_structure['info']['mc-syncReplyMode'], 14, info_structure['info']['mc-duplicateElimination'], 6, info_structure['info']['transport-protocol-name'], 11, info_structure['info']['transport-protocol-endpoint'] ) 
    129129end 
    130130 
     
    163163      end 
    164164    when "S" 
    165       output = %x(sh ./run-statistics.sh
     165      output = %x(sh ./run-statistics.sh "#{party_name}"
    166166    when "C" 
    167167      command = "sh ./run-clear-system.sh" 
     
    258258      number_directives = work_directive_dynamic_menu party_name, cpas_info, number_directives 
    259259    when "S" 
    260       output = %x(sh ./run-statistics.sh
     260      output = %x(sh ./run-statistics.sh Coronation Gnaraloo
    261261    when "1" 
    262262      command = "sh ./run-copy-ping-directive-n.sh #{number_directives || 1} &" 
     
    385385    when "S" 
    386386      puts "Statistics" 
    387       output = %x(sh ./run-statistics.sh
     387      output = %x(sh ./run-statistics.sh Coronation Gnaraloo
    388388    when "D" 
    389389      system "clear" 
  • branches/message-handling-refactor-branch/bin/run-statistics.sh

    r225 r253  
    1919echo -n " total: " 
    2020ls -A /var/run/hefeweizen/tmp/ | wc -l 
    21 echo 
    22 echo -n "Coronation number ebXML messages : " 
    23 ls -A $MESSAGE_DIR/Coronation | wc -l 
    24 echo -n "Coronation number conversations  : " 
    25 ls -A $CONVERSATION_DIR/Coronation | wc -l 
    26 echo -n "Coronation outgoing directives   : " 
    27 ls -A $SPOOL_DIR/coronation/outgoing/directives | wc -l 
    28 echo -n "Coronation incoming directives   : " 
    29 ls -A $SPOOL_DIR/coronation/incoming/directives | wc -l 
    30 echo -n "Coronation incoming payloads     : " 
    31 ls -A $SPOOL_DIR/coronation/incoming/payloads | wc -l 
    32 echo -n "Coronation errors                : " 
    33 ls -A $SPOOL_DIR/coronation/errors | wc -l 
    34 echo 
    35 echo -n "Gnaraloo number ebXML messages   : " 
    36 ls -A $MESSAGE_DIR/Gnaraloo | wc -l 
    37 echo -n "Gnaraloo number conversations    : " 
    38 ls -A $CONVERSATION_DIR/Gnaraloo | wc -l 
    39 echo -n "Gnaraloo outgoing directives     : " 
    40 ls -A $SPOOL_DIR/gnaraloo/outgoing/directives | wc -l 
    41 echo -n "Gnaraloo incoming directives     : " 
    42 ls -A $SPOOL_DIR/gnaraloo/incoming/directives | wc -l 
    43 echo -n "Gnaraloo incoming payloads       : " 
    44 ls -A $SPOOL_DIR/gnaraloo/incoming/payloads | wc -l 
    45 echo -n "Gnaraloo errors                  : " 
    46 ls -A $SPOOL_DIR/gnaraloo/errors | wc -l 
    47 echo 
     21echo '------------------------' 
    4822 
     23 
     24info_states_of_messages() 
     25{ 
     26 
     27    party=$1 
     28    search=$2 
     29    search_text=$3 
     30    total_delivered=0 
     31    total_failed=0 
     32    total_received=0 
     33    total_sent=0 
     34    total_failed_to_send=0 
     35    for i in $(find $MESSAGE_DIR/$party/ -name "$search" -printf "%h\n" ); do 
     36 
     37        delivered=$(find $i -name "state__delivered" -print | wc -l) 
     38        let total_delivered=$total_delivered+$delivered 
     39        failed=$(find $i -name "state__failed" -print | wc -l) 
     40        let total_failed=$total_failed+$failed 
     41        received=$(find $i -name "state__received" -print | wc -l) 
     42        let total_received=$total_received+$received 
     43        sent=$(find $i -name "state__sent" -print | wc -l) 
     44        let total_sent=$total_sent+$sent 
     45        failed_to_send=$(find $i -name "state__failed_to_send" -print | wc -l) 
     46        let total_failed_to_send=$total_faild_to_send+$failed_to_send 
     47    done 
     48    echo -n "              # delivered $search_text      : " 
     49    echo $total_delivered 
     50    echo -n "              # failed $search_text         : " 
     51    echo $total_failed 
     52    echo -n "              # received $search_text       : " 
     53    echo $total_received 
     54    echo -n "              # sent $search_text           : " 
     55    echo $total_sent 
     56    echo -n "              # failed_to_send $search_text : " 
     57    echo $total_failed_to_send 
     58} 
     59 
     60info_party() 
     61{ 
     62    party=$1 
     63    echo -n "$party number ebXML messages : " 
     64    ls -A $MESSAGE_DIR/$party | wc -l 
     65     
     66    echo -n "      # user ebXML messages      : " 
     67    find $MESSAGE_DIR/$party/ -name "is_user_message" -print | wc -l 
     68    info_states_of_messages $party "is_user_message" "user ebXML message" 
     69     
     70    echo -n "      # signal ebXML messages    : " 
     71    find $MESSAGE_DIR/$party/ -name "is_ebMS_signal" -print | wc -l 
     72    info_states_of_messages $party "is_ebMS_signal" "signal ebMS message" 
     73     
     74    echo -n "$party number conversations  : " 
     75    ls -A $CONVERSATION_DIR/$party | wc -l 
     76    echo -n "$party outgoing directives   : " 
     77    ls -A $SPOOL_DIR/coronation/outgoing/directives | wc -l 
     78    echo -n "$party incoming directives   : " 
     79    ls -A $SPOOL_DIR/coronation/incoming/directives | wc -l 
     80    echo -n "$party incoming payloads     : " 
     81    ls -A $SPOOL_DIR/coronation/incoming/payloads | wc -l 
     82    echo -n "$party errors                : " 
     83    ls -A $SPOOL_DIR/coronation/errors | wc -l 
     84    echo 
     85} 
     86 
     87for i in $* ; do 
     88    info_party $i 
     89done 
     90 
     91 
     92 
     93