/*****************************************************************************/
/*                                                                           */
/*                                 notes.txt                                 */
/*                                                                           */
/* (c) 2005 by the Board of Trustees of the Leland Stanford, Jr., University */
/*                            All Rights Reserved                            */
/*       Produced by Jacek Becla for Stanford University under contract      */
/*              DE-AC02-76SF00515 with the Department of Energy              */
/*****************************************************************************/
  
// $Id: notes.txt 22437 2008-03-04 14:35:16Z rdm $


need to clean up never closed sessions (by looking at session id of closed sessions)

- need to record xrootd restarts and close some entries accordingly

- add code for rebuilding stats from scratch (stored procedure)

- add support for AllSites
   - also add support for user@site and combined view for same userid at different sites

- "last update" query should return #min passed since last update


- add support for file size via xrootd

- load data from Tofigh's static tables

- add support for 'cycles' - different reprocessing cycles

- add support for total size of each skim

- if result is long (eg hosts for bbrskim) on webpage split into chunks

- need to add automatic backup
  mysqldump --skip-opt --lock-all-tables --extended-insert xrdmon_kan > x.out

- would be nice to automatically generate email if monitoring down

- need to automatically add table for each new year

- add collect/show statistics of xrd server restarts

- make xrdmon babar independent
   - skims: generic filter
   - what about file sizes?

- there is no way to list _all_ things, only _active_

- listing jobs for given user: maybe show start/stop time?

- extract functions common for loader and prepareStats

- write documentation, url with tz=XXX etc...

- rewrite (?) and package slacmsg

- add code to prevent starting multiple loaders with the same database
 
- add code to allow adding new site without taking down loader
 
- link with xrootd homepage

- if now is > then days range, need to update days range

Add page with common queries:
============================

Find sessions with duration over 2 weeks
insert into x select * from SLAC_closedSessions where duration > (60*60*24*14) GROUP BY pId;
select DISTINCT u.name AS userName, h.hostName AS clientName, pId, SLAC_hosts.hostName AS serverName, duration, disconnectT from x, SLAC_users u, SLAC_hosts h LEFT JOIN SLAC_hosts ON SLAC_hosts.id=serverHid WHERE x.userId = u.id AND x.clientHid=h.id order by duration desc;



compress output:
# updating topPerf USERS tables for Hour
# updating topPerf SKIMS tables for Hour
# updating topPerf TYPES tables for Hour
# updating topPerf FILES tables for Hour
# updating topPerf USERS tables for NOW
# updating topPerf SKIMS tables for NOW
# updating topPerf TYPES tables for NOW
# updating topPerf FILES tables for NOW
into one line if possible

Sizes
======

 - closedSessions: ~110 MB/month + index: 55MB/month
 - closedFiles:    ~120 MB/month + index: ~100MB/month
 - so total ~400MB/month --> 5GB/year
 - tar.gz one month: 350MB



update frequency
================

Last     freq       #points
----------------------------
HOUR     1 min        60
DAY     15 min        96
WEEK     1 hour      168
MONTH    6 hours     120
YEAR    24 hours     365

When:
HOUR:  every time we have 30 sec
DAY:   every time we have 0, 15, 30, 45 min
WEEK:  every time we have 7 min
MONTH: every time we have 0h22m, 6h22m, 12h22m, 18h22m
YEAR:  every time we have 23h22m
