Tabnine Logo
IBuffer.getOldestElement
Code IndexAdd Tabnine to your IDE (free)

How to use
getOldestElement
method
in
rocks.inspectit.server.cache.IBuffer

Best Java code snippets using rocks.inspectit.server.cache.IBuffer.getOldestElement (Showing top 3 results out of 315)

origin: inspectIT/inspectIT

/**
 * Tests copy buffer action.
 */
@Test
public void copyBufferToStorage() throws IOException, SerializationException, BusinessException {
  storageData = new StorageData();
  storageData.setName("Test");
  DefaultData defaultData = mock(DefaultData.class);
  Timestamp timestamp = mock(Timestamp.class);
  when(defaultData.getTimeStamp()).thenReturn(timestamp);
  when(buffer.getOldestElement()).thenReturn(defaultData);
  List<DefaultData> data = Collections.singletonList(mock(DefaultData.class));
  Collection<AbstractDataProcessor> processors = Collections.singleton(mock(AbstractDataProcessor.class));
  Long platformId = 10L;
  List<Long> platformIdents = Collections.singletonList(platformId);
  storageManager = spy(storageManager);
  when(storageDataDao.getAllDefaultDataForAgent(eq(platformId), Matchers.<Date> any(), Matchers.<Date> any())).thenReturn(data);
  // first with no auto-finalize
  storageManager.copyBufferToStorage(storageData, platformIdents, processors, false);
  verify(storageDataDao, times(1)).getAllDefaultDataForAgent(eq(platformId), Matchers.<Date> any(), Matchers.<Date> any());
  verify(storageManager, times(1)).writeToStorage(storageData, data, processors, true);
  // first with auto-finalize
  storageManager.copyBufferToStorage(storageData, platformIdents, processors, true);
  verify(storageDataDao, times(2)).getAllDefaultDataForAgent(eq(platformId), Matchers.<Date> any(), Matchers.<Date> any());
  verify(storageManager, times(2)).writeToStorage(storageData, data, processors, true);
  assertThat(storageManager.isStorageClosed(storageData), is(true));
}
origin: inspectIT/inspectIT

DefaultData oldestBufferElement = buffer.getOldestElement();
origin: inspectIT/inspectIT

/**
 * {@inheritDoc}
 */
@Override
@MethodLog
public CmrStatusData getCmrStatusData() {
  // cmr status data should always report in bytes!
  CmrStatusData cmrStatusData = new CmrStatusData();
  cmrStatusData.setCurrentBufferSize(buffer.getCurrentSize());
  cmrStatusData.setMaxBufferSize(buffer.getMaxSize());
  DefaultData oldestElement = buffer.getOldestElement();
  if (null != oldestElement) {
    cmrStatusData.setBufferOldestElementDate(new Date(oldestElement.getTimeStamp().getTime()));
  }
  DefaultData newestElement = buffer.getNewestElement();
  if (null != newestElement) {
    cmrStatusData.setBufferNewestElementDate(new Date(newestElement.getTimeStamp().getTime()));
  }
  cmrStatusData.setStorageDataSpaceLeft(storageManager.getBytesHardDriveOccupancyLeft());
  cmrStatusData.setStorageMaxDataSpace(storageManager.getMaxBytesHardDriveOccupancy());
  cmrStatusData.setWarnSpaceLeftActive(storageManager.isSpaceWarnActive());
  cmrStatusData.setCanWriteMore(storageManager.canWriteMore());
  cmrStatusData.setUpTime(System.currentTimeMillis() - timeStarted);
  cmrStatusData.setDateStarted(dateStarted);
  cmrStatusData.setDatabaseSize(getDatabaseSize());
  for (IExternalService service : services) {
    cmrStatusData.getExternalServiceStatusMap().put(service.getServiceType(), service.getServiceStatus());
  }
  return cmrStatusData;
}
rocks.inspectit.server.cacheIBuffergetOldestElement

Popular methods of IBuffer

  • put
    Puts one IBufferElement in the buffer.
  • analyzeNext
    Performs the size analysis of one IBufferElement in the buffer, that is next in the line for analysi
  • clearAll
    Empties buffer.
  • evict
    Performs the eviction from the buffer. The element or elements that needs to be evicted depends on b
  • getCurrentSize
    Returns current size of the buffer.
  • getMaxSize
    Returns max size of the buffer.
  • getNewestElement
  • getOccupancyPercentage
    Returns current occupancy percentage of the buffer.
  • indexNext
    Performs the indexing of one IBufferElement in the buffer, that is next in the line for indexing.

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getContentResolver (Context)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Top plugins for WebStorm
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