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

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


   * Tests serialization/deserialization for {@link SingleInstanceProfilingEvent}.
   */
  @Test
  public void testSingleInstanceProfilingEvent() {
    try {
      final SingleInstanceProfilingEvent orig = new SingleInstanceProfilingEvent(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, INSTANCE_NAME);
 
      final SingleInstanceProfilingEvent copy = (SingleInstanceProfilingEvent) CommonTestUtils.createCopyWritable(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.getInstanceName(), copy.getInstanceName());
      assertEquals(orig.hashCode(), copy.hashCode());
      assertTrue(orig.equals(copy));
    }
    catch (Exception e) {
      e.printStackTrace();
      fail(e.getMessage());
View Full Code Here


        final JobProfilingData jobProfilingData = this.registeredJobs.get(jobID);
        if (!jobProfilingData.addIfInstanceIsAllocatedByJob(profilingData)) {
          continue;
        }

        final SingleInstanceProfilingEvent singleInstanceProfilingEvent = new SingleInstanceProfilingEvent(
          profilingData.getProfilingInterval(), profilingData.getIOWaitCPU(), profilingData.getIdleCPU(),
          profilingData.getUserCPU(), profilingData.getSystemCPU(), profilingData.getHardIrqCPU(),
          profilingData.getSoftIrqCPU(), profilingData.getTotalMemory(), profilingData.getFreeMemory(),
          profilingData.getBufferedMemory(), profilingData.getCachedMemory(), profilingData
            .getCachedSwapMemory(), profilingData.getReceivedBytes(), profilingData.getTransmittedBytes(),
View Full Code Here

TOP

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

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.