Category: RandomQueryGenerator

Category:RandomQueryGeneratorReporters


[edit] Overview

The Reporters are extra modules that perform checks on the server while the test is running and after the test has terminated. Unlike Validators, they are not related to the result of a particular query and are run in a separate monitoring process. By default, the Deadlock, ErrorLog and Backtrace are enabled.

[edit] Interface

A Reporter is a Perl module that inherits from the GenTest::Reporter class. It has the following methods:

Returns the type of the reporter, which may be one or more (OR-ed) of the following constants:

- REPORTER_TYPE_PERIODIC - the Reporter's monitor() method is called once every 10 seconds during the test;

- REPORTER_TYPE_CRASH - the Reporter's report() method is called if the test fails due to a server crash. This is used by the Backtrace reporter to print the crash backtrace from the core file;

- REPORTER_TYPE_DEADLOCK - the report() method is called if a server deadlock or hang is detected;

- REPORTER_TYPE_DATA - the report() method is called if the test was terminated due to a data length or content mismatch;

- REPORTER_TYPE_SERVER_KILLED - report() is called in case the server was killed or shut down during the test;

- REPORTER_TYPE_SUCCESS - the </tt>report()</tt> method is called if the test was successfull;

- REPORTER_TYPE_ALWAYS - report() is called at the end of the test regardless of how the test ended;

If the Reporter is defined as REPORTER_TYPE_PERIODIC, its monitor() method will be called once every 10 seconds. Since individual Reporters are executed sequentially within the same thread, it is important not to sleep() inside monitor() so that the other Reporters also have their chance to run.

If you wish to execute a particular action at a particular time, rather than periodically, return STATUS_OK until it is time to act:

sub monitor {
  my $reporter = shift;

  if (time() > $reporter->testEnd() - 10) {
    # Test will terminate in 10 seconds, so it is time to do our thing
    ...
  } else {
    return STATUS_OK;
  }
}

[edit] Available Reporters

The following Reporters are available:


Articles in category "RandomQueryGeneratorReporters"

There are 0 articles in this category.

Retrieved from "http://forge.mysql.com/wiki/Category:RandomQueryGeneratorReporters"

This page has been accessed 394 times. This page was last modified 11:17, 21 May 2010.

Find

Browse
MySQLForge
Main Page
Current events
Recent changes
Random page
Help
Edit
Edit this page
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Special pages
New pages
File list
Statistics
Bug reports
More...