/** * Creates a new instance of this class using the given parameters. * * @param numberOfEntries * Maximal number of entries in a XYPlot * @param recordsTimeUnit * Time unit to interpret the timestamp of a record passed to the input port */ public GCDisplayFilter(final int numberOfEntries, final TimeUnit recordsTimeUnit) { this.recordsTimeUnit = recordsTimeUnit; // Create the display objects this.xyplot = new XYPlot(numberOfEntries); }
private void updateDisplays() { // XY Plot final long timeStampDeltaInSeconds = (System.currentTimeMillis() - this.timeStampOfInitialization) / 1000; this.xyPlot.setEntry("", timeStampDeltaInSeconds, this.counter.get()); // Plain text this.plainText.setText(Long.toString(this.counter.get())); }
/** * Tests if the xy-plot received the correct values. */ @Test public void xyPlotEntriesShouldBeCorrect() { StageTester.test(this.cpuUtilFilter).and().send(this.record).to(this.cpuUtilFilter.getInputPort()).start(); final Date date = new Date(TimeUnit.MILLISECONDS.convert(this.record.getLoggingTimestamp(), RECORDS_TIME_UNIT)); final String minutesAndSeconds = date.toString().substring(14, 19); final double actualUser = this.cpuUtilFilter.getXYPlot().getEntries(this.id + " - " + CPUUtilizationDisplayFilter.USER).get(minutesAndSeconds).doubleValue(); final double actualSystem = this.cpuUtilFilter.getXYPlot().getEntries(this.id + " - " + CPUUtilizationDisplayFilter.SYSTEM).get(minutesAndSeconds) .doubleValue(); final double actualNice = this.cpuUtilFilter.getXYPlot().getEntries(this.id + " - " + CPUUtilizationDisplayFilter.NICE).get(minutesAndSeconds).doubleValue(); final double actualIrq = this.cpuUtilFilter.getXYPlot().getEntries(this.id + " - " + CPUUtilizationDisplayFilter.IRQ).get(minutesAndSeconds).doubleValue(); final double actualTotalUtilization = this.cpuUtilFilter.getXYPlot().getEntries(this.id + " - " + CPUUtilizationDisplayFilter.TOTAL_UTILIZATION) .get(minutesAndSeconds).doubleValue(); final double actualIdle = this.cpuUtilFilter.getXYPlot().getEntries(this.id + " - " + CPUUtilizationDisplayFilter.IDLE).get(minutesAndSeconds).doubleValue(); Assert.assertThat(actualUser / 100, Is.is(USER)); Assert.assertThat(actualSystem / 100, Is.is(SYSTEM)); Assert.assertThat(actualNice / 100, Is.is(NICE)); Assert.assertThat(actualIrq / 100, Is.is(IRQ)); Assert.assertThat(actualTotalUtilization / 100, Is.is(TOTAL_UTILISATION)); Assert.assertThat(actualIdle / 100, Is.is(IDLE)); } }
/** * Tests if the xy-plot received the correct values. */ @Test public void xyPlotEntriesShouldBeCorrect() { StageTester.test(this.memSwapUtilFilter).and().send(this.record).to(this.memSwapUtilFilter.getInputPort()).start(); final Date date = new Date(TimeUnit.MILLISECONDS.convert(this.record.getLoggingTimestamp(), RECORDS_TIME_UNIT)); final String minutesAndSeconds = date.toString().substring(14, 19); final long actualMemTotal = this.memSwapUtilFilter.getXYPlot().getEntries(this.id + " - " + MemSwapUtilizationDisplayFilter.MEM_TOTAL).get(minutesAndSeconds) .longValue(); final long actualMemUsed = this.memSwapUtilFilter.getXYPlot().getEntries(this.id + " - " + MemSwapUtilizationDisplayFilter.MEM_USED).get(minutesAndSeconds) .longValue(); final long actualMemFree = this.memSwapUtilFilter.getXYPlot().getEntries(this.id + " - " + MemSwapUtilizationDisplayFilter.MEM_FREE).get(minutesAndSeconds) .longValue(); final long actualSwapTotal = this.memSwapUtilFilter.getXYPlot().getEntries(this.id + " - " + MemSwapUtilizationDisplayFilter.SWAP_TOTAL) .get(minutesAndSeconds).longValue(); final long actualSwapUsed = this.memSwapUtilFilter.getXYPlot().getEntries(this.id + " - " + MemSwapUtilizationDisplayFilter.SWAP_USED).get(minutesAndSeconds) .longValue(); final long actualSwapFree = this.memSwapUtilFilter.getXYPlot().getEntries(this.id + " - " + MemSwapUtilizationDisplayFilter.SWAP_FREE).get(minutesAndSeconds) .longValue(); // Converting back form MB to Byte Assert.assertThat(actualMemTotal * 1048576, Is.is(MEM_TOTAL)); Assert.assertThat(actualMemUsed * 1048576, Is.is(MEM_USED)); Assert.assertThat(actualMemFree * 1048576, Is.is(MEM_FREE)); Assert.assertThat(actualSwapTotal * 1048576, Is.is(SWAP_TOTAL)); Assert.assertThat(actualSwapUsed * 1048576, Is.is(SWAP_USED)); Assert.assertThat(actualSwapFree * 1048576, Is.is(SWAR_FREE)); }
private void updateDisplays() { // XY Plot final long timeStampDeltaInSeconds = (System.currentTimeMillis() - this.timeStampOfInitialization) / 1000; this.xyPlot.setEntry("", timeStampDeltaInSeconds, this.counter.get()); // Plain text this.plainText.setText(Long.toString(this.counter.get())); }
/** * Creates a new instance of this filter. * * @param numberOfEntries * Maximal number of entries in a XYPlot * @param recordsTimeUnit * Time unit to interpret the timestamp of a record passed to the input port */ public ThreadsStatusDisplayFilter(final int numberOfEntries, final TimeUnit recordsTimeUnit) { this.recordsTimeUnit = recordsTimeUnit; // Create the display objects this.xyplot = new XYPlot(numberOfEntries); }
/** * Tests if the xy-plot received the correct values. */ @Test public void xyPlotEntriesShouldBeCorrect() { StageTester.test(this.threadsStatusFilter).and().send(this.record).to(this.threadsStatusFilter.getInputPort()).start(); final Date date = new Date(TimeUnit.MILLISECONDS.convert(this.record.getLoggingTimestamp(), RECORDS_TIME_UNIT)); final String minutesAndSeconds = date.toString().substring(14, 19); final String id = this.record.getHostname() + " - " + this.record.getVmName(); final long actualThreadCount = this.threadsStatusFilter.getXYPlot().getEntries(id + " - " + ThreadsStatusDisplayFilter.THREADS).get(minutesAndSeconds) .longValue(); final long actualTotalStartedThreadCount = this.threadsStatusFilter.getXYPlot().getEntries(id + " - " + ThreadsStatusDisplayFilter.TOTAL_THREADS) .get(minutesAndSeconds).longValue(); final long actualPeakThreadCount = this.threadsStatusFilter.getXYPlot().getEntries(id + " - " + ThreadsStatusDisplayFilter.PEAK_THREADS) .get(minutesAndSeconds).longValue(); final long actualDaemonThreadCount = this.threadsStatusFilter.getXYPlot().getEntries(id + " - " + ThreadsStatusDisplayFilter.DAEMON_THREADS) .get(minutesAndSeconds).longValue(); Assert.assertThat(actualThreadCount, Is.is(THREAD_COUNT)); Assert.assertThat(actualTotalStartedThreadCount, Is.is(TOTAL_STARTED_THREAD_COUNT)); Assert.assertThat(actualPeakThreadCount, Is.is(PEAK_THREAD_COUNT)); Assert.assertThat(actualDaemonThreadCount, Is.is(DAEMON_THREAD_COUNT)); }
private void updateDisplays() { // XY Plot final long timeStampDeltaInSeconds = (System.currentTimeMillis() - this.timeStampOfInitialization) / 1000; this.xyPlot.setEntry("", timeStampDeltaInSeconds, this.counter.get()); // Plain text this.plainText.setText(Long.toString(this.counter.get())); }
public AnomalyScoreVisualizationFilter(final Configuration configuration, final IProjectContext projectContext) { super(configuration, projectContext); this.numberOfEntries = configuration.getIntProperty(CONFIG_PROPERTY_NAME_NUMBER_OF_ENTRIES); this.xyplot = new XYPlot(this.numberOfEntries); }
/** * Tests if the xy-plot received the correct values. */ @Test public void xyPlotEntriesShouldBeCorrect() { StageTester.test(this.gcDisplayFilter).and().send(this.record).to(this.gcDisplayFilter.getInputPort()).start(); final Date date = new Date(TimeUnit.MILLISECONDS.convert(this.record.getLoggingTimestamp(), RECORDS_TIME_UNIT)); final String minutesAndSeconds = date.toString().substring(14, 19); final String id = this.record.getHostname() + " - " + this.record.getVmName() + " - " + this.record.getGcName(); final long actualCollectionCount = this.gcDisplayFilter.getXYPlot().getEntries(id + " - " + GCDisplayFilter.COLLECTION_COUNT).get(minutesAndSeconds) .longValue(); final long actualCollectionTime = this.gcDisplayFilter.getXYPlot().getEntries(id + " - " + GCDisplayFilter.COLLECTION_TIME).get(minutesAndSeconds) .longValue(); Assert.assertThat(actualCollectionCount, Is.is(COLLECTION_COUNT)); Assert.assertThat(actualCollectionTime, Is.is(COLLECTION_TIME_MS)); }
private void updateDisplays(final ThreadsStatusRecord record) { // Calculate the minutes and seconds of the logging timestamp of the record final Date date = new Date(TimeUnit.MILLISECONDS.convert(record.getLoggingTimestamp(), super.recordsTimeUnitFromProjectContext)); final String minutesAndSeconds = date.toString().substring(14, 19); final String id = record.getHostname() + " - " + record.getVmName(); this.xyplot.setEntry(id + " - " + ThreadsStatusDisplayFilter.THREADS, minutesAndSeconds, record.getThreadCount()); this.xyplot.setEntry(id + " - " + ThreadsStatusDisplayFilter.TOTAL_THREADS, minutesAndSeconds, record.getTotalStartedThreadCount()); this.xyplot.setEntry(id + " - " + ThreadsStatusDisplayFilter.PEAK_THREADS, minutesAndSeconds, record.getPeakThreadCount()); this.xyplot.setEntry(id + " - " + ThreadsStatusDisplayFilter.DAEMON_THREADS, minutesAndSeconds, record.getDaemonThreadCount()); }
public AnomalyScoreVisualizationFilter(final Configuration configuration, final IProjectContext projectContext) { super(configuration, projectContext); this.numberOfEntries = configuration.getIntProperty(CONFIG_PROPERTY_NAME_NUMBER_OF_ENTRIES); this.xyplot = new XYPlot(this.numberOfEntries); }
private void updateDisplays(final ThreadsStatusRecord record) { // Calculate the minutes and seconds of the logging timestamp of the record final Date date = new Date(TimeUnit.MILLISECONDS.convert(record.getLoggingTimestamp(), this.recordsTimeUnit)); final String minutesAndSeconds = date.toString().substring(14, 19); final String id = record.getHostname() + " - " + record.getVmName(); this.xyplot.setEntry(id + " - " + ThreadsStatusDisplayFilter.THREADS, minutesAndSeconds, record.getThreadCount()); this.xyplot.setEntry(id + " - " + ThreadsStatusDisplayFilter.TOTAL_THREADS, minutesAndSeconds, record.getTotalStartedThreadCount()); this.xyplot.setEntry(id + " - " + ThreadsStatusDisplayFilter.PEAK_THREADS, minutesAndSeconds, record.getPeakThreadCount()); this.xyplot.setEntry(id + " - " + ThreadsStatusDisplayFilter.DAEMON_THREADS, minutesAndSeconds, record.getDaemonThreadCount()); }
/** * Creates a new instance of this class using the given parameters. * * @param configuration * The configuration for this filter. * @param projectContext * The project context for this filter. */ public GCDisplayFilter(final Configuration configuration, final IProjectContext projectContext) { super(configuration, projectContext); // Read the configuration this.numberOfEntries = configuration.getIntProperty(CONFIG_PROPERTY_NAME_NUMBER_OF_ENTRIES); // Create the display objects this.xyplot = new XYPlot(this.numberOfEntries); }
private void updateDisplays(final ThreadsStatusRecord record) { // Calculate the minutes and seconds of the logging timestamp of the record final Date date = new Date(TimeUnit.MILLISECONDS.convert(record.getLoggingTimestamp(), super.recordsTimeUnitFromProjectContext)); final String minutesAndSeconds = date.toString().substring(14, 19); final String id = record.getHostname() + " - " + record.getVmName(); this.xyplot.setEntry(id + " - " + ThreadsStatusDisplayFilter.THREADS, minutesAndSeconds, record.getThreadCount()); this.xyplot.setEntry(id + " - " + ThreadsStatusDisplayFilter.TOTAL_THREADS, minutesAndSeconds, record.getTotalStartedThreadCount()); this.xyplot.setEntry(id + " - " + ThreadsStatusDisplayFilter.PEAK_THREADS, minutesAndSeconds, record.getPeakThreadCount()); this.xyplot.setEntry(id + " - " + ThreadsStatusDisplayFilter.DAEMON_THREADS, minutesAndSeconds, record.getDaemonThreadCount()); }
/** * Creates a new instance of this class using the given parameters. * * @param configuration * The configuration for this filter. * @param projectContext * The project context for this filter. */ public ThreadsStatusDisplayFilter(final Configuration configuration, final IProjectContext projectContext) { super(configuration, projectContext); // Read the configuration this.numberOfEntries = configuration.getIntProperty(CONFIG_PROPERTY_NAME_NUMBER_OF_ENTRIES); // Create the display objects this.xyplot = new XYPlot(this.numberOfEntries); }
private void updateDisplays(final StorableDetectionResult record) { final Date date = new Date(TimeUnit.MILLISECONDS.convert(record.getTimestamp(), super.recordsTimeUnitFromProjectContext)); final String minutesAndSeconds = date.toString().substring(14, 19); this.xyplot.setEntry(record.getApplicationName() + " - Actual Value", minutesAndSeconds, record.getValue()); this.xyplot.setEntry(record.getApplicationName() + " - Forecast", minutesAndSeconds, record.getForecast()); }
/** * Creates a new instance of this class using the given parameters. * * @param configuration * The configuration for this filter. * @param projectContext * The project context for this filter. */ public ThreadsStatusDisplayFilter(final Configuration configuration, final IProjectContext projectContext) { super(configuration, projectContext); // Read the configuration this.numberOfEntries = configuration.getIntProperty(CONFIG_PROPERTY_NAME_NUMBER_OF_ENTRIES); // Create the display objects this.xyplot = new XYPlot(this.numberOfEntries); }
private void updateDisplays(final StorableDetectionResult record) { final Date date = new Date(TimeUnit.MILLISECONDS.convert(record.getTimestamp(), super.recordsTimeUnitFromProjectContext)); final String minutesAndSeconds = date.toString().substring(14, 19); this.xyplot.setEntry(record.getApplicationName() + " - Actual Value", minutesAndSeconds, record.getValue()); this.xyplot.setEntry(record.getApplicationName() + " - Forecast", minutesAndSeconds, record.getForecast()); }
/** * Creates a new instance of this class using the given parameters. * * @param configuration * The configuration for this filter. * @param projectContext * The project context for this filter. */ public GCDisplayFilter(final Configuration configuration, final IProjectContext projectContext) { super(configuration, projectContext); // Read the configuration this.numberOfEntries = configuration.getIntProperty(CONFIG_PROPERTY_NAME_NUMBER_OF_ENTRIES); // Create the display objects this.xyplot = new XYPlot(this.numberOfEntries); }