Skip to Content.
Sympa Menu

perfsonar-dev - [pS-dev] [GEANT/SA2/SA2T3-OPPD] r685 - trunk/lib/perfSONAR/MA

Subject: perfsonar development work

List archive

[pS-dev] [GEANT/SA2/SA2T3-OPPD] r685 - trunk/lib/perfSONAR/MA


Chronological Thread 
  • From:
  • To:
  • Subject: [pS-dev] [GEANT/SA2/SA2T3-OPPD] r685 - trunk/lib/perfSONAR/MA
  • Date: Mon, 7 Mar 2011 10:07:10 GMT

Author: dfn.calim
Date: 2011-03-07 10:07:09 +0000 (Mon, 07 Mar 2011)
New Revision: 685

Added:
trunk/lib/perfSONAR/MA/Hades.old.pm
Removed:
trunk/lib/perfSONAR/MA/Hades.pm
Log:
merged branches/perfsonar-oppd-new-architect and trunk

Copied: trunk/lib/perfSONAR/MA/Hades.old.pm (from rev 684,
branches/perfsonar-oppd-new-architect/lib/perfSONAR/MA/Hades.old.pm)
===================================================================
--- trunk/lib/perfSONAR/MA/Hades.old.pm (rev 0)
+++ trunk/lib/perfSONAR/MA/Hades.old.pm 2011-03-07 10:07:09 UTC (rev 685)
@@ -0,0 +1,175 @@
+package perfSONAR::MA::Hades;
+#
+# Copyright 2010 Verein zur Foerderung eines Deutschen Forschungsnetzes e.
V.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+
+use vars qw(@ISA);
+@ISA
= qw(perfSONAR::MA);
+
+#DEBUG
+#use Data::Dumper;
+#/DEBUG
+
+use strict;
+use warnings;
+
+
+use perfSONAR::MA;
+
+my $ns_raw="http://ggf.org/ns/nmwg/tools/owd/raw";;
+my $ns_hades="http://ggf.org/ns/nwmg/tools/hades/aggregated";;
+
+my $ns = $ns_raw;
+
+sub new {
+ my $this = shift;
+ my %param = (@_);
+ my $self = perfSONAR::MA->new(%param);
+ push @{$self->{"supportedEventtypes"}},
+
+ (
+ "http://ggf.org/ns/nmwg/tools/hades/";,
+ "http://ggf.org/ns/nmwg/characteristic/delay/summary/";,
+ "http://ggf.org/ns/nmwg/tools/owd/raw";,
+ "http://ggf.org/ns/nwmg/tools/hades/aggregated";,
+ "http://ggf.org/ns/nmwg/characteristic/delay/one-way/";,
+ );
+
+ $self->{"actions"} = {
+
+ ippm_aggregated => [
+ "http://ggf.org/ns/nmwg/tools/hades/";,
+
"http://ggf.org/ns/nmwg/characteristic/delay/summary/";,
+ "http://ggf.org/ns/nwmg/tools/hades/aggregated";,
+ ],
+ ippm_raw => [
+ "http://ggf.org/ns/nmwg/tools/owd/raw";,
+
"http://ggf.org/ns/nmwg/characteristic/delay/one-way/";,
+ ],
+ };
+
+ bless $self, qw(perfSONAR::MA::Hades);
+ return $self;
+}
+
+sub start_action {
+ my $self = shift;
+ my $msg = shift;
+ my $dataid = shift;
+ my $service_id = shift;
+
+ my @datalines;
+ my $action;
+
+ #determine kind of action from eventtype
+ my $agg_ets = join ('_', @{$self->{"actions"}{"ippm_aggregated"}});
+ my $raw_ets = join ('_', @{$self->{"actions"}{"ippm_raw"}});
+
+
+ $self->SUPER::set_eventType ($msg, $dataid);
+
+
+ my $et = $self->{"eventType"};
+
+ if ($agg_ets =~ /$et/){
+ $action = "ippm_aggregated";
+ } elsif($raw_ets =~ /$et/){
+ $action = "ippm_raw";
+ }
+
+ my $data_obj = $self->SUPER::start_action($msg, $dataid, $action,
$service_id);
+
+ if ($data_obj->isa("Hades::Data::IPPM_Raw")){
+ $ns = $ns_raw;
+ my $data = $data_obj->{data};
+ foreach my $ref (@$data) {
+ next unless (ref ($ref) eq "HASH");
+ my %data_hash;
+ $data_hash{"seqnr"} = $$ref{"seqnr"};
+ $data_hash{"senttime_sec"} = $$ref{"senttime_sec"};
+ $data_hash{"senttime_nsec"} = $$ref{"senttime_nsec"};
+ $data_hash{"recvtime_sec"} = $$ref{"recvtime_sec"};
+ $data_hash{"recvtime_nsec"} = $$ref{"recvtime_nsec"};
+ push @datalines, \%data_hash;
+ }
+ } elsif ($data_obj->isa("Hades::Data::IPPM_Aggregated")){
+ $ns = $ns_hades;
+ my $data = $data_obj->{data};
+ my $metric = $msg->{"dataIDs"}{$dataid}{"select"}{"metric"};
+ my $sample = $msg->{"dataIDs"}{$dataid}{"select"}{"sample"};
+ my $count = -1;
+ foreach my $ref (@$data) {
+ my %data_hash;
+ my $time = $$ref{"time"};
+ next unless $time;
+ if ($sample){
+ $count++;
+ next unless $count % $sample == 0;
+ }
+ $data_hash{"time"} = $time;
+ if (!$metric || $metric eq "all" || $metric eq "owd"){
+ $data_hash{"min_delay"} = $$ref{"min_owd"};
+ $data_hash{"med_delay"} = $$ref{"med_owd"};
+ $data_hash{"max_delay"} = $$ref{"max_owd"};
+ }
+ if (!$metric || $metric eq "all" || $metric eq "ipdv"){
+ $data_hash{"min_ipdv_jitter"} = $$ref{"min_ipdv"};
+ $data_hash{"med_ipdv_jitter"} = $$ref{"med_ipdv"};
+ $data_hash{"max_ipdv_jitter"} = $$ref{"max_ipdv"};
+ }
+ if (!$metric || $metric eq "all" || $metric eq "lost_packets"){
+ $data_hash{"loss"} = $$ref{"lost_packets"};
+ }
+ if (!$metric || $metric eq "all" || $metric eq "duplicate_packets"){
+ $data_hash{"duplicates"} = $$ref{"duplicate_packets"};
+ }
+ $data_hash{"sync"} = "yes";
+ #sent missing (im metadata parameters)
+ push @datalines, \%data_hash;
+ }
+
+ }
+ if ($#datalines > 0){
+ $msg->set_data_ns($dataid, $ns, @datalines);
+ }
+ return 1;
+}
+
+
+sub get_meta_info {
+ my $self = shift;
+ my $msg = shift;
+
+=cut
+ my @eventtypes = keys %eventtype_mapping;
+ my @actions = values %eventtype_mapping;
+
+ my %a; #elimiating duplicates
+
+ foreach my $action (@actions) {
+ if (!$a{$action}){
+ $self->SUPER::get_meta_info($msg, $action, @eventtypes);
+ $a{$action}++;
+ }
+ }
+=cut
+
+ foreach my $action (keys %{$self->{"actions"}}){
+ $self->SUPER::get_meta_info($msg, $action,
@{$self->{"actions"}{$action}});
+ }
+}
+
+1;

