Author: smarru Date: Tue Jul 30 00:02:02 2013 New Revision: 1508252 URL: http://svn.apache.org/r1508252 Log: commiting vijayendra's patch Added: airavata/sandbox/gsoc2013/app/scripts/NodeSubscriber.js airavata/sandbox/gsoc2013/app/views/monitor.canvas.html Added: airavata/sandbox/gsoc2013/app/scripts/NodeSubscriber.js URL: http://svn.apache.org/viewvc/airavata/sandbox/gsoc2013/app/scripts/NodeSubscriber.js?rev=1508252&view=auto ============================================================================== --- airavata/sandbox/gsoc2013/app/scripts/NodeSubscriber.js (added) +++ airavata/sandbox/gsoc2013/app/scripts/NodeSubscriber.js Tue Jul 30 00:02:02 2013 @@ -0,0 +1,75 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + * + */ + + +//Javascript API that talks to rabbitMQ AMQP server. + +//importing rabbit.js +var context = require('rabbit.js').createContext(); + +//importing express +var express = require('express'); +var app = express(); + +//importing jquery +var $ = require('jquery'); +var sleep = require('sleep'); + +var Server = require('http').createServer(app); +var io = require('socket.io').listen(Server); +Server.listen(1337); + +var st = io.of('status'); +var tp = io.of('timestamp'); +var des = io.of('description'); + +context.on('ready', function() { + sub = context.socket('SUB'); + sub.connect('ws-messenger-fanout'); + sub.setEncoding('utf8'); + + sub.on('data', function(note) { + $note = $(note); + + var status= $note.filter('*').eq(0)[0].nodeName; + var status= status.substring(3); + var timestamp = $note.find("ns\\:timestamp").text(); + var description = $note.find("ns\\:description").text(); + var component = " "; + io.sockets.emit('status',status); + io.sockets.emit('timestamp', timestamp); + io.sockets.emit('description',description); + io.sockets.emit('component',component); + // sleep.usleep(100000); + + }); + +}); + + +app.get('/',function(req,res){ + res.sendfile(__dirname+'/../..' + '/app/views/monitor.canvas.html'); + +}); + + + + Added: airavata/sandbox/gsoc2013/app/views/monitor.canvas.html URL: http://svn.apache.org/viewvc/airavata/sandbox/gsoc2013/app/views/monitor.canvas.html?rev=1508252&view=auto ============================================================================== --- airavata/sandbox/gsoc2013/app/views/monitor.canvas.html (added) +++ airavata/sandbox/gsoc2013/app/views/monitor.canvas.html Tue Jul 30 00:02:02 2013 @@ -0,0 +1,282 @@ + + + + + + + Message Monitoring + + + + + + + + + +
+ + + +

MONITORING

+ +
+ + + +
+ + + + + + + + +
+ + + + + + + +
+ + + + + + + +
Time
+ + + + + + + +
+ + + + + + + +
Status
+ + + + + + + + +
+ + + + + + + +
Component
+ + + + + + + +
+ + + + + + + +
Message
+
+ + \ No newline at end of file