Counting average data per hour


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Counting average data per hour
# 1  
Old 11-18-2009
Question Counting average data per hour

Hi i have log like this :

Quote:
DATE TIME PID PROCNAME %CPU %MEM TIME VIRTUAL RSS PARTITION %PCPU
20091116 07:02:03+0800 4714 "pmain" 12.90 2.20 29 479240 377040 8 8.00
20091116 07:02:03+0800 8540 "pmain" 32.60 8.70 540860 1720080 1445024 4 18.00
20091116 07:02:03+0800 4662 "pmain" 14.50 2.10 34 450632 348404 3 18.00
20091116 07:02:03+0800 8506 "pmain" 33.00 9.10 547392 1830624 1503204 2 26.00
20091116 07:02:03+0800 8625 "pmain" 29.10 9.80 483171 1955684 1623576 7 20.00
20091116 07:02:03+0800 8609 "pmain" 28.80 10.00 478034 1953236 1645080 6 18.00
20091116 07:02:03+0800 8591 "pmain" 29.50 9.10 490552 1768436 1497036 5 20.00
20091116 07:02:03+0800 8488 "pmain" 32.50 12.80 539583 2879744 2110508 1 26.00
20091116 07:07:29+0800 4714 "pmain" 14.10 2.40 78 496796 394676 8 12.00
20091116 07:07:29+0800 8540 "pmain" 32.60 8.70 540917 1720084 1445600 4 20.00
20091116 07:07:29+0800 4662 "pmain" 15.00 2.20 84 472412 370272 3 22.00
20091116 07:07:29+0800 8506 "pmain" 33.00 9.10 547465 1830624 1505548 2 22.00
20091116 07:07:29+0800 8625 "pmain" 29.10 9.80 483228 1955684 1623996 7 18.00
20091116 07:07:29+0800 8609 "pmain" 28.80 10.00 478089 1953236 1645448 6 22.00
20091116 07:07:29+0800 8591 "pmain" 29.50 9.10 490627 1768436 1499784 5 28.00
20091116 07:07:29+0800 8488 "pmain" 32.50 12.80 539645 2879744 2113972 1 26.00
20091116 07:12:56+0800 4714 "pmain" 13.80 2.40 122 504724 402604 8 14.00
20091116 07:12:56+0800 8540 "pmain" 32.60 8.70 540974 1720080 1446608 4 24.00
20091116 07:12:56+0800 4662 "pmain" 16.30 2.30 145 490976 388860 3 22.00
20091116 07:12:56+0800 8506 "pmain" 33.00 9.10 547533 1830624 1506236 2 22.00
20091116 07:12:56+0800 8625 "pmain" 29.10 9.80 483291 1955684 1626520 7 20.00
20091116 07:12:56+0800 8609 "pmain" 28.80 10.00 478146 1953236 1647336 6 30.00
20091116 07:12:56+0800 8591 "pmain" 29.50 9.10 490710 1768436 1500456 5 30.00
20091116 07:12:56+0800 8488 "pmain" 32.50 12.90 539707 2879744 2124224 1 20.00
20091116 07:18:22+0800 4714 "pmain" 13.90 2.50 168 519220 417100 8 12.00
20091116 07:18:22+0800 8540 "pmain" 32.60 8.80 541032 1720080 1448264 4 12.00
20091116 07:18:22+0800 4662 "pmain" 17.20 2.50 209 516740 414624 3 18.00
20091116 07:18:22+0800 8506 "pmain" 33.00 9.10 547593 1830624 1508280 2 20.00
20091116 07:18:22+0800 8625 "pmain" 29.10 9.90 483354 1955684 1628704 7 16.00
20091116 07:18:22+0800 8609 "pmain" 28.80 10.00 478203 1953240 1647740 6 20.00
20091116 07:18:22+0800 8591 "pmain" 29.50 9.10 490783 1768436 1500840 5 20.00
20091116 07:18:22+0800 8488 "pmain" 32.50 12.90 539772 2879744 2125324 1 14.00
20091116 07:23:49+0800 4714 "pmain" 14.10 2.60 217 545180 443060 8 18.00
20091116 07:23:49+0800 8540 "pmain" 32.60 8.80 541091 1720080 1452100 4 10.00
20091116 07:23:49+0800 4662 "pmain" 18.00 2.50 278 519140 417024 3 18.00
20091116 07:23:49+0800 8506 "pmain" 33.00 9.20 547668 1830624 1519648 2 24.00
20091116 07:23:49+0800 8625 "pmain" 29.10 9.90 483412 1955684 1629092 7 22.00
20091116 07:23:49+0800 8609 "pmain" 28.80 10.00 478265 1953236 1650124 6 24.00
20091116 07:23:49+0800 8591 "pmain" 29.50 9.10 490863 1768436 1501996 5 30.00
20091116 07:23:49+0800 8488 "pmain" 32.50 12.90 539837 2879744 2125932 1 24.00
20091116 07:29:16+0800 4714 "pmain" 14.40 2.70 268 557012 454892 8 14.00
20091116 07:29:16+0800 8540 "pmain" 32.60 8.80 541150 1720080 1452576 4 18.00
20091116 07:29:16+0800 4662 "pmain" 18.30 2.50 342 521832 419704 3 14.00
20091116 07:29:16+0800 8506 "pmain" 33.00 9.20 547732 1830624 1522164 2 22.00
20091116 07:29:16+0800 8625 "pmain" 29.10 9.90 483479 1955684 1629788 7 18.00
20091116 07:29:16+0800 8609 "pmain" 28.80 10.00 478328 1953236 1650576 6 18.00
20091116 07:29:16+0800 8591 "pmain" 29.50 9.10 490942 1768436 1502396 5 20.00
20091116 07:29:16+0800 8488 "pmain" 32.50 12.90 539904 2879744 2126396 1 20.00
20091116 07:34:43+0800 4714 "pmain" 14.70 2.70 322 559676 457548 8 14.00
20091116 07:34:43+0800 8540 "pmain" 32.60 8.80 541206 1720080 1453252 4 16.00
20091116 07:34:43+0800 4662 "pmain" 18.50 2.50 406 523552 421436 3 18.00
20091116 07:34:43+0800 8506 "pmain" 33.00 9.20 547799 1830624 1522616 2 20.00
20091116 07:34:43+0800 8625 "pmain" 29.10 9.90 483551 1955684 1632728 7 26.00
20091116 07:34:43+0800 8609 "pmain" 28.80 10.00 478384 1953236 1651504 6 10.00
20091116 07:34:43+0800 8591 "pmain" 29.50 9.10 491010 1768436 1503956 5 12.00
20091116 07:34:43+0800 8488 "pmain" 32.50 12.90 539965 2879744 2127016 1 22.00
20091116 07:40:10+0800 4714 "pmain" 14.50 2.70 367 560724 458604 8 16.00
20091116 07:40:10+0800 8540 "pmain" 32.60 8.80 541263 1720080 1453848 4 14.00
20091116 07:40:10+0800 4662 "pmain" 19.10 2.50 482 527980 425860 3 22.00
20091116 07:40:10+0800 8506 "pmain" 33.00 9.20 547879 1830624 1524060 2 28.00
20091116 07:40:10+0800 8625 "pmain" 29.10 9.90 483631 1955684 1634968 7 24.00
20091116 07:40:10+0800 8609 "pmain" 28.80 10.00 478447 1953236 1652552 6 28.00
20091116 07:40:10+0800 8591 "pmain" 29.50 9.10 491076 1768436 1505156 5 26.00
20091116 07:40:10+0800 8488 "pmain" 32.50 12.90 540026 2879744 2132852 1 20.00
20091116 07:45:37+0800 4714 "pmain" 14.70 2.80 420 567884 465764 8 26.00
20091116 07:45:37+0800 8540 "pmain" 32.60 8.80 541320 1720080 1454600 4 18.00
20091116 07:45:37+0800 4662 "pmain" 19.60 2.70 559 553112 450996 3 24.00
20091116 07:45:37+0800 8506 "pmain" 33.00 9.20 547952 1830624 1524552 2 28.00
20091116 07:45:37+0800 8625 "pmain" 29.10 9.90 483704 1955684 1635548 7 26.00
20091116 07:45:37+0800 8609 "pmain" 28.80 10.00 478504 1953236 1656048 6 18.00
20091116 07:45:37+0800 8591 "pmain" 29.50 9.10 491156 1768436 1505612 5 22.00
20091116 07:45:37+0800 8488 "pmain" 32.50 13.00 540094 2879744 2140032 1 16.00
20091116 07:51:04+0800 4714 "pmain" 14.80 2.90 472 580932 478812 8 18.00
20091116 07:51:04+0800 8540 "pmain" 32.50 8.80 541378 1720080 1455468 4 16.00
20091116 07:51:04+0800 4662 "pmain" 19.90 2.80 634 563236 461120 3 20.00
20091116 07:51:04+0800 8506 "pmain" 32.90 9.20 548037 1830624 1524872 2 18.00
20091116 07:51:04+0800 8625 "pmain" 29.10 9.90 483772 1955684 1635888 7 18.00
20091116 07:51:04+0800 8609 "pmain" 28.80 10.00 478553 1953236 1656496 6 16.00
20091116 07:51:04+0800 8591 "pmain" 29.50 9.10 491230 1768436 1505984 5 26.00
20091116 07:51:04+0800 8488 "pmain" 32.50 13.00 540160 2879744 2140716 1 18.00
20091116 07:56:31+0800 4714 "pmain" 15.00 3.00 528 596232 494112 8 18.00
20091116 07:56:31+0800 8540 "pmain" 32.50 8.80 541442 1720080 1456044 4 16.00
20091116 07:56:31+0800 4662 "pmain" 20.10 2.80 706 564672 462556 3 22.00
20091116 07:56:31+0800 8506 "pmain" 32.90 9.20 548105 1830624 1525284 2 20.00
20091116 07:56:31+0800 8625 "pmain" 29.10 9.90 483839 1955684 1636044 7 16.00
20091116 07:56:31+0800 8609 "pmain" 28.80 10.00 478609 1953236 1657272 6 14.00
20091116 07:56:31+0800 8591 "pmain" 29.50 9.10 491315 1768436 1507324 5 20.00
20091116 07:56:31+0800 8488 "pmain" 32.50 13.00 540234 2879744 2142120 1 18.00
20091116 08:01:59+0800 4714 "pmain" 15.10 3.00 581 598176 496052 8 14.00
20091116 08:01:59+0800 8540 "pmain" 32.50 8.80 541498 1720080 1456864 4 24.00
20091116 08:01:59+0800 4662 "pmain" 20.40 2.80 782 567028 464912 3 18.00
20091116 08:01:59+0800 8506 "pmain" 32.90 9.20 548173 1830624 1525668 2 24.00
20091116 08:01:59+0800 8625 "pmain" 29.10 9.90 483914 1955684 1636308 7 20.00
20091116 08:01:59+0800 8609 "pmain" 28.80 10.00 478661 1953236 1657592 6 14.00
20091116 08:01:59+0800 8591 "pmain" 29.50 9.10 491396 1768436 1507588 5 30.00
20091116 08:01:59+0800 8488 "pmain" 32.50 13.00 540308 2879744 2149348 1 18.00
20091116 08:07:26+0800 4714 "pmain" 15.30 3.00 635 599668 497548 8 16.00
20091116 08:07:26+0800 8540 "pmain" 32.50 8.80 541564 1720080 1460900 4 28.00
20091116 08:07:26+0800 4662 "pmain" 21.00 2.80 875 575124 473008 3 28.00
20091116 08:07:26+0800 8506 "pmain" 32.90 9.20 548246 1830624 1526284 2 28.00
20091116 08:07:26+0800 8625 "pmain" 29.10 9.90 483983 1955684 1636740 7 24.00
20091116 08:07:26+0800 8609 "pmain" 28.80 10.00 478713 1953236 1658356 6 14.00
20091116 08:07:26+0800 8591 "pmain" 29.50 9.10 491475 1768436 1507824 5 24.00
20091116 08:07:26+0800 8488 "pmain" 32.50 13.10 540386 2879744 2166100 1 24.00
20091116 08:12:54+0800 4714 "pmain" 15.50 3.00 696 608324 506204 8 16.00
20091116 08:12:54+0800 8540 "pmain" 32.50 8.90 541626 1720080 1464580 4 18.00
20091116 08:12:54+0800 4662 "pmain" 21.40 2.90 962 589692 487576 3 30.00
20091116 08:12:54+0800 8506 "pmain" 32.90 9.30 548317 1830624 1532780 2 18.00
20091116 08:12:54+0800 8625 "pmain" 29.10 9.90 484053 1955684 1638436 7 22.00
20091116 08:12:54+0800 8609 "pmain" 28.80 10.00 478766 1953236 1659132 6 18.00
20091116 08:12:54+0800 8591 "pmain" 29.50 9.10 491562 1768436 1508900 5 32.00
20091116 08:12:54+0800 8488 "pmain" 32.50 13.10 540466 2879744 2167496 1 26.00
20091116 08:18:21+0800 4714 "pmain" 15.50 3.10 749 612184 510064 8 16.00
20091116 08:18:21+0800 8540 "pmain" 32.50 8.90 541684 1720080 1468172 4 14.00
20091116 08:18:21+0800 4662 "pmain" 21.50 2.90 1038 590796 488680 3 28.00
20091116 08:18:21+0800 8506 "pmain" 32.90 9.30 548391 1830624 1533416 2 16.00
20091116 08:18:21+0800 8625 "pmain" 29.10 9.90 484127 1955684 1641360 7 20.00
20091116 08:18:21+0800 8609 "pmain" 28.80 10.00 478830 1953236 1659384 6 16.00
20091116 08:18:21+0800 8591 "pmain" 29.50 9.10 491644 1768436 1509564 5 22.00
20091116 08:18:21+0800 8488 "pmain" 32.50 13.20 540555 2879744 2185840 1 18.00
20091116 08:23:49+0800 4714 "pmain" 15.70 3.10 809 613504 511384 8 20.00
20091116 08:23:49+0800 8540 "pmain" 32.50 8.90 541744 1720080 1468776 4 20.00
20091116 08:23:49+0800 4662 "pmain" 21.80 3.00 1124 609120 507004 3 26.00
20091116 08:23:49+0800 8506 "pmain" 32.90 9.30 548466 1830624 1534688 2 18.00
20091116 08:23:49+0800 8625 "pmain" 29.10 9.90 484200 1955684 1641696 7 22.00
20091116 08:23:49+0800 8609 "pmain" 28.80 10.00 478897 1953236 1660068 6 22.00
20091116 08:23:49+0800 8591 "pmain" 29.50 9.10 491721 1768436 1512688 5 22.00
20091116 08:23:49+0800 8488 "pmain" 32.50 13.30 540635 2879744 2190664 1 22.00
20091116 08:29:18+0800 4714 "pmain" 15.80 3.10 865 614372 512252 8 12.00
20091116 08:29:18+0800 8540 "pmain" 32.50 8.90 541809 1720080 1472264 4 12.00
20091116 08:29:18+0800 4662 "pmain" 22.10 3.10 1210 613864 511748 3 28.00
20091116 08:29:18+0800 8506 "pmain" 32.90 9.30 548538 1830624 1535508 2 28.00
20091116 08:29:18+0800 8625 "pmain" 29.10 9.90 484269 1955684 1642012 7 36.00
20091116 08:29:18+0800 8609 "pmain" 28.80 10.10 478969 1953236 1665520 6 30.00
20091116 08:29:18+0800 8591 "pmain" 29.50 9.20 491810 1768436 1513796 5 20.00
20091116 08:29:18+0800 8488 "pmain" 32.50 13.30 540725 2879744 2191372 1 26.00
20091116 08:34:46+0800 4714 "pmain" 16.00 3.10 929 615324 513196 8 14.00
20091116 08:34:46+0800 8540 "pmain" 32.50 8.90 541869 1720080 1472960 4 12.00
20091116 08:34:46+0800 4662 "pmain" 22.20 3.10 1290 618612 516496 3 24.00
20091116 08:34:46+0800 8506 "pmain" 32.90 9.30 548614 1830624 1536052 2 22.00
20091116 08:34:46+0800 8625 "pmain" 29.10 9.90 484342 1955684 1643476 7 24.00
20091116 08:34:46+0800 8609 "pmain" 28.70 10.10 479033 1953236 1668500 6 18.00
20091116 08:34:46+0800 8591 "pmain" 29.50 9.20 491893 1768436 1514964 5 22.00
20091116 08:34:46+0800 8488 "pmain" 32.50 13.30 540801 2879744 2192360 1 18.00
20091116 08:40:14+0800 4714 "pmain" 16.30 3.10 998 620476 518356 8 24.00
20091116 08:40:14+0800 8540 "pmain" 32.50 8.90 541937 1720080 1473444 4 16.00
20091116 08:40:14+0800 4662 "pmain" 22.20 3.10 1365 621556 519440 3 20.00
20091116 08:40:14+0800 8506 "pmain" 32.90 9.30 548690 1830624 1537040 2 30.00
20091116 08:40:14+0800 8625 "pmain" 29.10 10.00 484420 1955684 1647672 7 28.00
20091116 08:40:14+0800 8609 "pmain" 28.70 10.10 479102 1953236 1671672 6 26.00
20091116 08:40:14+0800 8591 "pmain" 29.50 9.20 491976 1768436 1515556 5 28.00
20091116 08:40:14+0800 8488 "pmain" 32.50 13.30 540884 2879744 2193052 1 32.00
20091116 08:45:42+0800 4714 "pmain" 16.50 3.20 1068 638020 535900 8 18.00
20091116 08:45:42+0800 8540 "pmain" 32.50 8.90 542002 1720080 1474088 4 16.00
20091116 08:45:42+0800 4662 "pmain" 22.40 3.20 1446 633452 531336 3 34.00
20091116 08:45:42+0800 8506 "pmain" 32.90 9.30 548765 1830624 1539080 2 24.00
20091116 08:45:42+0800 8625 "pmain" 29.10 10.00 484505 1955684 1648064 7 20.00
20091116 08:45:42+0800 8609 "pmain" 28.70 10.10 479176 1953236 1672088 6 18.00
20091116 08:45:42+0800 8591 "pmain" 29.50 9.20 492060 1768436 1516112 5 26.00
20091116 08:45:42+0800 8488 "pmain" 32.50 13.40 540976 2879744 2210696 1 28.00
20091116 08:51:11+0800 4714 "pmain" 16.80 3.20 1140 639532 537412 8 14.00
20091116 08:51:11+0800 8540 "pmain" 32.50 8.90 542069 1720080 1474392 4 22.00
20091116 08:51:11+0800 4662 "pmain" 22.30 3.20 1517 635292 533168 3 16.00
20091116 08:51:11+0800 8506 "pmain" 32.90 9.30 548840 1830624 1539396 2 28.00
20091116 08:51:11+0800 8625 "pmain" 29.10 10.00 484584 1955684 1649196 7 30.00
20091116 08:51:11+0800 8609 "pmain" 28.70 10.10 479242 1953236 1672604 6 20.00
20091116 08:51:11+0800 8591 "pmain" 29.50 9.20 492134 1768436 1516424 5 20.00
20091116 08:51:11+0800 8488 "pmain" 32.50 13.40 541065 2879744 2216092 1 30.00
20091116 08:56:40+0800 4714 "pmain" 17.10 3.40 1216 668588 566460 8 20.00
20091116 08:56:40+0800 8540 "pmain" 32.50 8.90 542136 1720080 1475656 4 14.00
20091116 08:56:40+0800 4662 "pmain" 22.30 3.30 1592 647808 545692 3 26.00
20091116 08:56:40+0800 8506 "pmain" 32.90 9.30 548916 1830624 1539712 2 20.00
20091116 08:56:40+0800 8625 "pmain" 29.10 10.00 484665 1955684 1651784 7 22.00
20091116 08:56:40+0800 8609 "pmain" 28.70 10.10 479320 1953236 1673204 6 24.00
20091116 08:56:40+0800 8591 "pmain" 29.50 9.20 492220 1768436 1516604 5 28.00
20091116 08:56:40+0800 8488 "pmain" 32.50 13.40 541157 2879744 2217552 1 34.00
20091116 09:02:08+0800 4714 "pmain" 17.40 3.40 1294 670460 568332 8 24.00
20091116 09:02:08+0800 8540 "pmain" 32.50 8.90 542205 1720080 1475996 4 24.00
20091116 09:02:08+0800 4662 "pmain" 22.50 3.50 1676 680156 578040 3 34.00
20091116 09:02:08+0800 8506 "pmain" 32.90 9.30 549000 1830624 1540240 2 28.00
20091116 09:02:08+0800 8625 "pmain" 29.10 10.00 484748 1955684 1652280 7 26.00
20091116 09:02:08+0800 8609 "pmain" 28.70 10.10 479391 1953236 1673636 6 24.00
20091116 09:02:08+0800 8591 "pmain" 29.50 9.20 492303 1768436 1517264 5 26.00
20091116 09:02:08+0800 8488 "pmain" 32.50 13.50 541248 2879744 2221148 1 28.00
Actually i will process the data become

