sendProfileData method
Sends the profile data collected by the benchmark to the local benchmark server.
Implementation
Future<void> sendProfileData(Profile profile) async {
_checkNotManualMode();
final XMLHttpRequest request = await _requestXhr(
'/profile-data',
method: 'POST',
mimeType: 'application/json',
sendData: json.encode(profile.toJson()),
);
if (request.status != 200) {
throw Exception('Failed to report profile data to benchmark server. '
'The server responded with status code ${request.status}.');
}
}