Skip to Content.
Sympa Menu

perfsonar-user - Re: [perfsonar-user] [non-nasa source] [EXTERNAL] FW: Defining single-ended throughput tests inside a psconfig template

Subject: perfSONAR User Q&A and Other Discussion

List archive

Re: [perfsonar-user] [non-nasa source] [EXTERNAL] FW: Defining single-ended throughput tests inside a psconfig template


Chronological Thread 
  • From: Mark Feit <>
  • To: "Uhl, George D. (GSFC-423.0)[SGT INC]" <>, "" <>
  • Subject: Re: [perfsonar-user] [non-nasa source] [EXTERNAL] FW: Defining single-ended throughput tests inside a psconfig template
  • Date: Tue, 10 Sep 2019 16:02:40 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=internet2.edu; dmarc=pass action=none header.from=internet2.edu; dkim=pass header.d=internet2.edu; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EFfhDpRQggXB/9l7NN8FIm1FvXbtMVgIzDgk+PhUyrs=; b=HLdPGCwUSz9GP64U69QzQtVIxxMgYO7eb6LTAfjtC/1OzNlmDrYPJN1sK+9R+FYxDasG6a7f55dHQW5ySzqr+RoPxexjjsB/rh4VZTriYtLSuQ/cPR49Li4OijzvwbTvWPPAoszkl4ku6uqUMfLm1QvnIRG6rzi7/XtRs/i8URuWUftyCGCQ++jy9wVCo2Hx54lTWKwKraHuovR2sSBE87Kma7jhzeAdBIQm/56hDic7vhpATN5+NATa+yyYMiyODquDsqplfnrJmnwbdOcpv1OkP/s3gji0H7W3/UkH/l8CfrCTHpT8/u4e5hCfKRpIf4bVMBXl6bQ9kgUlWdu/+A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XX1y7QBypKIuHM2XtCIqjOdIvaUSbumwkZjPyM8lEvPmEycUhcvcsZOuwtygGdoz7aapAljI0mBQ4Ry0iB+2LS0/1s75eeYwvuYSLZnZTT+iAquTuZK98I6U0QYSXo7Rox1KC9QkDhPblr8Ae2e1CEIVC2zdUnkDcivKMDf+U0/X5sZmsfuHeP1HIW/dkFonI76UWOY5/lgCxfCKrmyzZ7jT84YIRRU71DY76Mv4GSXVIOphvVoAscXPlA5VRtLssCsNi8tXw+M2J2Z5lrZFZUl1wTUSy+tUb0r1sDSb0M9SILA41sCJIhgH9dvArY4n5fthwrKJlp28exG6x26HIg==

Uhl, George D. (GSFC-423.0)[SGT INC] writes:

 

I’m having difficulty in developing a jq transform script that will swap the source/dest address pairs as a result of a single-ended throughput test in the reverse direction.  I can write a jq script that operates on the single-ended perfsonar node’s json generated by the psconfig-pscheduler-agent.   For example,

 

"transform" : {

     "script" : "if (.tasks[].test.type=\"throughput\" and .tasks[].test.spec.reverse and .tasks[].test.spec.\"single-ended\") then .tasks[].test.spec.source as $tmp | .tasks[].test.spec.source = .tasks[].test.spec.dest | .tasks[].test.spec.dest = $tmp else null end"

},

 

But this transform script only swaps the source/dest addresses within the test specification (as verified through jq.play).  Having a transform script that operates on test spec parameters contained inside an archive.data object doesn’t make sense since archiving is a post-test operation.   I can’t find anything in the archiver object reference that allows me to swap the source/dest address pair post-test.

 

If I understand correctly, you’d like to make an A-to-B reverse throughput test appear in your archives as a B-to-A forward throughput test.  This is something you can do when you archive the runs.

 

Archiving happens in two stages:  first, the result is transformed if requested (or just left alone if not) and then whatever comes out of that process is sent to the archiver plugin.  The archiver plugins don’t know that transforms exist; they just operate on what pScheduler hands them.  (There’s a design reason for this that I won’t go into here.)  The Esmond plugin is a bit of an odd duck in that it has expectations about what the input will look like, so there’s a little less latitude in what you can change than there is with, say, syslog.  But what you’re doing is just fine since it would still result in something the Esmond plugin will understand.

 

I set up a quick test on a couple of my development systems and came up with this variation on what you provided as an archive specification:

 

{  

   "transform" : {

        "script" : [

            "if (.test.type == \"throughput\")",

            "   and (.test.spec.reverse)",

            "   and (.test.spec.\"single-ended\")",

            "then",

            "    .task.test.spec.source as $tmp",

            "    | .task.test.spec.source = .task.test.spec.dest",

            "    | .task.test.spec.dest = $tmp",

            "    | del(.task.test.spec.reverse)",

            "    | del(.task.test.spec.\"single-ended\")",

            "else",

            "    .",

            "end"

        ]

    },

    "archiver": "esmond",

    "data": { ... Esmond plugin parameters ... }

}

 

A few things of note:

 

The script has been split into an array of strings.  This feature became available in 4.1 and makes them easier to read and edit.

After the source and destination are swapped, the reverse and single-ended parameters are removed to avoid confusion about which way the test actually ran.

 

I corrected a mistake in your original jq script, which used = instead of == for the equality test.  That would have ended up behaving as an assignment and always evaluated to true, which is probably not what you wanted.

 

Instead of the else clause being a null (which would result in the result being dropped entirely), I let it pass the original JSON through to be archived.

 

 

I’m a bit confused about which data the transform script can modify with respect to swapping source/dest addressing when the archiver writes data to Esmond.

 

The transform is handed everything pScheduler knows about the task, the run and the result and can read or alter any of it.  (I notice that we didn’t spell out exactly what’s provided in the documentation; that will be remedied in the next bugfix release.)

 

It does not see any of the data object passed to the archiver plugin, so you won’t see any reference to transformations in those.

 

HTH.

 

--Mark

 




Archive powered by MHonArc 2.6.19.

Top of Page