Quote:
Date Hour average_RSS average_PCPU
11-16-2009 07 (value) (value)
11-16-2009 08 (value) (value)
11-16-2009 09 (value) (value)
Anybody can help me ?
# 2  
Old 11-19-2009
Try this:

Code:
awk -F"[ :]" ' BEGIN {
printf "Date Hour average_RSS average_PCPU\n";
                            }
NR>1{ 
if(arr[$1" "$2]=="") { rss="";cpu="";cnt=0;} 
rss+=$(NF-2); cpu+=$NF; cnt++; 
arr[$1" "$2]=rss" "cpu" "cnt; } 
END {
for (i in arr) { split(arr[i],a," "); 
printf "%s %.1f %.1f\n", i,a[1]/a[3],a[2]/a[3]; } 
      }' filename

Output:

Quote:
Date Hour average_RSS average_PCPU
20091116 07 1355920.6 20.7
20091116 08 1364754.1 21.2
20091116 09 1403367.0 26.8

Last edited by dennis.jacob; 11-19-2009 at 04:10 AM.. Reason: modified the code to handle header
# 3  
Old 11-19-2009
Hi Dennis,

I think the average_PCPU for the date 20091116 at hours 08 should be 22.1818


Quote:
grep "20091116 08" filename | awk '{sum+=$11} END { print sum/NR}'
# 4  
Old 11-19-2009
Quote:
Originally Posted by justbow
Hi Dennis,

