Browse Source

Omit timings in production mode (#19644)

* UIDL responses only include server side timing information when not
in production mode.
* Update documentation accordingly.

Change-Id: I961d1fdc96b3d04f22254fcd13a5412f17118b42
tags/7.7.0.alpha1
Henri Sara 8 years ago
parent
commit
05003bafeb

+ 2
- 0
WebContent/release-notes.html View File

@@ -142,6 +142,8 @@
This default can be changed in deployment configuration.</li>
<li>The annotations @PreserveOnRefresh, @Push, @Theme, @Title, @VaadinServletConfiguration and @Widgetset now use
@Inherited. The annotation is also looked up in extended interfaces for backwards compatibility.</li>
<li>Server-side timings of request processing are only sent to the client when not in production mode. Using the
timings in TestBench tests requires the server not to be in production mode.</li>
</ul>
<h3 id="knownissues">Known Issues and Limitations</h3>
<ul>

+ 5
- 1
client/src/com/vaadin/client/ApplicationConnection.java View File

@@ -491,7 +491,11 @@ public class ApplicationConnection implements HasHandlers {
smh.@com.vaadin.client.communication.MessageHandler::lastProcessingTime,
smh.@com.vaadin.client.communication.MessageHandler::totalProcessingTime
];
pd = pd.concat(smh.@com.vaadin.client.communication.MessageHandler::serverTimingInfo);
if (null != smh.@com.vaadin.client.communication.MessageHandler::serverTimingInfo) {
pd = pd.concat(smh.@com.vaadin.client.communication.MessageHandler::serverTimingInfo);
} else {
pd = pd.concat(-1, -1);
}
pd[pd.length] = smh.@com.vaadin.client.communication.MessageHandler::bootstrapTime;
return pd;
});

+ 9
- 3
documentation/advanced/advanced-debug.asciidoc View File

@@ -14,14 +14,20 @@ debug features for Vaadin developers:
* Debug Window
* Display debug information in the Debug Window and server console
* On-the-fly compilation of Sass themes
* Timings of server calls for Vaadin TestBench

It is recommended to always deploy production applications in production mode
for security reasons.

[[advanced.debug.mode]]
== Enabling the Debug Mode

The debug mode is enabled and production mode disabled by default in the UI
templates created with the Eclipse plugin or the Maven archetypes. The debug
mode can be enabled by giving a [parameter]#productionMode=false# parameter to
the Vaadin servlet configuration:
templates created with the Eclipse plugin or the Maven archetypes. Some
archetypes have a separate module and profile for producing a production mode
application. The debug mode can be enabled by giving a
[parameter]#productionMode=false# parameter to the Vaadin servlet
configuration:

[subs="normal"]
----

+ 6
- 3
server/src/com/vaadin/server/communication/UidlWriter.java View File

@@ -352,9 +352,12 @@ public class UidlWriter implements Serializable {
* @throws IOException
*/
private void writePerformanceData(UI ui, Writer writer) throws IOException {
writer.write(String.format(", \"timings\":[%d, %d]", ui.getSession()
.getCumulativeRequestDuration(), ui.getSession()
.getLastRequestDuration()));
if (!ui.getSession().getService().getDeploymentConfiguration()
.isProductionMode()) {
writer.write(String.format(", \"timings\":[%d, %d]", ui
.getSession().getCumulativeRequestDuration(), ui
.getSession().getLastRequestDuration()));
}
}

private static final Logger getLogger() {

Loading…
Cancel
Save