def METHOD_NAME(self):
    """
    PostgreSQL module outputs an event.
    """
    hosts, username, password = self.get_hosts()
    self.render_config_template(modules=[{
        "name": "postgresql",
        "metricsets": ["statement"],
        "hosts": hosts,
        "username": username,
        "password": password,
        "period": "5s"
    }])
    proc = self.start_beat()
    self.wait_until(lambda: self.output_lines() > 0)
    proc.check_kill_and_wait()
    output = self.read_output_json()
    self.common_checks(output)
    for evt in output:
        statement = evt["postgresql"]["statement"]
        assert "user" in statement
        assert "database" in statement
        assert "query" in statement
        assert "ms" in statement["query"]["time"]["max"]
        assert "ms" in statement["query"]["time"]["total"]