Tabnine Logo
IPlatformSensor.reset
Code IndexAdd Tabnine to your IDE (free)

How to use
reset
method
in
rocks.inspectit.agent.java.sensor.platform.IPlatformSensor

Best Java code snippets using rocks.inspectit.agent.java.sensor.platform.IPlatformSensor.reset (Showing top 3 results out of 315)

origin: inspectIT/inspectIT

platformSensor.reset();
origin: inspectIT/inspectIT

@Test
public void platformSensor() {
  when(jmxSensors.isEmpty()).thenReturn(true);
  doAnswer(new Answer<Iterator<?>>() {
    @Override
    public Iterator<?> answer(InvocationOnMock invocation) throws Throwable {
      return new ArrayIterator(new IPlatformSensor[] { platformSensor });
    }
  }).when(platformSensors).iterator();
  Runnable sensorRefresher = coreService.new SensorRefresher();
  sensorRefresher.run();
  verify(platformSensor).reset();
  verify(platformSensor).gather();
  verifyNoMoreInteractions(platformSensor);
}
origin: inspectIT/inspectIT

@Test
public void platformSensorCollect() throws InterruptedException, StorageException {
  when(jmxSensors.isEmpty()).thenReturn(true);
  doAnswer(new Answer<Iterator<?>>() {
    @Override
    public Iterator<?> answer(InvocationOnMock invocation) throws Throwable {
      return new ArrayIterator(new IPlatformSensor[] { platformSensor });
    }
  }).when(platformSensors).iterator();
  SystemInformationData sid = mock(SystemInformationData.class);
  when(platformSensor.get()).thenReturn(sid);
  when(disruptorStrategy.getDataBufferSize()).thenReturn(8);
  coreService.start();
  Runnable sensorRefresher = coreService.new SensorRefresher();
  sensorRefresher.run();
  sensorRefresher.run();
  sensorRefresher.run();
  sensorRefresher.run();
  sensorRefresher.run();
  verify(platformSensor).reset();
  verify(platformSensor, times(5)).gather();
  verify(platformSensor).get();
  verifyNoMoreInteractions(platformSensor);
  // need to sleep a bit so handler is notified
  Thread.sleep(100);
  ArgumentCaptor<DefaultDataWrapper> captor = ArgumentCaptor.forClass(DefaultDataWrapper.class);
  verify(defaultDataHandler).onEvent(captor.capture(), anyLong(), eq(true));
  assertThat(captor.getValue().getDefaultData(), is((DefaultData) sid));
}
rocks.inspectit.agent.java.sensor.platformIPlatformSensorreset

Javadoc

Reset any saved state in the sensor. Used to reset the sensor data collector class.

Popular methods of IPlatformSensor

  • gather
    This method is called whenever the sensor should be updated.
  • get
    Get the corresponding collector class of type SystemSensorData.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • putExtra (Intent)
  • onCreateOptionsMenu (Activity)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • String (java.lang)
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Best IntelliJ plugins
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