Presentation is loading. Please wait.

Presentation is loading. Please wait.

13-1 Monitoring and Metering. 13-1 Learning Objectives ● This module will help you... – Understand the JXTA monitoring and metering functionality – Gain.

Similar presentations


Presentation on theme: "13-1 Monitoring and Metering. 13-1 Learning Objectives ● This module will help you... – Understand the JXTA monitoring and metering functionality – Gain."— Presentation transcript:

1 13-1 Monitoring and Metering

2 13-1 Learning Objectives ● This module will help you... – Understand the JXTA monitoring and metering functionality – Gain familiarity with the JXTA Peer Info Service API – Understand how to use JXTA monitoring and metering

3 13-1 Peer Info Protocol ● Provides general framework for obtaining peer status and monitoring information – Uptime, inbound and outbound message count, time last message sent/received, etc. ● Asynchronous – Query message sent to peer – Response message provides specific information about state of peer – No guarantees; peer not required to respond

4 13-1 Peer Info Service ● Implements the Peer Info Protocol ● Works in context of peergroup ● Provides methods to: – Retrieve remote and local peer status information – Register a listener that will be notified when the Peer Info Service receives a response – Flush Peer Info advertisements from local cache

5 13-1 Peergroup Services Services are accessible through the peer group object: Java peerInfoService = peerGroup.getPeerInfoService(); C Jxta_PG_get_peerinfo_service(group, &peerinfo); PeerGroup Services Membership Pipe Discovery Rendezvous Resolver Endpoint PeerInfo

6 13-1 Monitoring using the JXTA Shell ● The peerinfo command gets information about other peers within a peergroup ● Obtain info about remote peers JXTA> peerinfo -r peerinfo message sent ● List peer info already known by the peer JXTA> peerinfo ● Flush locally cached peer information JXTA> peerinfo -f

7 13-1 PeerInfoService void addPeerInfoListener(PeerInfoListener listener) boolean removePeerInfoListener(PeerInfoListener listener) – Add/remove a peerinfo listener java.util.Enumeration getLocalPeerInfo(ID peer) – Get PeerInfoservice from local cache void getRemotePeerInfo(ID peer, PeerInfoListener listener) – Get PeerInfoService from a remote peer; the listener object will be called back when peer information is known PeerInfoResponseMessage getPeerInfoService() – Retrieve Peer Info advertisement void flushAdvertisements (ID id) – Flush cached advertisement of specified peer; if id is null, locally cached PeerInfoResponseMessage of all peers are deleted

8 13-1 PeerInfo Example—Java ● Listener interface for receiving PeerInfoService events: public interface PeerInfoListener extends java.util.EventListener ● Implementing a PeerInfoListener: PeerInfoListener myPeerListener = new PeerInfoListener() { public void peerInfoResponse(PeerInfoEvent e) { PeerInfoResponseMessage adv = e.getPeerInfoResponse(); if (myQueryID == e.getQueryID()) {... } } peerinfo.addPeerInfoListener(myPeerListener); int myQueryID = peerinfo.getRemotePeerInfo(peer);

9 13-1 C API Jxta_status peerinfo_service_get_remote_peerinfo (Jxta_peerinfo_service *service, Jxta_id *peerid, Jxta_peerinfo_listener *listener) – Get PeerInfoService from a remote peer. Jxta_status peerinfo_service_get_local_peerinfo (Jxta_peerinfo_service *service, Jxta_id *peerid, Jxta_object **adv) – Get a PeerInfo from local cache. Jxta_status peerinfo_service_get_my_peerinfo (Jxta_peerinfo_service *service, Jxta_object **adv) – Retrieve this peer's PeerInfo Advertisement Jxta_status peerinfo_service_flush_Advertisement (Jxta_peerinfo_service *service, Jxta_id *peerid) – Flush cached advertisement

10 13-1 C API (continued) Jxta_status peerinfo_service_add_peerinfo_listener (Jxta_peerinfo_service *service, Jxta_peerinfo_listener *listener) – Register a peerinfo listener, to be notified on peerinfo events. Jxta_status peerinfo_service_remove_peerinfo_listener (Jxta_peerinfo_service *service, Jxta_peerinfo_listener *listener) – Remove a peerinfo listener.

11 13-1 PeerInfo Example—C Jxta_PG_get_peerinfo_service(group, &peerinfo); peerinfo_service_get_my_peerinfo(peerinfo, & mypeerinfo_adv); if (mypeerinfo_adv != NULL ) { printf("Obtained %d peerinfo advertisement(s) \n", mypeerinfo_adv); peerinfo_service_add_peerinfo_listener(peerinfo, & mylistener); peerinfo_service_get_remote_peerinfo(peerinfo, peerId & listener); res = jxta_listener_wait_for_event (listener, timeout, (Jxta_object**) &info);

12 13-1 Need for Monitoring and Metering ● Perform resource accounting and billing ● Monitor load locally and remotely – Memory utilization, thread utilization, network connections, bandwidth ● Evaluate various implementations of services (effects, efficiencies, etc.)

13 13-1 JXTA Monitoring and Metering Project ● Provide a simple, dynamic and extendable framework for gathering and reporting metrics – Increase productivity of JXTA core development – Provide metrics to help tune/configure – Provide data to measure scalability – Help programmers and administrators understand how JXTA services operate – Provide tools to aid development and debugging – Provide framework for building special purpose meterable edge devices Goals

14 13-1 Monitoring and Metering Tools ● JXTA Service Logger – Pipes metrics to file for later processing ● JXTA Monitor – GUI for collecting and rendering data – Extensible framework – Displays metrics in tables or graphs – Can display local or remote results

15 13-1 JXTA Monitor

16 13-1 Monitoring and Metering Tool MonitorManager Meterable JXTA Services Monitor SPI View API View MonitorReport Register Periodic Listener: MonitorFilter MonitorReport Get Cumulative Totals: MonitorFilter API View

17 13-1 Monitoring and Metering Tool MonitorManager Monitor SPI View API View MonitorReport Request for (MonitorFilter) MonitorManager – SPI View Meterable JXTA Services ServiceMonitor

18 13-1 Monitoring and Metering ● MMP provides J2SE implementations for the standard JXTA services: – Endpoint service – Transport service * – Rendezvous service – Resolver service – Pipe service – Discovery service Supported Standard Services * Meterable even though it is not implemented as a JXTA service.

19 13-1 Types of Meterable JXTA Builds ● All metering off – Metering capabilities compiled out of build – No metering load, smallest JAR ● Metering always on – Metering capabilities included in library build – Metering always active ● Metering conditionally on – Metering capabilities included in library build – Metering based on setting of user property – Most flexibility, with slight performance expense

20 13-1 End – Monitoring and Metering


Download ppt "13-1 Monitoring and Metering. 13-1 Learning Objectives ● This module will help you... – Understand the JXTA monitoring and metering functionality – Gain."

Similar presentations


Ads by Google