There are three XML configuration files used by the application.
File
.../web-dcache/WEB-INF/classes/tableConfig.xml
contains the rules for the tables creation/update. It
changes only if the dCache administrator wants to add more
tables into the database to work with. Here is the fragment
of such file, which describes two SQL statements to create
the table named en_rd_daily and to update it.
Example 14.1. Fragment of tableConfig.xml configuration file
....................
<table id="en_rd_daily">
<create>
select date(datestamp), count(*), sum(fullsize) as fullSize
into en_rd_daily from storageinfo
where action='restore' and errorcode=0 group by date(datestamp) order by date
</create>
<update>
<query>
delete from en_rd_daily where date between current_date-6 and current_date
</query>
<query>
insert into en_rd_daily
select date(datestamp), count(*), sum(fullsize) as fullSize
from storageinfo
where datestamp between current_date-6 and now() and action='restore' and errorcode=0
group by date(datestamp) order by date
</query>
</update>
</table>
....................
File .../web-dcache/plotConfig.xml
contains the set of commands for gnuplot program which is
used to build the images. It defines the table(s) where to
get data from, what data to use, and the plot format. Here
is the fragment of such file, which describes plot named
billing.cst.year, which uses the data
from the table cost_daily
from the billing database for the current year, and build
the plot with the line and points on it.
Example 14.2. Fragment of plotConfig.xml configuration file
....................
<plot id="billing.cst.year">
<title>Transaction Cost</title>
<datasource table="cost_daily">
date between current_date-interval '1 year' and current_date ORDER BY date
</datasource>
<gnusetup>
<c>set xdata time</c>
<c>set timefmt '%Y-%m-%d'</c>
<c>set format x '%y-%m-%d'</c>
<c>set xlabel 'Date (Year-month-day)'</c>
<c>set ylabel 'Cost'</c>
<c>###set logscale y</c>
<dataset title="Cost" src="cost_daily">
using {date}:{mean} with linespoints lw 3 lt 2
</dataset>
</gnusetup>
</plot>
....................
File
.../lps/plots/resources/pltnames.xml
contains the URLs for the generated files with the images
and previews, which are shown on the web page. Here is the
fragment of such file, which describes plot set named
Bytes read, which contains the plots
for a year, a month, a week, a week with one hour interval,
a day, and the corresponding thumbnail previews.
Example 14.3. Fragment of pltnames.xml configuration file
....................
<plot>
Bytes read
<pic>
<Year>http:../../../web-dcache/viewer?name=billing.brd.year.png</Year>
<Month>http:../../../web-dcache/viewer?name=billing.brd.month.png</Month>
<Week>http:../../../web-dcache/viewer?name=billing.brd.week.png</Week>
<Week-daily>http:../../../web-dcache/viewer?name=billing.brd.week-daily.png</Week-daily>
<Day>http:../../../web-dcache/viewer?name=billing.brd.day.png</Day>
</pic>
<pre>
<Year>file:../../../web-dcache/viewer?name=billing.brd.year.pre</Year>
<Month>file:../../../web-dcache/viewer?name=billing.brd.month.pre</Month>
<Week>file:../../../web-dcache/viewer?name=billing.brd.week.pre</Week>
<Week-daily>file:../../../web-dcache/viewer?name=billing.brd.week-daily.pre</Week-daily>
<Day>file:../../../web-dcache/viewer?name=billing.brd.day.pre</Day>
</pre>
</plot>
....................