function extract(response, user_state)
	{
	// This example script extracts the title of the page
	var content = response.getContent(); 
	var prefix = '<title>';
	var start = content.indexOf(prefix);
	if (start <= 0)
		return null;
	start += prefix.length;
	var end = content.indexOf('</title>', start);
	if (end < 0)
		return null;
	return content.substring(start, end);  
	}

function getExampleUserstateVariables()
    {
    // This method provides example values for USVs for evaluation in the UI. This method
    // is optional and it will not be called during VU execution (replays and load tests).
    var values = new java.util.HashMap();
    values.put('x', '7');
    values.put('y', '8');
    return values;
    }

/*
 * Reading values from a dataset
 * -----------------------------
 * Scripts can pull the current VU's dataset-row values via
 * user_state.getDatasetParameter(datasetName, fieldName). Repeated calls to
 * the same dataset within one VU iteration return values from the SAME row
 * (the row is locked per VU). Uncomment and adapt the names to datasets in
 * your project.
 *
 * // // Fetch two columns from the same dataset row:
 * // var email = user_state.getDatasetParameter("Active Logins", "email_address");
 * // var pass  = user_state.getDatasetParameter("Active Logins", "passcode");
 * //
 * // // Example: build a Basic-auth token value "base64(email:passcode)".
 * // // Wrap the JS-concat result so java.lang.String.getBytes() works:
 * // var combined = new java.lang.String(email + ":" + pass);
 * // var token    = java.util.Base64.getEncoder().encodeToString(combined.getBytes("UTF-8"));
 * // return token;
 *
 * Notes:
 * - Dataset and field names must match the Datasets view exactly.
 * - Missing dataset or field throws DatasetExhaustedError /
 *   MissingParameterException at runtime.
 * - Non-reusable datasets consume one row per VU; reusable datasets release
 *   the row per their lifespan.
 */