Monitoring and Metering - PowerPoint PPT Presentation

About This Presentation
Title:

Monitoring and Metering

Description:

Register a listener that will be notified when the Peer Info Service receives a response ... from a remote peer; the listener object will be called back ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 21
Provided by: scsCar
Category:

less

Transcript and Presenter's Notes

Title: Monitoring and Metering


1
Monitoring and Metering
2
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
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
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
(No Transcript)
6
Monitoring using the JXTA Shell
  • The peerinfo command gets information about other
    peers within a peergroup
  • Obtain info about remote peers
  • JXTAgt peerinfo -rpeerinfo message sent
  • List peer info already known by the peer
  • JXTAgt peerinfo
  • Flush locally cached peer information
  • JXTAgt peerinfo -f

7
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
PeerInfo ExampleJava
  • 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.getPeerInfoRespons
    e() if (myQueryID e.getQueryID())
    ...
  • peerinfo.addPeerInfoListener(myPeerListener)
    int myQueryID peerinfo.getRemotePeerInfo(peer)

9
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
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_liste
    ner (Jxta_peerinfo_service service,
    Jxta_peerinfo_listener listener)
  • Remove a peerinfo listener.

11
PeerInfo ExampleC
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_peerin
fo_listener(peerinfo,
mylistener) peerinfo_service_get_r
emote_peerinfo(peerinfo, peerId
listener) res
jxta_listener_wait_for_event (listener, timeout,
(Jxta_object) info)

12
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
JXTA Monitoring and Metering Project
Goals
  • 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

14
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
JXTA Monitor
16
Monitoring and Metering Tool
API View
Get Cumulative Totals MonitorFilter
Register Periodic Listener MonitorFilter
MonitorReport
MonitorReport
Monitor
API View
MonitorManager
SPI View
Meterable JXTAServices
17
(No Transcript)
18
Monitoring and Metering
Supported Standard Services
  • MMP provides J2SE implementations for the
    standard JXTA services
  • Endpoint service
  • Transport service
  • Rendezvous service
  • Resolver service
  • Pipe service
  • Discovery service

Meterable even though it is not implemented as a
JXTA service.
19
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
End Monitoring and Metering
Write a Comment
User Comments (0)
About PowerShow.com