Skip to content

Commit f145836

Browse files
committed
add WSPT java proxy summarizer
1 parent f656f1e commit f145836

2 files changed

Lines changed: 84 additions & 0 deletions

File tree

README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ in WebSphere Application Server.
1515

1616
* linux_prereq.sh
1717
Grab 32-bit and 64-bit prerequisites on RHEL.
18+
19+
* wsptp.pl
20+
Summarize Java Proxy logs usage of mem2mem partition tables
1821

1922
* retrievesigner.jar
2023
Tiny java utility to grab the root CA from a port and either dump it to a

wspt.pl

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/usr/bin/perl
2+
# Parse Java Proxy logs and look for mem2mm shennanigans
3+
4+
use strict;
5+
6+
my ($pid, $tid, $time, $timestr, $ver, $table);
7+
my %threads = ();
8+
my %servers = ();
9+
my %dates = ();
10+
my @chrono;
11+
my $ln;
12+
my $file = $ARGV[0];
13+
14+
sub readpidtid() {
15+
if (m/\[.*?(\d+:\d+:\d+:\d+).*?\] (\w+)/) {
16+
$timestr = $1;
17+
$tid = $2;
18+
}
19+
}
20+
21+
sub sed_split {
22+
my ($data) = @_;
23+
return sprintf "sed -e '%s,%s!d' '%s' | grep '%s'\n", $data->{'line'}, $data->{'line_end'}, $file , $data->{'tid'};
24+
}
25+
26+
while(<>) {
27+
$ln++;
28+
if (/\[null\]/) {
29+
next;
30+
}
31+
# These cases are in the order the messages appear
32+
if (/Finishing request to target asynch.*target=(\S*)/) {
33+
readpidtid();
34+
$threads{$tid} = { tid=>$tid, name=>$1, line=>$ln};
35+
}
36+
if (/Adding header \[Date\] with value \[(.*)\]$/) {
37+
readpidtid();
38+
my $server = $threads{$tid}->{'name'};
39+
my $date = $1;
40+
if ($date =~ m/(\d+:\d+:\d+)/) {
41+
$dates{$tid} = $1;
42+
}
43+
}
44+
if (/getHeaderAsString.*WSPT \[(.*)\]$/) {
45+
readpidtid();
46+
my $server = $threads{$tid}->{'name'};
47+
$threads{$tid}->{'table'} = $1;
48+
}
49+
if (/getHeaderAsString.*_WS_HAPRT_WLMVERSION \[(.*)\]$/) {
50+
readpidtid();
51+
my $server = $threads{$tid}->{'name'};
52+
my $line1 = $threads{$tid}->{'line'};
53+
my $table = $threads{$tid}->{'table'};
54+
push @{$servers{$server}->{'data'}}, { tid=>$tid, time=>$timestr , table=>$table, version=>$1, line=>$line1, line_end=>$ln, http_date=>$dates{$tid} };
55+
push @chrono, "$timestr\n\t$server\n\tWSPT=$table\n\tVER=$1";
56+
}
57+
}
58+
59+
print "By Server\n\n";
60+
my ($k, $v);
61+
while (($k, $v) = each(%servers)) {
62+
print "$k\n\n";
63+
my $prevtable;
64+
foreach (@{$v->{'data'}}) {
65+
my @trace_time = split, /:/, $_->{'time'};
66+
my @http_time = split, /:/, $_->{'http_date'};
67+
my $delay_seconds = $trace_time[2] - $http_time[2];
68+
$delay_seconds = 60*($trace_time[1] - $http_time[1]);
69+
print "\t $_->{'line'}: $_->{'time'} delay=$delay_seconds VER=$_->{'version'} WSPT=$_->{'table'} \n";
70+
print "\t\t" . sed_split($_) . "\n";
71+
if (defined($prevtable) && length($prevtable) > length($_->{'table'})) {
72+
print "\t ^^^ WHY DID THIS SHRINK " . sed_split($_) . "\n";
73+
}
74+
$prevtable = $_->{'table'};
75+
}
76+
}
77+
78+
print "By time\n\n";
79+
foreach(@chrono) {
80+
print "$_\n";
81+
}

0 commit comments

Comments
 (0)