use of org.rstudio.studio.client.workbench.views.source.editors.profiler.model.ProfileOperationRequest in project rstudio by rstudio.
the class ProfilerPresenter method buildHtmlPath.
public void buildHtmlPath(final OperationWithInput<ProfileOperationResponse> continuation, final Operation onError, final String path) {
ProfileOperationRequest request = ProfileOperationRequest.create(path);
server_.openProfile(request, new ServerRequestCallback<ProfileOperationResponse>() {
@Override
public void onResponseReceived(ProfileOperationResponse response) {
if (response.getErrorMessage() != null) {
globalDisplay_.showErrorMessage("Profiler Error", response.getErrorMessage());
onError.execute();
return;
}
continuation.execute(response);
}
@Override
public void onError(ServerError error) {
Debug.logError(error);
globalDisplay_.showErrorMessage("Failed to Open Profile", error.getMessage());
onError.execute();
}
});
}
use of org.rstudio.studio.client.workbench.views.source.editors.profiler.model.ProfileOperationRequest in project rstudio by rstudio.
the class ProfilerPresenter method onStartProfiler.
@Handler
public void onStartProfiler() {
dependencyManager_.withProfvis(profilerDependecyUserAction_, new Command() {
@Override
public void execute() {
ProfileOperationRequest request = ProfileOperationRequest.create("");
server_.startProfiling(request, new ServerRequestCallback<ProfileOperationResponse>() {
@Override
public void onResponseReceived(ProfileOperationResponse response) {
if (response.getErrorMessage() != null) {
globalDisplay_.showErrorMessage("Profiler Error", response.getErrorMessage());
return;
}
pSourceWindowManager_.get().ensureVisibleSourcePaneIfNecessary();
response_ = response;
sourceServer_.newDocument(FileTypeRegistry.PROFILER.getTypeId(), null, (JsObject) ProfilerContents.create(response.getFileName(), null, null, true).cast(), new SimpleRequestCallback<SourceDocument>("Show Profiler") {
@Override
public void onResponseReceived(SourceDocument response) {
currentDocId_ = response.getId();
}
@Override
public void onError(ServerError error) {
Debug.logError(error);
}
});
}
@Override
public void onError(ServerError error) {
Debug.logError(error);
globalDisplay_.showErrorMessage("Failed to Stop Profiler", error.getMessage());
}
});
}
});
}
use of org.rstudio.studio.client.workbench.views.source.editors.profiler.model.ProfileOperationRequest in project rstudio by rstudio.
the class ProfilerPresenter method onStopProfiler.
@Handler
public void onStopProfiler() {
ProfileOperationRequest request = ProfileOperationRequest.create(response_ != null ? response_.getFileName() : null);
response_ = null;
server_.stopProfiling(request, new ServerRequestCallback<ProfileOperationResponse>() {
@Override
public void onResponseReceived(ProfileOperationResponse response) {
if (response.getErrorMessage() != null) {
globalDisplay_.showErrorMessage("Profiler Error", response.getErrorMessage());
return;
}
}
@Override
public void onError(ServerError error) {
Debug.logError(error);
globalDisplay_.showErrorMessage("Failed to Stop Profiler", error.getMessage());
}
});
}
Aggregations