From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16813 invoked by alias); 23 Mar 2011 04:28:42 -0000 Received: (qmail 16581 invoked by uid 22791); 23 Mar 2011 04:28:32 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_SORBS_WEB,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.aconex.com (HELO postoffice2.aconex.com) (203.166.49.3) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Mar 2011 04:28:25 +0000 X-ASG-Debug-ID: 1300854468-0157b4144248dd0001-x9Qv3j Received: from postoffice.aconex.com (postoffice.yarra.acx [192.168.35.100]) by postoffice2.aconex.com with ESMTP id fC6GFMPEDNnNUCAo; Wed, 23 Mar 2011 15:27:48 +1100 (EST) X-Barracuda-Envelope-From: psmith@aconex.com Received: from gatekeeper.aconex.com (gatekeeper.yarra.acx [192.168.35.102]) by postoffice.aconex.com (Postfix) with ESMTP id 8FCF5A50299; Wed, 23 Mar 2011 15:27:48 +1100 (EST) Received: from localhost (localhost.localdomain [127.0.0.1]) by gatekeeper.aconex.com (Postfix) with ESMTP id 152D89D0004; Wed, 23 Mar 2011 15:08:31 +1100 (EST) Received: from gatekeeper.aconex.com ([127.0.0.1]) by localhost (gatekeeper.aconex.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8c1vKnPq+hQO; Wed, 23 Mar 2011 15:08:30 +1100 (EST) Received: from paul.engr.acx (unknown [203.89.193.116]) by gatekeeper.aconex.com (Postfix) with ESMTPSA id 582DD9D0001; Wed, 23 Mar 2011 15:08:30 +1100 (EST) Subject: Re: [pcp] sketch of possible web pmapi X-Barracuda-Apparent-Source-IP: 203.89.193.116 Mime-Version: 1.0 (Apple Message framework v1082) X-ASG-Orig-Subj: Re: [pcp] sketch of possible web pmapi Content-Type: text/plain; charset=us-ascii From: Paul Smith In-Reply-To: <20110323035749.GA30308@redhat.com> Date: Wed, 23 Mar 2011 04:28:00 -0000 Cc: systemtap@sourceware.org, Ben Birch , "Frank Ch. Eigler" Content-Transfer-Encoding: quoted-printable Message-Id: <1895102A-B8E6-4ADB-A946-B5A5A2963760@aconex.com> References: <20110322175345.GH13236@redhat.com> <6FF2157A-0696-4DFE-AAAC-86EA22292452@aconex.com> <20110323035749.GA30308@redhat.com> To: pcp@oss.sgi.com X-Barracuda-Connect: postoffice.yarra.acx[192.168.35.100] X-Barracuda-Start-Time: 1300854468 X-Barracuda-URL: http://postoffice2.aconex.com:8000/cgi-mod/mark.cgi X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0209 X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.58702 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2011-q1/txt/msg00514.txt.bz2 >=20 > My main interest in using XML for the raw output is the ability to > easily associate it with an XSLT stylesheet to render the data into > HTML. I believe that it would be useful to be able to perform basic > navigation over the PCP data with nothing other than a plain old web > browser or spider, even without javascript. >=20 I'm not sure of the use case of viewing HTML these days with a browser that= doesn't have javascript accessible though.. ?=20=20=20=20 > JSON could be an alternative output format, selected with some URL > parameter. OTOH then HTML could be the same thing. >=20 yes, different formatters could be selected, although that adds complexity.= XSLT is just.. well... a fairly 'dead' platform these days. Sure, still = used, just if something is being done new here, I would think worth conside= ring what the state of play of the browsers support for things? Rendering a HTML table for example when the JSON is actually pretty readabl= e by a human already (certainly compared with XML). One thing I don't like about embedding XSLT details in the XML output is th= at it is still coupling the presentation layer to the data delivery layer h= ere. It would make it simple for browser to auto-display things, but it al= so fixes the browser to one XSLT based on the output defined there. I woul= d have thought much better to design the REST or whatever mechanism so that= it is purely a cross platform data delivery platform that both simple brow= sers and other application clients can interact with. Honestly, I wonder= whether the PMDAs themselves shouldn't expose REST direct ?? (that's a w= ay bigger change though obviously, nice to have a translation layer here br= idging the pmda's like pmproxy does). >=20 >>> /context?local >>> /context?hostname=3DHOSTNAME >>> /context?archivefile=3DFILENAME >>> ?poll-timeout=3DSECONDS >>> /context/CONTEXT/copy >>>=20 >=20 >> Following REST pattern (see wiki pattern above), this should be a >> POST. The 'get' bits after the query string I believe are still >> valid (although traditionally odd for POST, most people still do >> that ). >=20 > (I have no informed opinion on this.) >=20 >> To add more clarity here to make sure I'm following things >> correctly, I'm presuming the above Create Context action would >> require a '?...&contextName=3Dfoo' [...] >=20 > Actually, I was thinking that the server process would assign an > opaque context name, since it's the one in position to make a unique > one. >=20 so basically the contextName is a unique session handle between the browser= client and the RPC bridge? >=20 >>> - list/describe metrics >>>=20 >>> /context/CONTEXT/metric?glob=3DGLOB >>> /context/CONTEXT/metric?pmids=3DID1,ID2,ID3 >=20 >> Following the REST pattern again, and stealing liberally from the >> way ElasticSearch does this, I would suggest: >>=20 >> /context/{contextname}/_metric?glob=3D... >=20 > Are you only proposing to prefix the listing-type operations with an > underscore, or is there something else? >=20 yes, it's a RESTful pattern here seperating the objects/collections from th= e operation one is performing. It's purely for readability. This way it'= s unambiguous that: /context/foo/metrics means 'metrics' is a child object of 'foo', whereas /contex/foo/_metrics is a message 'please ask the metrics operation to query the 'foo' collectio= n for these values'. >=20 >> /context/_metric?pmids=3D... >>=20 >> Where the query on the _metric action is across _all_ defined >> Context names. Other action verbs like _fetch (see below) could >> then theoretically be applied across multiple contexts: >=20 > I've been cosidering separate contexts as belonging to independent > concurrent users, so I'd prefer not to expose the "all contexts" > object at all. >=20 >> /context/foo,bar,othercontextnumber3/_metric?pmids=3D.... >=20 > This could make sense; is there any PCP precedent or need for this? >=20 probably not... there may be other cases in the protocol where a collection= of makes sense, I had just borrowed this as a potentially exam= ple, wasn't sure if it were valid. Just putting out there in some cases th= e URL protocol may like to have collections of objects as part of the objec= ts. >=20 > I've been thinking of it as a statement that the client intends to > poll the PCP system no less frequently than the negotiated > poll-timeout value. The main purpose of this is to manage the > lifecycles of the underlying pmNewContext / pmDestroyContext > calls, and specifically the enqueued trace-events. >=20 >> If you're meaning a timeout on the web-proxy pulling values from the >> PMDAs then that should be a configuration value on that side, no the >> REST or XMLRP protocol layer? >=20 > I'm not quite sure what you mean. >=20 Rereading your original post I see the creation of the context object is gi= ving this setting as an indication of the polling frequency so this XML RPC= proxy/bridge thing can make informed choices on when it's ok to automatica= lly shut down it's internal collection to the PMDA's etc. That's probably v= alid. I guess having an implicit default value configured on the RPC bridg= e if the client chooses to not provide one for safety? Paul