Class MonitorAccumModel
java.lang.Object
org.apache.jmeter.visualizers.MonitorAccumModel
- All Implemented Interfaces:
Serializable, Clearable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(MonitorListener listener) Add a listener.voidaddSample(SampleResult sample) Method will try to parse the response data.voidaddSample(MonitorModel model) Method will look up the server in the map.voidClears everything except the listener.createNewMonitorModel(URL url) Method will return a new MonitorModel object with the given URL.getAllSamples(String url) Get all MonitorModels matching the URL.intAdded this method we that we can save the calculated stats.Get the MonitorModel matching the url.voidnoResponse(URL url) If there is no response from the server, we create a new MonitorStats object with the current timestamp and health "dead".voidnotifyListeners(MonitorModel model) notify the listeners with the MonitorModel object.voidsetBufferSize(int buffer) void
-
Constructor Details
-
MonitorAccumModel
public MonitorAccumModel()
-
-
Method Details
-
getBufferSize
public int getBufferSize() -
setBufferSize
public void setBufferSize(int buffer) -
setPrefix
-
getLastSample
Added this method we that we can save the calculated stats.- Returns:
- current sample
-
addSample
Method will look up the server in the map. The MonitorModel will be added to an existing list, or a new one will be created.- Parameters:
model- theMonitorModelto be added
-
getAllSamples
Get all MonitorModels matching the URL.- Parameters:
url- to be matched against- Returns:
- list
-
getSample
Get the MonitorModel matching the url.- Parameters:
url- to be matched against- Returns:
- the first
MonitorModelregistered for thisurl
-
addSample
Method will try to parse the response data. If the request was a monitor request, but the response was incomplete, bad or the server refused the connection, we will set the server's health to "dead". If the request was not a monitor sample, the method will ignore it.- Parameters:
sample-SampleResultwith the result of the status request
-
noResponse
If there is no response from the server, we create a new MonitorStats object with the current timestamp and health "dead".- Parameters:
url- URL from where the status should have come
-
createNewMonitorModel
Method will return a new MonitorModel object with the given URL. This is used when the server fails to respond fully, or is dead.- Parameters:
url- URL from where the status should have come- Returns:
- new MonitorModel
-
clearData
-
notifyListeners
notify the listeners with the MonitorModel object.- Parameters:
model- theMonitorModelthat should be sent to the listeners
-
addListener
Add a listener. When samples are added, the class will notify the listener of the change.- Parameters:
listener- theMonitorListenerthat should be added
-