Last active
December 31, 2015 04:59
-
-
Save nad2000/7937492 to your computer and use it in GitHub Desktop.
1) removes all lines except relevant:
- iteration parameter;
- tps (excluding connection time). 2) joins lines together to form CSV file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
egrep "(\*\*\*\*|excluding)" test.log | sed '/tps/ s/tps = \([.0-9]*\) .*/\1/; /uview/ s/ uview\([0-9]*\)/\1/' | sed -n '/\**/ {N;s/\n/,/;N;s/\n/,/;s/\**//p}' | |
## With loading into PostgreSQL: | |
# Create table: | |
psql -d 5 -c "create table test_output( id int, tps1 numeric, tps2 numeric)" | |
# Extract and load data: | |
egrep "(\*\*\*\*|excluding)" test.log | sed '/tps/ s/tps = \([.0-9]*\) .*/\1/; /uview/ s/ uview\([0-9]*\)/\1/' | sed -n '/\**/ {N;s/\n/,/;N;s/\n/,/;s/\**//p}' | psql -d 5 -c "TRUNCATE TABLE test_output; COPY test_output FROM STDIN (FORMAT csv, DELIMITER ',', HEADER false)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment