perfsonar-dev - [pS-dev] [GEANT/SA2/SA2T3-OPPD] r622 - in branches/perfsonar-oppd-new-architect: bin lib/perfSONAR/DataStruct lib/perfSONAR/MP tools/perfSONAR-client
Subject: perfsonar development work
List archive
[pS-dev] [GEANT/SA2/SA2T3-OPPD] r622 - in branches/perfsonar-oppd-new-architect: bin lib/perfSONAR/DataStruct lib/perfSONAR/MP tools/perfSONAR-client
Chronological Thread
- From:
- To:
- Subject: [pS-dev] [GEANT/SA2/SA2T3-OPPD] r622 - in branches/perfsonar-oppd-new-architect: bin lib/perfSONAR/DataStruct lib/perfSONAR/MP tools/perfSONAR-client
- Date: Tue, 17 Aug 2010 15:37:08 +0100
Author: dfn.calim
Date: 2010-08-17 15:37:08 +0100 (Tue, 17 Aug 2010)
New Revision: 622
Modified:
branches/perfsonar-oppd-new-architect/bin/oppd.pl
branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct/NMWG.pm
branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP/OWAMP.pm
branches/perfsonar-oppd-new-architect/tools/perfSONAR-client/owamp-ind2-req.xml
Log:
MP/OWAMP response
Modified: branches/perfsonar-oppd-new-architect/bin/oppd.pl
===================================================================
--- branches/perfsonar-oppd-new-architect/bin/oppd.pl 2010-08-16 14:53:31
UTC (rev 621)
+++ branches/perfsonar-oppd-new-architect/bin/oppd.pl 2010-08-17 14:37:08
UTC (rev 622)
@@ -735,12 +735,12 @@
# Just ignore if accept() returned because a signal (most likely
SIGCHLD)
# was received. See 'man perlipc'.
if ($!) {
- $log->info("Error in incoming connection: $!");
+ $log->error("Error in incoming connection: $!");
} elsif (my $errstr = IO::Socket::SSL->errstr()) {
# SSL stuff is obviously not setting $! ...
- $log->info("SSL error in incoming connection: $errstr");
+ $log->error("SSL error in incoming connection: $errstr");
} else {
- $log->info("Unknown error in incoming connection");
+ $log->error("Unknown error in incoming connection");
}
next;
}
Modified:
branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct/NMWG.pm
===================================================================
--- branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct/NMWG.pm
2010-08-16 14:53:31 UTC (rev 621)
+++ branches/perfsonar-oppd-new-architect/lib/perfSONAR/DataStruct/NMWG.pm
2010-08-17 14:37:08 UTC (rev 622)
@@ -138,6 +138,10 @@
$ds->{ERROROCCUR} = 1;
return;
}
+
+ #Eventtype is defined we can use it for result data
+ $self->{EVENTTYPE} = $et;
+
#check times
my $startTime =
$ds->{REQUESTMSG}->{"metadataIDs"}{$meta}{"startTime"};
my $endTime = $ds->{REQUESTMSG}->{"metadataIDs"}{$meta}{"endTime"};
@@ -170,6 +174,7 @@
foreach my $key (keys %{$datablock}){ #get eventtypes
next if ($key eq "node" || $key eq "metaref" ); #Get only evebttypes
foreach my $k (keys %{$datablock->{$key}}){
+ #$self->{LOGGER}->debug(Dumper($k));
if (!defined $parameters{$k}){
if ($k eq "src" || $k eq "dst"){
$parameters{$k} = $datablock->{$key}{$k}{"value"};
@@ -340,10 +345,7 @@
sub parseResult{
my ($self, $ds) = @_;
- $self->{LOGGER}->info("Started....");
- #$self->{LOGGER}->info(Dumper($ds));
- #TODO place this on a more specific place
- my $ns = "http://ggf.org/ns/nmwg/tools/iperf/2.0/";
+ my $ns = $self->{EVENTTYPE};
my $params = $$ds->{PARAMS};
foreach my $id (keys %{$params}){
Modified: branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP/OWAMP.pm
===================================================================
--- branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP/OWAMP.pm
2010-08-16 14:53:31 UTC (rev 621)
+++ branches/perfsonar-oppd-new-architect/lib/perfSONAR/MP/OWAMP.pm
2010-08-17 14:37:08 UTC (rev 622)
@@ -60,6 +60,7 @@
my @commandline;
my $errormsg;
+ #$self->{LOGGER}->debug(Dumper(%parameters));
push @commandline, "-S" , $parameters{src} if($parameters{"src"});
push @commandline, "-c" , $parameters{count} if $parameters{count};
@@ -74,21 +75,39 @@
push @commandline, "-b", $parameters{bucket_width} if
$parameters{bucket_width};
push @commandline, "-N", $parameters{intermediates} if
$parameters{intermediates};
- #TODO which output type should be take if no defined
- push @commandline, "-v", "" if ($parameters{"output"} &&
$parameters{"output"} eq "per_packet");
- push @commandline, "-M", "" if ($parameters{"output"} &&
($parameters{"output"} eq "machine_readable"));
- push @commandline, "-R", "" if ($parameters{"output"} &&
($parameters{"output"} eq "raw"));
+ #Look for the output type
+ if ($parameters{"output"} && $parameters{"output"} eq "per_packet"){
+ push @commandline, "-v";
+ $self->{OUTPUTTYPE} = "per_packet";
+ }
+ elsif ($parameters{"output"} && ($parameters{"output"} eq
"machine_readable")){
+ push @commandline, "-M";
+ $self->{OUTPUTTYPE} = "machine_readable";
+ }
+ elsif ($parameters{"output"} && ($parameters{"output"} eq "raw")){
+ push @commandline, "-R";
+ $self->{OUTPUTTYPE} = "raw";
+ }
+ else{
+ #No output type defined
+ $self->{OUTPUTTYPE} = "default";
+ }
push @commandline, "-P", $parameters{portrange} if
$parameters{portrange};
- push @commandline, "-a", "" if($parameters{"percentile"});
- push @commandline, "-f", "" if($parameters{"one_way"} &&
($parameters{"one_way"} eq "from"));
- push @commandline, "-t", "" if($parameters{"one_way"} &&
($parameters{"one_way"} eq "to"));
+ push @commandline, "-a" if($parameters{"percentile"});
+ push @commandline, "-f" if($parameters{"one_way"} &&
($parameters{"one_way"} eq "from"));
+ push @commandline, "-t" if($parameters{"one_way"} &&
($parameters{"one_way"} eq "to"));
#Append destination
- if ($parameters{"dst"} && $parameters{"port"}){
- my $dst = "$parameters{dst}:$parameters{port}";
- push @commandline, $dst, "";
+ if ($parameters{"dst"} ){
+ if ($parameters{"port"} ){
+ my $dst = "$parameters{dst}:$parameters{port}";
+ push @commandline, $dst;
+ }
+ else{
+ push @commandline, $parameters{"dst"};
+ }
}
else{
$errormsg = "No destination ip address or port specified.";
@@ -114,13 +133,44 @@
=cut
sub parse_result {
- my ($self, $ds, $id) = @_;
- my $result = $$ds->{PARAMS}->{$id}->{MEASRESULT};
- my @result = split(/\n/, $result);
- my @datalines;
- my $time = time;
+ my ($self, $ds, $id) = @_;
+ my $result = $$ds->{PARAMS}->{$id}->{MEASRESULT};
+ my @result = split(/\n/, $result);
+ my @datalines;
+ my $time = time;
- $self->{LOGGER}->info(Dumper(@result));
-
+ foreach my $resultline (@result){
+ if ($self->{OUTPUTTYPE} eq "per_packet"){
+
+ }
+ else{
+ if ($resultline =~
+ #10 sent, 0 lost (0.000%), 0 duplicates
+
/(\d+)\s+sent,\s+(\d+)\s+lost\s+\((\S+)\),\s+(\d+)\s+duplicates/){
+ my %data_hash;
+ $data_hash{"number_of_packets"} = $1;
+ $data_hash{"lost_packets"} = $2;
+ $data_hash{"lost_percent"} = $3;
+ $data_hash{"duplicate_packets"} = $4;
+ push @datalines, \%data_hash;
+ } elsif ($resultline =~
+ #one-way delay min/median/max = 0.202/0.4/0.582 ms,
(err=0.628 ms)
+ /one-way delay min\/median\/max =
(\S+\/\S+\/\S+)\s+(\w+),\s+\(err=(.+)\s+(\w+)/){
+ my %data_hash;
+ my $delay = $1;
+ my ($min,$med,$max) = split ("/", $delay);
+ $data_hash{"delay_min"} = $min;
+ $data_hash{"delay_med"} = $med;
+ $data_hash{"delay_max"} = $max;
+ $data_hash{"delay_units"} = $2;
+ $data_hash{"error"} = $3;
+ $data_hash{"error_units"} = $4;
+ push @datalines, \%data_hash;
+ } else { next; }
+ }#End else
+ }#End foreach my $resultline
+
+ #$self->{LOGGER}->info(Dumper($1));
+ return @datalines;
}
1;
\ No newline at end of file
Modified:
branches/perfsonar-oppd-new-architect/tools/perfSONAR-client/owamp-ind2-req.xml
===================================================================
---
branches/perfsonar-oppd-new-architect/tools/perfSONAR-client/owamp-ind2-req.xml
2010-08-16 14:53:31 UTC (rev 621)
+++
branches/perfsonar-oppd-new-architect/tools/perfSONAR-client/owamp-ind2-req.xml
2010-08-17 14:37:08 UTC (rev 622)
@@ -11,13 +11,17 @@
<nmwg:metadata id="meta1">
<perfsonar:subject id="subj1">
- <nmwgt:endPoint type="ipv4" value="198.129.254.102"/>
+ <nmwgt:endPointPair>
+ <nmwgt:src type="ipv4" value="131.188.81.34"/>
+ <nmwgt:dst type="ipv4" value="198.129.254.102"/>
+ </nmwgt:endPointPair>
</perfsonar:subject>
<nmwg:eventType>owamp</nmwg:eventType>
<nmwg:parameters id="param1">
<nmwg:parameter name="individual" value="timestamps"/>
<nmwg:parameter name="port" value="861"/>
+ <nmwg:parameter name="count" value="33"/>
</nmwg:parameters>
</nmwg:metadata>
- [pS-dev] [GEANT/SA2/SA2T3-OPPD] r622 - in branches/perfsonar-oppd-new-architect: bin lib/perfSONAR/DataStruct lib/perfSONAR/MP tools/perfSONAR-client, svn-noreply, 08/17/2010
Archive powered by MHonArc 2.6.16.