![JAR search and dependency download from the Maven repository](/logo.png)
org.epics.graphene.rrdtool.BubbleUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of graphene-rrdtool Show documentation
Show all versions of graphene-rrdtool Show documentation
Graphene bindings for rrdtool data.
/**
* Copyright (C) 2012 University of Michigan
* All rights reserved. Use is subject to license terms.
*/
package org.epics.graphene.rrdtool;
import java.awt.image.BufferedImage;
import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import javax.imageio.ImageIO;
import org.epics.graphene.BubbleGraph2DRenderer;
import org.epics.graphene.Point3DWithLabelDataset;
import org.epics.util.time.Timestamp;
import org.epics.util.time.TimestampFormat;
/**
*
* @author carcassi
*/
public class BubbleUtil {
private static TimestampFormat format = new TimestampFormat("yyyy/MM/dd HH:mm:ss");
public static void createBubblePlot(String filename, final Point3DWithLabelDataset dataset, final String urlPrototype, String path, String signalX, String signalY, String signalZ, Timestamp time) throws IOException {
if (dataset.getXStatistics() == null) {
System.out.println("Found no valid data for x");
return;
}
if (dataset.getYStatistics() == null) {
System.out.println("Found no valid data for y");
return;
}
if (dataset.getZStatistics() == null) {
System.out.println("Found no valid data for size");
return;
}
BufferedImage image = new BufferedImage(800, 600, BufferedImage.TYPE_3BYTE_BGR);
final StringBuilder html = new StringBuilder();
html.append("\n");
html.append("\n");
html.append(" \n");
html.append(" \n");
html.append(" \n");
html.append(" \n");
html.append(" \n");
html.append(" AGLT2 node performance details
\n");
html.append(" \n");
html.append(" " + signalY + "\n");
html.append(" ![](\"").append(filename).append(".png\")
" + signalX + "
\n");
html.append(" \n");
html.append(" \n");
html.append(" Size of the bubble represents bytes_in
\n");
html.append(" Data gathered from directory " + path + ". Data timestamp " + format.format(time) + "
\n");
html.append(" \n");
html.append(" \n");
html.append("\n");
BufferedWriter writer =
Files.newBufferedWriter(
FileSystems.getDefault().getPath(".", filename + ".html"),
Charset.forName("US-ASCII"));
writer.write(html.toString());
writer.close();
ImageIO.write(image, "png", new File(filename + ".png"));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy