From: <cob...@us...> - 2003-10-22 21:17:46
|
Update of /cvsroot/jrobin/src/jrobin/demo In directory sc8-pr-cvs1:/tmp/cvs-serv999/src/jrobin/demo Modified Files: ProfileGraphsOld.java ProfileGraphsNew.java JRobinGallery.java JRobinComplexGraph.java Log Message: New graph lib Add support for custom plotdefs Finalized some features Index: ProfileGraphsOld.java =================================================================== RCS file: /cvsroot/jrobin/src/jrobin/demo/ProfileGraphsOld.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProfileGraphsOld.java 21 Oct 2003 19:42:00 -0000 1.1 --- ProfileGraphsOld.java 22 Oct 2003 21:06:53 -0000 1.2 *************** *** 287,290 **** --- 287,292 ---- def.gprint("load", "AVERAGE", "Average: @5.2@s"); def.gprint("load", "LAST", "Current: @6.2@s\n"); + def.hrule( 3.0, Color.YELLOW, "legende", 5); + def.vrule( new GregorianCalendar(2003, 7, 24, 9, 00), Color.BLUE, "9am", 2 ); def.comment("\n"); def.comment("-------------------------------------------------------------------------------@c"); Index: ProfileGraphsNew.java =================================================================== RCS file: /cvsroot/jrobin/src/jrobin/demo/ProfileGraphsNew.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProfileGraphsNew.java 21 Oct 2003 19:42:00 -0000 1.1 --- ProfileGraphsNew.java 22 Oct 2003 21:06:53 -0000 1.2 *************** *** 52,56 **** // Demo sake ! private GregorianCalendar startDate = new GregorianCalendar(2003, 7, 24, 00, 00); private GregorianCalendar endDate = new GregorianCalendar(2003, 7, 25, 00, 00); --- 52,56 ---- // Demo sake ! private GregorianCalendar startDate = new GregorianCalendar(2003, 7, 24, 00, 30); private GregorianCalendar endDate = new GregorianCalendar(2003, 7, 25, 00, 00); *************** *** 288,291 **** --- 288,293 ---- def.gprint("load", "AVERAGE", "Average: @5.2@s"); def.gprint("load", "LAST", "Current: @6.2@s\n"); + def.hrule( 3.0, Color.YELLOW, "legende", 5); + def.vrule( new GregorianCalendar(2003, 7, 24, 9, 00), Color.BLUE, "9am", 2 ); def.comment("\n"); def.comment("-------------------------------------------------------------------------------@c"); Index: JRobinGallery.java =================================================================== RCS file: /cvsroot/jrobin/src/jrobin/demo/JRobinGallery.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JRobinGallery.java 21 Oct 2003 19:42:00 -0000 1.2 --- JRobinGallery.java 22 Oct 2003 21:06:53 -0000 1.3 *************** *** 19,24 **** public static void graph7() throws RrdException, IOException { RrdGraphDef def = new RrdGraphDef(); ! GregorianCalendar start = new GregorianCalendar(2003, 4, 1); ! GregorianCalendar end = new GregorianCalendar(2003, 5, 1); def.setTimePeriod(start, end); long t0 = start.getTime().getTime() / 1000L; --- 19,24 ---- public static void graph7() throws RrdException, IOException { RrdGraphDef def = new RrdGraphDef(); ! GregorianCalendar start = new GregorianCalendar(2003, 3, 25); ! GregorianCalendar end = new GregorianCalendar(2003, 5, 5); def.setTimePeriod(start, end); long t0 = start.getTime().getTime() / 1000L; *************** *** 36,39 **** --- 36,40 ---- def.datasource("c" + i, "TIME," + t + ",GT,v2,UNKN,IF"); } + def.area( new GregorianCalendar( 2003, 4, 1 ), Double.MIN_VALUE, new GregorianCalendar( 2003, 5, 1 ), Double.MAX_VALUE, Color.ORANGE, "april 2003\n" ); for(int i = 0; i < n; i++) { if(i==0) { *************** *** 85,89 **** def.area("blank2", Color.WHITE, null); def.line("v1", Color.BLUE, null, 1); ! def.line("v2", Color.BLUE, null, 1); def.setTitle("Voltage measurement"); def.setVerticalLabel("[Volts]"); --- 86,90 ---- def.area("blank2", Color.WHITE, null); def.line("v1", Color.BLUE, null, 1); ! def.line("v2", null, null, 1); def.setTitle("Voltage measurement"); def.setVerticalLabel("[Volts]"); Index: JRobinComplexGraph.java =================================================================== RCS file: /cvsroot/jrobin/src/jrobin/demo/JRobinComplexGraph.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** JRobinComplexGraph.java 21 Oct 2003 19:42:00 -0000 1.10 --- JRobinComplexGraph.java 22 Oct 2003 21:06:53 -0000 1.11 *************** *** 45,49 **** public static void main(String[] args) { ! GregorianCalendar start = new GregorianCalendar(2003, 7, 24, 20, 00); GregorianCalendar end = new GregorianCalendar(2003, 7, 25, 00, 00); --- 45,49 ---- public static void main(String[] args) { ! GregorianCalendar start = new GregorianCalendar(2003, 7, 24, 00, 00); GregorianCalendar end = new GregorianCalendar(2003, 7, 25, 00, 00); *************** *** 78,82 **** //gl.setAntiAliasing(false); gl.setGridRange( 0, 1, false ); ! gl.datasource("load", "c:/test.rrd", "serverLoad", "AVERAGE"); gl.datasource("user", "c:/test.rrd", "serverCPUUser", "AVERAGE"); --- 78,83 ---- //gl.setAntiAliasing(false); gl.setGridRange( 0, 1, false ); ! //gl.setBackground( "/demo6.png" ); ! //gl.setOverlay( "/demo6.png" ); gl.datasource("load", "c:/test.rrd", "serverLoad", "AVERAGE"); gl.datasource("user", "c:/test.rrd", "serverCPUUser", "AVERAGE"); *************** *** 93,97 **** gl.comment("CPU utilization (%)\n"); gl.comment(" "); ! //gl.hrule( 7.0, Color.YELLOW, null, 10f); gl.area("load", new Color(0x66,0x99,0xcc), " 0 - 25%"); gl.area("p25t50", new Color(0x00,0x66,0x99), "25 - 50%"); --- 94,98 ---- gl.comment("CPU utilization (%)\n"); gl.comment(" "); ! //gl.stack("load", Color.RED, null); gl.area("load", new Color(0x66,0x99,0xcc), " 0 - 25%"); gl.area("p25t50", new Color(0x00,0x66,0x99), "25 - 50%"); *************** *** 122,130 **** gl.gprint("load", "AVERAGE", "Average: @5.2@s"); gl.gprint("load", "LAST", "Current: @6.2@s\n"); ! gl.comment("\n"); ! gl.comment("-------------------------------------------------------------------------------@c"); ! //gl.vrule( new GregorianCalendar(2003, 7, 24, 9, 00), Color.BLUE, "9am", 2f ); //gl.vrule( new GregorianCalendar(2003, 7, 24, 17, 00), Color.BLUE, "5pm", 3f ); ! gl.comment("Generated: " + new Date() + "@R"); // Create the actual graph --- 123,136 ---- gl.gprint("load", "AVERAGE", "Average: @5.2@s"); gl.gprint("load", "LAST", "Current: @6.2@s\n"); ! //gl.hrule( 3.0, null, "legende", 1); ! //gl.vrule( new GregorianCalendar(2003, 7, 24, 9, 00), Color.BLUE, "9am", 2 ); ! gl.area( new GregorianCalendar(2003, 7, 24, 9, 00), Double.MIN_VALUE, new GregorianCalendar(2003, 7, 24, 17, 00), Double.MAX_VALUE, Color.ORANGE, "deviation@r" ); ! gl.area( new GregorianCalendar(2003, 7, 24, 8, 00), Double.MIN_VALUE, new GregorianCalendar(2003, 7, 24, 10, 00), Double.MAX_VALUE, Color.PINK, null ); ! gl.area( new GregorianCalendar(2003, 7, 24, 16, 00), Double.MIN_VALUE, new GregorianCalendar(2003, 7, 24, 18, 00), 12, Color.PINK, null ); ! gl.stack("load", Color.BLUE, "hmm"); ! gl.comment("\n-------------------------------------------------------------------------------@c"); ! //gl.vrule( new GregorianCalendar(2003, 7, 24, 17, 00), Color.BLUE, "5pm", 3f ); ! gl.comment("Generated: " + new Date() + "@L"); // Create the actual graph *************** *** 158,162 **** // Print out timing information for the new package API long s2 = Calendar.getInstance().getTimeInMillis(); ! System.out.println( "New package: " + (s2 - s1) + " ms" ); // -------------------------------------------------------- --- 164,168 ---- // Print out timing information for the new package API long s2 = Calendar.getInstance().getTimeInMillis(); ! System.err.println( "New package: " + (s2 - s1) + " ms" ); // -------------------------------------------------------- *************** *** 273,277 **** // Print out timings for the old graph API s2 = Calendar.getInstance().getTimeInMillis(); ! System.out.println( "Old package: " + (s2 - s1) + " ms" ); System.exit(0); --- 279,283 ---- // Print out timings for the old graph API s2 = Calendar.getInstance().getTimeInMillis(); ! System.err.println( "Old package: " + (s2 - s1) + " ms" ); System.exit(0); |