I think the average_PCPU for the date 20091116 at hours 08 should be 22.1818
Change the below line in the code according to your required precision. ie, %.4f here

printf "%s %.1f %.1f\n", i,a[1]/a[3],a[2]/a[3]; }
# 5  
Old 11-19-2009
Code:
awk -F[\ \:] 'BEGIN {print "Date Hour average_RSS average_PCPU"}
{if (NR>1) rss[$2]+=$(NF-2); cpu[$2]+=$NF; count[$2]++}
END { for (i in rss) {printf "11-16-2009 %s %.4f %.4f\n",i,rss[i]/count[i],cpu[i]/count[i]} }' urfile

Date Hour average_RSS average_PCPU
11-16-2009 07 1342177.0000 19.7727
11-16-2009 08 1380012.0909 22.1818
11-16-2009 09 1403367.0000 26.7500

# 6  
Old 11-19-2009
Python, if you have it
Code:
#!/usr/bin/env python

d={}
e={}
f=open("file")
line=f.readline()
for li in f:
    s = li.split()
    year,mth,day=s[0][:4],s[0][4:6],s[0][6:8]
    ti = s[1][:2]
    STR= day+"-"+mth+"-"+year+" "+ti
    d.setdefault(STR,[])
    e.setdefault(STR,[])
    rss,pcpu=s[7],s[8]
    d[STR].append(rss)
    e[STR].append(pcpu)
