Package org.apache.flink.runtime.profiling.types

Examples of org.apache.flink.runtime.profiling.types.InstanceSummaryProfilingEvent


   * Tests serialization/deserialization for {@link InstanceSummaryProfilingEvent}.
   */
  @Test
  public void testInstanceSummaryProfilingEvent() {

    final InstanceSummaryProfilingEvent orig = new InstanceSummaryProfilingEvent(PROFILING_INTERVAL, IOWAIT_CPU,
      IDLE_CPU, USER_CPU, SYSTEM_CPU, HARD_IRQ_CPU, SOFT_IRQ_CPU, TOTAL_MEMORY, FREE_MEMORY, BUFFERED_MEMORY,
      CACHED_MEMORY, CACHED_SWAP_MEMORY, RECEIVED_BYTES, TRANSMITTED_BYTES, new JobID(), TIMESTAMP,
      PROFILING_TIMESTAMP);

    final InstanceSummaryProfilingEvent copy = (InstanceSummaryProfilingEvent) ManagementTestUtils.createCopy(orig);

    assertEquals(orig.getProfilingInterval(), copy.getProfilingInterval());
    assertEquals(orig.getIOWaitCPU(), copy.getIOWaitCPU());
    assertEquals(orig.getIdleCPU(), copy.getIdleCPU());
    assertEquals(orig.getUserCPU(), copy.getUserCPU());
    assertEquals(orig.getSystemCPU(), copy.getSystemCPU());
    assertEquals(orig.getHardIrqCPU(), copy.getHardIrqCPU());
    assertEquals(orig.getSoftIrqCPU(), copy.getSoftIrqCPU());
    assertEquals(orig.getTotalMemory(), copy.getTotalMemory());
    assertEquals(orig.getFreeMemory(), copy.getFreeMemory());
    assertEquals(orig.getBufferedMemory(), copy.getBufferedMemory());
    assertEquals(orig.getCachedMemory(), copy.getCachedMemory());
    assertEquals(orig.getCachedSwapMemory(), copy.getCachedSwapMemory());
    assertEquals(orig.getReceivedBytes(), copy.getReceivedBytes());
    assertEquals(orig.getTransmittedBytes(), copy.getTransmittedBytes());
    assertEquals(orig.getJobID(), copy.getJobID());
    assertEquals(orig.getTimestamp(), copy.getTimestamp());
    assertEquals(orig.getProfilingTimestamp(), copy.getProfilingTimestamp());
    assertEquals(orig.hashCode(), copy.hashCode());
    assertTrue(orig.equals(copy));
  }
View Full Code Here


      bufferedMemorySum += profilingData.getBufferedMemory();
      cachedMemorySum += profilingData.getCachedMemory();
      cachedSwapMemorySum += profilingData.getCachedSwapMemory();
    }

    final InstanceSummaryProfilingEvent instanceSummary = new InstanceSummaryProfilingEvent(
        profilingIntervalSum / numberOfInstances,
        ioWaitCPUSum / numberOfInstances,
        idleCPUSum / numberOfInstances,
        userCPUSum / numberOfInstances,
        systemCPUSum / numberOfInstances,
View Full Code Here

          List<ProfilingListener> jobListeners = this.registeredListeners.get(jobID);
          if (jobListeners == null) {
            continue;
          }

          final InstanceSummaryProfilingEvent instanceSummary = jobProfilingData
            .getInstanceSummaryProfilingData(timestamp);

          final Iterator<ProfilingListener> listenerIterator = jobListeners.iterator();
          while (listenerIterator.hasNext()) {
            final ProfilingListener profilingListener = listenerIterator.next();
View Full Code Here

TOP

Related Classes of org.apache.flink.runtime.profiling.types.InstanceSummaryProfilingEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.