Deleted: trunk/lib/perfSONAR/MA/Hades.pm
===================================================================
--- trunk/lib/perfSONAR/MA/Hades.pm 2011-03-04 12:22:28 UTC (rev 684)
+++ trunk/lib/perfSONAR/MA/Hades.pm 2011-03-07 10:07:09 UTC (rev 685)
@@ -1,175 +0,0 @@
-package perfSONAR::MA::Hades;
-#
-# Copyright 2010 Verein zur Foerderung eines Deutschen Forschungsnetzes e.
V.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-
-use vars qw(@ISA);
-@ISA
= qw(perfSONAR::MA);
-
-#DEBUG
-#use Data::Dumper;
-#/DEBUG
-
-use strict;
-use warnings;
-
-
-use perfSONAR::MA;
-
-my $ns_raw="http://ggf.org/ns/nmwg/tools/owd/raw";;
-my $ns_hades="http://ggf.org/ns/nwmg/tools/hades/aggregated";;
-
-my $ns = $ns_raw;
-
-sub new {
- my $this = shift;
- my %param = (@_);
- my $self = perfSONAR::MA->new(%param);
- push @{$self->{"supportedEventtypes"}},
-
- (
- "http://ggf.org/ns/nmwg/tools/hades/";,
- "http://ggf.org/ns/nmwg/characteristic/delay/summary/";,
- "http://ggf.org/ns/nmwg/tools/owd/raw";,
- "http://ggf.org/ns/nwmg/tools/hades/aggregated";,
- "http://ggf.org/ns/nmwg/characteristic/delay/one-way/";,
- );
-
- $self->{"actions"} = {
-
- ippm_aggregated => [
- "http://ggf.org/ns/nmwg/tools/hades/";,
-
"http://ggf.org/ns/nmwg/characteristic/delay/summary/";,
- "http://ggf.org/ns/nwmg/tools/hades/aggregated";,
- ],
- ippm_raw => [
- "http://ggf.org/ns/nmwg/tools/owd/raw";,
-
"http://ggf.org/ns/nmwg/characteristic/delay/one-way/";,
- ],
- };
-
- bless $self, qw(perfSONAR::MA::Hades);
- return $self;
-}
-
-sub start_action {
- my $self = shift;
- my $msg = shift;
- my $dataid = shift;
- my $service_id = shift;
-
- my @datalines;
- my $action;
-
- #determine kind of action from eventtype
- my $agg_ets = join ('_', @{$self->{"actions"}{"ippm_aggregated"}});
- my $raw_ets = join ('_', @{$self->{"actions"}{"ippm_raw"}});
-
-
- $self->SUPER::set_eventType ($msg, $dataid);
-
-
- my $et = $self->{"eventType"};
-
- if ($agg_ets =~ /$et/){
- $action = "ippm_aggregated";
- } elsif($raw_ets =~ /$et/){
- $action = "ippm_raw";
- }
-
- my $data_obj = $self->SUPER::start_action($msg, $dataid, $action,
$service_id);
-
- if ($data_obj->isa("Hades::Data::IPPM_Raw")){
- $ns = $ns_raw;
- my $data = $data_obj->{data};
- foreach my $ref (@$data) {
- next unless (ref ($ref) eq "HASH");
- my %data_hash;
- $data_hash{"seqnr"} = $$ref{"seqnr"};
- $data_hash{"senttime_sec"} = $$ref{"senttime_sec"};
- $data_hash{"senttime_nsec"} = $$ref{"senttime_nsec"};
- $data_hash{"recvtime_sec"} = $$ref{"recvtime_sec"};
- $data_hash{"recvtime_nsec"} = $$ref{"recvtime_nsec"};
- push @datalines, \%data_hash;
- }
- } elsif ($data_obj->isa("Hades::Data::IPPM_Aggregated")){
- $ns = $ns_hades;
- my $data = $data_obj->{data};
- my $metric = $msg->{"dataIDs"}{$dataid}{"select"}{"metric"};
- my $sample = $msg->{"dataIDs"}{$dataid}{"select"}{"sample"};
- my $count = -1;
- foreach my $ref (@$data) {
- my %data_hash;
- my $time = $$ref{"time"};
- next unless $time;
- if ($sample){
- $count++;
- next unless $count % $sample == 0;
- }
- $data_hash{"time"} = $time;
- if (!$metric || $metric eq "all" || $metric eq "owd"){
- $data_hash{"min_delay"} = $$ref{"min_owd"};
- $data_hash{"med_delay"} = $$ref{"med_owd"};
- $data_hash{"max_delay"} = $$ref{"max_owd"};
- }
- if (!$metric || $metric eq "all" || $metric eq "ipdv"){
- $data_hash{"min_ipdv_jitter"} = $$ref{"min_ipdv"};
- $data_hash{"med_ipdv_jitter"} = $$ref{"med_ipdv"};
- $data_hash{"max_ipdv_jitter"} = $$ref{"max_ipdv"};
- }
- if (!$metric || $metric eq "all" || $metric eq "lost_packets"){
- $data_hash{"loss"} = $$ref{"lost_packets"};
- }
- if (!$metric || $metric eq "all" || $metric eq "duplicate_packets"){
- $data_hash{"duplicates"} = $$ref{"duplicate_packets"};
- }
- $data_hash{"sync"} = "yes";
- #sent missing (im metadata parameters)
- push @datalines, \%data_hash;
- }
-
- }
- if ($#datalines > 0){
- $msg->set_data_ns($dataid, $ns, @datalines);
- }
- return 1;
-}
-
-
-sub get_meta_info {
- my $self = shift;
- my $msg = shift;
-
-=cut
- my @eventtypes = keys %eventtype_mapping;
- my @actions = values %eventtype_mapping;
-
- my %a; #elimiating duplicates
-
- foreach my $action (@actions) {
- if (!$a{$action}){
- $self->SUPER::get_meta_info($msg, $action, @eventtypes);
- $a{$action}++;
- }
- }
-=cut
-
- foreach my $action (keys %{$self->{"actions"}}){
- $self->SUPER::get_meta_info($msg, $action,
@{$self->{"actions"}{$action}});
- }
-}
-
-1;



  • [pS-dev] [GEANT/SA2/SA2T3-OPPD] r685 - trunk/lib/perfSONAR/MA, svn-noreply, 03/07/2011

Archive powered by MHonArc 2.6.16.

Top of Page