Advertisement
ChrRaible

performance-skript

Aug 23rd, 2011
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.50 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #########################################
  4. #                                       #
  5. # Performance-Skript zum erstellen der  #
  6. #          Performance Tests            #
  7. #                                       #
  8. #########################################
  9.  
  10.  
  11.  
  12. DATE=`/bin/date +%Y%m%d-%H%M`                                               # Datum zur Dokumentation
  13. LOG_DIR=/root/performancetest_$DATE                                             # Speicherort der LOG-Dateien
  14. DIR=/srv/cloud                                                                  # Ort zum durchfuehren der Performance-Tests
  15. MKLOG_DIR=`mkdir -p $LOG_DIR`                                                   # Erstellen des LOG-Verzeichnisses
  16. RAM_SIZE=`free -m | grep 'Mem:' | awk '{print $2}'`                             # ermittelt die RAM-Groesse
  17. SIZE=$(echo "scale=0;`free -m | grep 'Mem:' | awk '{print $2}'`*2" | bc -l)   # Verdoppelt die RAM-Groesse
  18. HINWEISE=phys_moosefs_1_szenario4                                               # Hinweise fuer die performancetests
  19. echo "$HINWEISE" >> $LOG_DIR/info.txt
  20.  
  21.  
  22. echo "Startzeit des Skirpts: " `/bin/date +%Y%m%d-%H:%M:%S` >> $LOG_DIR/info.txt
  23. echo "RAM groesse: " $RAM_SIZE >> $LOG_DIR/info.txt
  24. echo "Dateigroesse: " $SIZE >> $LOG_DIR/info.txt
  25.  
  26.  
  27. # Bonnie++
  28. echo "### Bonnie gestartet: " `/bin/date +%H:%M:%S` >> $LOG_DIR/info.txt
  29. bonnie++ -n 10 -u 0 -r $RAM_SIZE -s $SIZE -d $DIR -q | bon_csv2html > $LOG_DIR/resultat-$DATE.html
  30. echo "### Bonnie gestopt: " `/bin/date +%H:%M:%S` >> $LOG_DIR/info.txt
  31.  
  32.  
  33. # dd-Sync
  34. echo "### dd-sync gestartet: " `/bin/date +%H:%M:%S` >> $LOG_DIR/info.txt
  35. dd if=/dev/zero of=$DIR/test bs=1024000 count=$SIZE oflag=sync &> $LOG_DIR/dd_sync_$DATE.log
  36. echo "### dd-sync gestopt: " `/bin/date +%H:%M:%S` >> $LOG_DIR/info.txt
  37. rm -rf $DIR/test
  38. echo "dd-sync-Datei geloescht" >> $LOG_DIR/info.txt
  39.  
  40. # dd-Direct
  41. echo "### dd-direct gestartet: " `/bin/date +%H:%M:%S` >> $LOG_DIR/info.txt
  42. dd if=/dev/zero of=$DIR/test bs=1024000 count=$SIZE oflag=direct &> $LOG_DIR/dd_direct_$DATE.log
  43. echo "### dd-direct gestopt: " `/bin/date +%H:%M:%S` >> $LOG_DIR/info.txt
  44. rm -rf $DIR/test # Datei loeschen
  45. echo "dd-direct-Datei geloescht" >> $LOG_DIR/info.txt
  46.  
  47. echo "Endzeit des Skirpts: " `/bin/date +%Y%m%d-%H:%M:%S` >> $LOG_DIR/info.txt
  48.  
  49. # Erstellte Dateien löschen
  50. rm -rf $DIR/test
  51.  
  52.  
  53. # Paket erstellen und an Desktoprechner senden
  54. cd $LOG_DIR
  55. tar cfvz /root/performance_$HINWEISE.tar.gz *
  56. scp performance_$HINWEISE.tar.gz chraible@10.10.16.94:/home/chraible/Desktop/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement