Tabnine Logo
MemoryInfoProvider
Code IndexAdd Tabnine to your IDE (free)

How to use
MemoryInfoProvider
in
rocks.inspectit.agent.java.sensor.platform.provider

Best Java code snippets using rocks.inspectit.agent.java.sensor.platform.provider.MemoryInfoProvider (Showing top 9 results out of 315)

origin: inspectIT/inspectIT

  protected void mockCollectorWithDefaults() {
    MemoryUsage heapMemoryUsage = Mockito.mock(MemoryUsage.class);
    when(heapMemoryUsage.getUsed()).thenReturn(0L);
    when(heapMemoryUsage.getCommitted()).thenReturn(0L);

    MemoryUsage nonHeapMemoryUsage = Mockito.mock(MemoryUsage.class);
    when(nonHeapMemoryUsage.getUsed()).thenReturn(0L);
    when(nonHeapMemoryUsage.getCommitted()).thenReturn(0L);

    when(this.osBean.getFreePhysicalMemorySize()).thenReturn(0L);
    when(this.osBean.getFreeSwapSpaceSize()).thenReturn(0L);
    when(this.osBean.getCommittedVirtualMemorySize()).thenReturn(0L);
    when(this.memoryBean.getHeapMemoryUsage()).thenReturn(heapMemoryUsage);
    when(this.memoryBean.getNonHeapMemoryUsage()).thenReturn(nonHeapMemoryUsage);
  }
}
origin: inspectIT/inspectIT

@Test
void usedHeapMemorySizeIsCalculated() {
  this.mockCollectorWithDefaults();
  MemoryUsage heapMemoryUsage = this.memoryBean.getHeapMemoryUsage();
  when(heapMemoryUsage.getUsed()).thenReturn(10L).thenReturn(9L).thenReturn(11L).thenReturn(10L);
  this.cut.gather();
  this.cut.gather();
  this.cut.gather();
  this.cut.gather();
  MemoryInformationData collector = (MemoryInformationData) this.cut.get();
  assertThat(collector.getMinUsedHeapMemorySize(), is(9L));
  assertThat(collector.getMaxUsedHeapMemorySize(), is(11L));
  assertThat(collector.getTotalUsedHeapMemorySize(), is(40L));
}
origin: inspectIT/inspectIT

@Test
void usedNonHeapMemorySizeIsCalculated() {
  this.mockCollectorWithDefaults();
  MemoryUsage nonHeapMemoryUsage = this.memoryBean.getNonHeapMemoryUsage();
  when(nonHeapMemoryUsage.getUsed()).thenReturn(10L).thenReturn(9L).thenReturn(11L).thenReturn(10L);
  this.cut.gather();
  this.cut.gather();
  this.cut.gather();
  this.cut.gather();
  MemoryInformationData collector = (MemoryInformationData) this.cut.get();
  assertThat(collector.getMinUsedNonHeapMemorySize(), is(9L));
  assertThat(collector.getMaxUsedNonHeapMemorySize(), is(11L));
  assertThat(collector.getTotalUsedNonHeapMemorySize(), is(40L));
}
origin: inspectIT/inspectIT

@Test
void comittedHeapMemorySizeIsCalculated() {
  this.mockCollectorWithDefaults();
  MemoryUsage heapMemoryUsage = this.memoryBean.getHeapMemoryUsage();
  when(heapMemoryUsage.getCommitted()).thenReturn(10L).thenReturn(9L).thenReturn(11L).thenReturn(10L);
  this.cut.gather();
  this.cut.gather();
  this.cut.gather();
  this.cut.gather();
  MemoryInformationData collector = (MemoryInformationData) this.cut.get();
  assertThat(collector.getMinComittedHeapMemorySize(), is(9L));
  assertThat(collector.getMaxComittedHeapMemorySize(), is(11L));
  assertThat(collector.getTotalComittedHeapMemorySize(), is(40L));
}
origin: inspectIT/inspectIT

@Test
void comittedNonHeapMemorySizeIsCalculated() {
  this.mockCollectorWithDefaults();
  MemoryUsage nonHeapMemoryUsage = this.memoryBean.getNonHeapMemoryUsage();
  when(nonHeapMemoryUsage.getCommitted()).thenReturn(10L).thenReturn(9L).thenReturn(11L).thenReturn(10L);
  this.cut.gather();
  this.cut.gather();
  this.cut.gather();
  this.cut.gather();
  MemoryInformationData collector = (MemoryInformationData) this.cut.get();
  assertThat(collector.getMinComittedNonHeapMemorySize(), is(9L));
  assertThat(collector.getMaxComittedNonHeapMemorySize(), is(11L));
  assertThat(collector.getTotalComittedNonHeapMemorySize(), is(40L));
}
origin: inspectIT/inspectIT

when(heapMemoryUsage.getInit()).thenReturn(16L);
when(heapMemoryUsage.getMax()).thenReturn(17L);
when(this.memoryBean.getHeapMemoryUsage()).thenReturn(heapMemoryUsage);
when(this.memoryBean.getNonHeapMemoryUsage()).thenReturn(nonHeapMemoryUsage);
origin: inspectIT/inspectIT

when(heapMemoryUsageA.getInit()).thenReturn(16L);
when(heapMemoryUsageA.getMax()).thenReturn(17L);
when(this.memoryBean.getHeapMemoryUsage()).thenReturn(heapMemoryUsageA);
when(this.memoryBean.getNonHeapMemoryUsage()).thenReturn(nonHeapMemoryUsageA);
when(heapMemoryUsageB.getInit()).thenReturn(1600L);
when(heapMemoryUsageB.getMax()).thenReturn(1700L);
when(this.memoryBean.getHeapMemoryUsage()).thenReturn(heapMemoryUsageB);
when(this.memoryBean.getNonHeapMemoryUsage()).thenReturn(nonHeapMemoryUsageB);
origin: inspectIT/inspectIT

this.systemInformationData.setVmSpecName(this.getRuntimeBean().getSpecName());
this.systemInformationData.setInitHeapMemorySize(this.getMemoryBean().getHeapMemoryUsage().getInit());
this.systemInformationData.setMaxHeapMemorySize(this.getMemoryBean().getHeapMemoryUsage().getMax());
this.systemInformationData.setInitNonHeapMemorySize(this.getMemoryBean().getNonHeapMemoryUsage().getInit());
this.systemInformationData.setMaxNonHeapMemorySize(this.getMemoryBean().getNonHeapMemoryUsage().getMax());
origin: inspectIT/inspectIT

long freeSwapSpace = this.getOsBean().getFreeSwapSpaceSize();
long comittedVirtualMemSize = this.getOsBean().getCommittedVirtualMemorySize();
long usedHeapMemorySize = this.getMemoryBean().getHeapMemoryUsage().getUsed();
long comittedHeapMemorySize = this.getMemoryBean().getHeapMemoryUsage().getCommitted();
long usedNonHeapMemorySize = this.getMemoryBean().getNonHeapMemoryUsage().getUsed();
long comittedNonHeapMemorySize = this.getMemoryBean().getNonHeapMemoryUsage().getCommitted();
rocks.inspectit.agent.java.sensor.platform.providerMemoryInfoProvider

Javadoc

The management interface for the memory system of the Java virtual machine.

Most used methods

  • getHeapMemoryUsage
    Returns the current memory usage of the heap that is used for object allocation. The heap consists o
  • getNonHeapMemoryUsage
    Returns the current memory usage of non-heap memory that is used by the Java virtual machine. The no

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Path (java.nio.file)
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JFileChooser (javax.swing)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now