f.close()

for date,values in d.iteritems():
    print date, sum(map(int,values))/len(values), sum(map(int,e[date]))/len(e[date])

output
Code:
# python script.py 
16-11-2009 09 1682302 1403367
16-11-2009 08 1667231 1380012
16-11-2009 07 1646110 1342177

# 7  
Old 11-19-2009
Code:
# cat awk.script
BEGIN                           {
                                        FS="[ :]"
                                }
        NR == 1                 {
                                        print "Date    Time average_RSS average_PCPU"
                                }
        a &&  a != $1 OFS $2    {
                                        printf "%s %.4f %.4f\n",a,(b[a]/d),(c[a]/d)
                                        b[$1 OFS $2] = c[$1 OFS $2] = ""
                                        d = 0
                                }
        NR > 1                  {
                                        a =  $1 OFS $2
                                        b[$1 OFS $2] += $(NF-2)
                                        c[$1 OFS $2] += $NF
                                        d++
                                        next
                                }
END                             {
                                        printf "%s %.4f %.4f\n",a,(b[a]/d),(c[a]/d)
                                }
# awk -f awk.script LOG.FILE
Date    Time average_RSS average_PCPU
20091116 07 1342177.0000 19.7727
20091116 08 1380012.0909 22.1818
20091116 09 1403367.0000 26.7500

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Want to get average value for each hour

I want to get CPU average value only (not required user CPU & memory) with each hours on individual date. The sample output is below | | | User |Memory| User | Date | Time |CPU %|CPU % | % |Mem % | 03/02/2015|00:00:00| 24.56| 20.66| 89.75| 63.48|... (13 Replies)
Discussion started by: Saravanan_0074
13 Replies

2. Shell Programming and Scripting

Average of multiple time-stamped data every half hour

Hi All, Thank you for reading through my post and helping me figure out how I would be able to perform this task. For example: I have a list of continuous output collected into a file in the format as seen below: Date...........Time........C....A......... B ==========================... (5 Replies)
Discussion started by: terrychen
5 Replies

3. Shell Programming and Scripting

Calculate average for repeated ID within a data

I have an awk script that gives the following output: Average end-to-end transmission delay 2.7 to 5.7 is 0.635392 seconds Average end-to-end transmission delay 2.1 to 5.1 is 0.66272 seconds Average end-to-end transmission delay 2.1 to 5.1 is 0.691712 seconds Average end-to-end transmission... (4 Replies)
Discussion started by: ENG_MOHD
4 Replies

4. Shell Programming and Scripting

Data counting

I have a large tab delimited text file with 10 columns for example chrM 412 A A 75 0 25 2 ..,AGAATt II chrM 413 G G 72 0 25 4 ..t,,Aag IIIH chrM 414 C C 75 0 25 4 ...a,.. III2 chrM 415 C T 75 75 25 4 TTTt,,,ATC III7 At... (4 Replies)
Discussion started by: Lucky Ali
4 Replies

5. Shell Programming and Scripting

return counting per hour percentage

We have a monitoring process for a load in unix box, during this process we are writing logs statements for each record, and during this process we are showing the counts per hour. Here is that how we are following log files statements: (just two lines printed here), these statements logged at... (1 Reply)
Discussion started by: skkuchipudi
1 Replies

6. UNIX for Dummies Questions & Answers

Load average spikes once an hour

Hi, I am getting a high load average, around 7, once an hour. It last for about 4 minutes and makes things fairly unusable for this time. How do I find out what is using this. Looking at top the only thing running at the time is md5sum. I have looked at the crontab and there is nothing... (10 Replies)
Discussion started by: sm9ai
10 Replies

7. Shell Programming and Scripting

counting word xx referred to a time period, like minute or hour

Hello, I try to insert a post because I've got a trouble to perform a unix job. But I didn't found which steps (procedure) I should follow. Could you help me? I got a log by my Application box, like following: gbosmam037:test >view Log_Server.csv ... (2 Replies)
Discussion started by: maluca68
2 Replies

8. UNIX for Advanced & Expert Users

filter last 24 hour data and put in new file

i have file server 1 (filesvr01acess.log) and disc server 1 (discsvr01acess.log) in unix box(say ip adress of the box 10.39.66.81) Similiarly i have file server 2 (filesvr01acess.log) and disc server 2(discsvr01acess.log) in another unix box(say ip adress of the box 10.39.66.82). Now my... (1 Reply)
Discussion started by: nripa1
1 Replies

9. Shell Programming and Scripting

How can i grep for an hour before data

Hi, My log file is something like this. (08/04/2009 00:27:42.179)(:) aaaaaaaaaaaa (08/04/2009 00:27:42.181)(:) bbbbbbbbbbbbbbbb (08/04/2009 01:00:42.713)(:) cd cdc d ddddsksjdkssksksj (08/04/2009 01:02:42.716)(:) raarrarararararara (08/04/2009 01:07:43.036)(:ERROR) Port... (8 Replies)
Discussion started by: rdhanek
8 Replies

10. Shell Programming and Scripting

generating data for 1 hour

Hi Folks, The reqirement is that i need to generate 1 hr file with a time interval of five minutes.. For ex: my i/p is 0000-0000 and desired o/p is 0000-0005 0005-0010 0010-0015 0015-0020 0020-0025 0025-0030 0030-0035 0040-0045 0050-0055 0055-0100 Script neede urgent ... (0 Replies)
Discussion started by: aajan
0 Replies
Login or Register to Ask a Question