Interface Filter

  • All Implemented Interfaces:

    
    public interface Filter
    
                        

    Description: Filter interface is designed to make it easier to use Access Logs for JMeter test plans. Normally, a person would have to clean a log file manually and create the JMeter requests. The access log parse utility uses the filter to include/exclude files by either file name or regular expression pattern.

    It will also be used by HttpSamplers that use access logs. Using access logs is intended as a way to simulate production traffic. For functional testing, it is better to use the standard functional testing tools in JMeter. Using access logs can also reduce the amount of memory needed to run large test plans.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract void setReplaceExtension(String oldextension, String newextension)
      abstract void includeFiles(Array<String> filenames) Include all files in the array.
      abstract void excludeFiles(Array<String> filenames) Exclude all files in the array
      abstract void includePattern(Array<String> regexp) Include any log entry that contains the following regular expression pattern.
      abstract void excludePattern(Array<String> regexp) Exclude any log entry that contains the following regular expression pattern.
      abstract boolean isFiltered(String path, TestElement sampler) Log parser will call this method to see if a particular entry should be filtered or not.
      abstract String filter(String text) In case the user wants to replace the file extension, log parsers should call this method.
      abstract void reset() Tell the filter when the parsing has reached the end of the log file and is about to begin again.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • setReplaceExtension

         abstract void setReplaceExtension(String oldextension, String newextension)
        Parameters:
        oldextension - old extension
        newextension - new extension
      • includeFiles

         abstract void includeFiles(Array<String> filenames)

        Include all files in the array.

        Parameters:
        filenames - names of files to include
      • excludeFiles

         abstract void excludeFiles(Array<String> filenames)

        Exclude all files in the array

        Parameters:
        filenames - names of files to exclude
      • includePattern

         abstract void includePattern(Array<String> regexp)

        Include any log entry that contains the following regular expression pattern.

        Parameters:
        regexp - list of regexp that match entries that should be included
      • excludePattern

         abstract void excludePattern(Array<String> regexp)

        Exclude any log entry that contains the following regular expression pattern.

        Parameters:
        regexp - list of regexp that match entries that should be excluded
      • isFiltered

         abstract boolean isFiltered(String path, TestElement sampler)

        Log parser will call this method to see if a particular entry should be filtered or not.

        Parameters:
        path - log line that should be checked if it should to be filtered out
        sampler - TestElement in which the line would be added
        Returns:

        boolean true if line should be filtered out, false otherwise

      • filter

         abstract String filter(String text)

        In case the user wants to replace the file extension, log parsers should call this method. This is useful for regression test plans. If a website is migrating from one platform to another and the file extension changes, the filter provides an easy way to do it without spending a lot of time.

        Parameters:
        text - log line to be filtered
        Returns:

        String

      • reset

         abstract void reset()

        Tell the filter when the parsing has reached the end of the log file and is about to begin again. Gives the filter a chance to adjust it's values, if needed.