[Orca-dev] Re: unknown value

Blair Zajac blair at gps.caltech.edu
Sun Jun 10 08:48:34 PDT 2001


Try the attached patch to Orca to have it ignore input values that
are equal to 'U' and pass 'U' to RRDtool.

Blair

"Jason D. Kelleher" wrote:
> 
> Nope.  How will counter values of "U" be treated?  My results are the
> same, but now Orca throws out the following errors:
> 
> /opt/orca/bin/orca: making directory
> `/opt/orca/data/dw-ibm/sp/html/ODO'.
> Argument "U" isn't numeric in multiply at (eval 95) line 3, <FD>
> chunk 77.
> Argument "U" isn't numeric in multiply at (eval 95) line 3, <FD>
> chunk 77.
> Argument "U" isn't numeric in subtract at (eval 95) line 3, <FD>
> chunk 77.
> Argument "U" isn't numeric in subtract at (eval 95) line 3, <FD>
> chunk 77.
> Argument "U" isn't numeric in subtract at (eval 95) line 3, <FD>
> chunk 77.
> Argument "U" isn't numeric in multiply at (eval 95) line 3, <FD>
> chunk 78.
> Argument "U" isn't numeric in multiply at (eval 95) line 3, <FD>
> chunk 78.
> Argument "U" isn't numeric in subtract at (eval 95) line 3, <FD>
> chunk 78.
> Argument "U" isn't numeric in subtract at (eval 95) line 3, <FD>
> chunk 78.
> Argument "U" isn't numeric in subtract at (eval 95) line 3, <FD>
> chunk 78.
> Argument "U" isn't numeric in multiply at (eval 95) line 3, <FD>
> chunk 79.
> Argument "U" isn't numeric in multiply at (eval 95) line 3, <FD>
> chunk 79.
> Argument "U" isn't numeric in subtract at (eval 95) line 3, <FD>
> chunk 79.
> Argument "U" isn't numeric in subtract at (eval 95) line 3, <FD>
> chunk 79.
> Argument "U" isn't numeric in subtract at (eval 95) line 3, <FD>
> chunk 79.
> 
> --- Blair Zajac <blair at gps.caltech.edu> wrote:
> > If you use the value U and pass this to Orca, then this will be
> > understood by RRDtool to mean an unknown value.
> >
> > Let me know if this works.
> >
> > Blair
> >
> > "Jason D. Kelleher" wrote:
> > >
> > > I'm writing a script that takes datafiles from severals nodes in
> > an
> > > OPS cluster and creates an aggregate datafile for Orca so data
> > from
> > > several nodes can be put onto one graph along with totals and
> > > averages.
> > >
> > > Everything is working fine now except when I encounter a "hole"
> > in
> > > the data from a node.  To prevent changing the number of columns
> > and
> > > upsetting Orca I've been filling these holes with "0".  This
> > skews
> > > averages a little, but I didn't consider it significant until I
> > saw
> > > what it did to counter values - definitely a Bad Thing(tm).  Does
> > > Orca accept something like the RRDTool "*UNKNOWN*" value?
> > >
> > > I guess I could just drop the entire line, but that seems silly
> > since
> > > dropping a node for maintenance may be considered a SOP and
> > doesn't
> > > affect the cluster.  Any suggestions would be appreciated.
> > >
> > > jason
> > >
> > >                    Yahoo! Groups Sponsor
> > > [www.debticated.com]
> > >
> > >
> > Service.
> >
> 
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail - only $35
> a year!  http://personal.mail.yahoo.com/
> 
>                    Yahoo! Groups Sponsor
> [www.debticated.com]
> 
> 
-------------- next part --------------
--- ../orca-0.27b1/lib/Orca/SourceFile.pm	Thu Mar 29 15:25:41 2001
+++ lib/Orca/SourceFile.pm	Sun Jun 10 08:46:10 2001
@@ -524,11 +524,18 @@
     # not changing the original plot structure.  Look through each
     # element of each data and look for names appearing in the column
     # description array.  If there is a match for this file, then
-    # convert the element to an index the @_ array where the data will
-    # be pulled from.  If there is not a match, then see if the
-    # element matches a name from one of the other column names from
-    # the same group.  In this case the data argument for this file
-    # will not be used.
+    # convert the element to index the @_ array where the data will be
+    # pulled from.  If there is not a match, then see if the element
+    # matches a name from one of the other column names from the same
+    # group.  In this case the data argument for this file will not be
+    # used.
+
+    # To allow data gathering program to send unknown values to Orca,
+    # check if any of the substituted values equals 'U' and return
+    # immediately the value 'U' to pass to RRDtool.  Keep track of the
+    # substituted values.
+    my %substituted_values;
+
     my @datas;
     foreach my $one_data (@{$plot->{data}}) {
       push(@datas, [@$one_data]);
@@ -540,8 +547,9 @@
         my $element = $datas[$j][$k];
         my $pos;
         if (defined ($pos = $column_description{$element})) {
-          $datas[$j][$k]  = "\$_[$pos]";
           $match_one_data = 1;
+          $datas[$j][$k]  = "\$_[$pos]";
+          $substituted_values{"\$_[$pos]"} = 1;
         } elsif (defined $group_column_names[$group_index]{$element}) {
           my $m = $old_i + 1;
           if ($required) {
@@ -580,10 +588,14 @@
     for (my $j=0; $j<@datas; ++$j) {
       my $data_expression;
       if (defined $datas[$j]) {
-        $data_expression = "@{$datas[$j]}";
-        my $sub_expr     = "sub { $data_expression }";
-        my $sub_expr_md5 = md5($data_expression);
-        my $eval_result  = $choose_data_sub_cache{$sub_expr_md5};
+        my $sub_expr = "sub {\n";
+        foreach my $s (sort keys %substituted_values) {
+          $sub_expr .= "  if (!defined($s) || $s eq 'U') {    return 'U';\n  }\n";
+        }
+        $data_expression  = "@{$datas[$j]}";
+        $sub_expr        .= "  $data_expression;\n}";
+        my $sub_expr_md5  = md5($data_expression);
+        my $eval_result   = $choose_data_sub_cache{$sub_expr_md5};
         unless (defined $eval_result) {
           $eval_result = 1;
           my $test_value;


More information about the Orca-dev mailing list