|
15 | 15 | # You should have received a copy of the GNU General Public License |
16 | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 |
|
| 18 | +#Notes |
| 19 | + |
| 20 | +#tps: indicate the number of transfers per second that were issued to the device. |
| 21 | +#rd_sec/s: number of sectors read from the device. The size of a sector is 512 bytes. |
| 22 | +#wr_sec/s: number of sectors written to the device. The size of a sector is 512 bytes. |
| 23 | + |
| 24 | +#IOMB = (rd_sec/s + wr_sec/s) * 512 / (1024 * 1024 ) -> MB/s |
| 25 | + |
| 26 | +#Needed for AM/PM in the sar output |
| 27 | +export LC_ALL=en_US.UTF-8 |
| 28 | + |
18 | 29 | #Retrieve os (linux, aix, sunos) |
19 | 30 | inizio=`date` |
20 | 31 | os_system=`uname -a | awk '{print $1}' | tr '[:upper:]' '[:lower:]'` |
@@ -88,18 +99,18 @@ if [ $os_system == 'linux' ] |
88 | 99 | #Array creation |
89 | 100 | dates_array+=($dates_second) |
90 | 101 | tps_array+=(${myarray[0]}) |
91 | | - iomb_array+=($(echo "scale=2;(${myarray[1]}+${myarray[2]})*$sector_size/1024" | bc)) |
| 102 | + iomb_array+=($(echo "scale=2;(${myarray[1]}+${myarray[2]})" | bc)) |
92 | 103 | #Is an average line after the restart line, arrays have to be reinitialized with the current values |
93 | 104 | else |
94 | 105 | (( last_index=${#dates_array[@]}-1 )) |
95 | 106 | tps_array[$last_index]=$(echo "scale=2;${myarray[0]}" | bc) |
96 | | - iomb_array[$last_index]=$(echo "scale=2;(${myarray[1]}+${myarray[2]})*$sector_size/1024" | bc) |
| 107 | + iomb_array[$last_index]=$(echo "scale=2;(${myarray[1]}+${myarray[2]})" | bc) |
97 | 108 | fi |
98 | 109 | else |
99 | 110 | #Other lines to be summarized to the initialized line |
100 | 111 | (( last_index=${#dates_array[@]}-1 )) |
101 | 112 | tps_array[$last_index]=$(echo "scale=2;${tps_array[$last_index]}+${myarray[0]}" | bc) |
102 | | - iomb_array[$last_index]=$(echo "scale=2;${iomb_array[$last_index]}+((${myarray[1]}+${myarray[2]})*$sector_size/1024)" | bc) |
| 113 | + iomb_array[$last_index]=$(echo "scale=2;${iomb_array[$last_index]}+((${myarray[1]}+${myarray[2]}))" | bc) |
103 | 114 | fi |
104 | 115 | fi |
105 | 116 | done |
@@ -129,7 +140,7 @@ if [ $os_system == 'linux' ] |
129 | 140 | hour_column="${myarray[0]}" |
130 | 141 | ampm_column="${myarray[1]}" |
131 | 142 | tps_column="${myarray[2]}" |
132 | | - iomb_column=$(echo "scale=2;(${myarray[3]}+${myarray[4]})*$sector_size/1024" | bc) |
| 143 | + iomb_column=$(echo "scale=2;(${myarray[3]}+${myarray[4]})" | bc) |
133 | 144 | #Current line datetime in seconds |
134 | 145 | current_line_datetime=(`date -d "$file_date $hour_column$ampm_column" +%s`) |
135 | 146 | #if last element datetime = current element datetime -> sum tps and iomb (two or more different disks -> sum values) |
|
0 commit comments