You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 66 Next »

MPS History Server (mpshist) is a server application for saving MPS messages to Oracle.

#Current Version
#Development
#Programmer's Guide
#User's Guide
#References

Current Version


0-0-5

Development


Overview

Background

The MPS History Server (mpshist) is a software system for storing MPS History Messages in an RDB.

Thesaurus
  • LP: link processor

Requirements

Use Cases
  1. User must figure out what's going on with MPS (performance statistics).
    • Author: snorum
    • Reason: Our mission.
  2. User must search and do analysis on messages.
    • Author: snorum
    • Reason: For diagnostics.
  3. User must be able to register mpshist with LP.
    • Author: snorum
    • Reason: Zero configuration, dynamic change.
  4. User must switch from one mpshist to another.
    • Author: snorum
    • Reason: Prevent loss of messages.
  5. User must be able to access all info messages.
    • Author: snorum
    • Reason: diagnostics
  6. User must be able to specify path to ConfigDB.
    • Author: snorum
    • Reason: changes in the hardware.
Functional Specification
  1. mpshist must capture all messages.
    • Origin: Use Case #1
    • How to test: All accepted messages must be in the database.
  2. mpshist must write all messages to RDB.
    • Origin: Use Case #2
    • How to test: All accepted messages must be in the database.
  3. mpshist must send notification messages to LP at a rate of 0.2 Hz.
    • Origin: Use Case #3
    • How to test: Get messages from LP.
  4. One must be able to run several copies of mpshist.
    • Origin: Use Case #4
    • How to test: Have 2 of them running.
  5. mpshist must log all info messages.
    • Origin: Use Case #5
    • How to test: Look at the log.
  6. mpshist must accept the path to ConfigDB as a command-line parameter.
    • Origin: Use Case #6
    • How to test: Finds ConfigDB as specified through command-line.
Constraints
  • Messages are streamed at up to 1MB/sec.
  • mpshist must support Oracle RDB.
  • LP is a time-critical VME IOC (2.8 msecs delay accepted).
  • LP might not be sending for a while, so no timeouts must be introduced.
  • Connect only to 1 mpshist at a time.

Design

  • Use WaitFreeWriteQueue for message repository. (needs RTJ)
  • Send a datagram to a host-name of LP on port 30000.
    • 2 byte header: protocol version 1, message type: notification 2
    • 2 bytes for port number
  • Use server port from 30001 - 30009 to receive history messages.

Comments

  • Open to the possibility of sending messages directly from LP to RDB.
  • Create a Config module

Programmer's Guide


MPS Config

Oracle

JDBC Url
jdbc:oracle:thin:MPS_HISTORY/%s@slac-oracle02.slac.stanford.edu:1521:SLACDEV

where %s = the current password.

Schema

The foreign keys are actually enums, not names.

Procedures
BEGIN MPS_HISTORY.MPS_HISTORY_PKG.DML_%s1 (%s2); END;

where
%s1 = table name
%s2 = csv in the same order as in the #Schema (top-to-bottom = left-to-right).

User's Guide


Scripts

You have to run mpshist on lcls-daemon2 as laci

/etc/init.d/st.mpshist start

To stop mpshist

/etc/init.d/st.mpshist stop

Cmlog

The cmlog facility is "MPS History".

References


http://java.sun.com/docs/books/tutorial/networking/ (esp. sockets and datagrams)
http://darksleep.com/player/JavaAndUnsignedTypes.html (java types from/to bytes)

  • No labels