summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2016-03-01 14:00:23 +0200
committerTeemu Suo-Anttila <teemusa@vaadin.com>2016-03-08 14:03:05 +0200
commitb651cca33d1a7e95dad50c17cda259b4bd56ae69 (patch)
tree0dfe76f254311a7205fb7d82108f77cb63544afc
parent39409784dfdce456d1e6e1054288c7e446c2cd49 (diff)
downloadvaadin-framework-b651cca33d1a7e95dad50c17cda259b4bd56ae69.tar.gz
vaadin-framework-b651cca33d1a7e95dad50c17cda259b4bd56ae69.zip
Omit timings in production mode (#19644)
* UIDL responses only include server side timing information when not in production mode. * Update documentation accordingly. Change-Id: I73e65057b0c9e8ccfce2a1ee2590f23fba2bdb22
-rw-r--r--WebContent/release-notes.html2
-rw-r--r--client/src/com/vaadin/client/ApplicationConnection.java6
-rw-r--r--documentation/advanced/advanced-debug.asciidoc12
-rw-r--r--server/src/com/vaadin/server/communication/UidlWriter.java9
4 files changed, 22 insertions, 7 deletions
diff --git a/WebContent/release-notes.html b/WebContent/release-notes.html
index 3d6bd4376d..bccb867c4d 100644
--- a/WebContent/release-notes.html
+++ b/WebContent/release-notes.html
@@ -145,6 +145,8 @@
cause problems with external libraries compiled against said versions.</li>
<li>Declarative format is now using "vaadin-" as a default prefix instead of the "v-" prefix used in 7.5.
This default can be changed in deployment configuration.</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>
diff --git a/client/src/com/vaadin/client/ApplicationConnection.java b/client/src/com/vaadin/client/ApplicationConnection.java
index ce55c13ce5..6830f21bcd 100644
--- a/client/src/com/vaadin/client/ApplicationConnection.java
+++ b/client/src/com/vaadin/client/ApplicationConnection.java
@@ -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;
});
diff --git a/documentation/advanced/advanced-debug.asciidoc b/documentation/advanced/advanced-debug.asciidoc
index 9a0d8d7ba8..9731c650af 100644
--- a/documentation/advanced/advanced-debug.asciidoc
+++ b/documentation/advanced/advanced-debug.asciidoc
@@ -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"]
----
diff --git a/server/src/com/vaadin/server/communication/UidlWriter.java b/server/src/com/vaadin/server/communication/UidlWriter.java
index b117cb4b4d..8a4e62fb24 100644
--- a/server/src/com/vaadin/server/communication/UidlWriter.java
+++ b/server/src/com/vaadin/server/communication/UidlWriter.java
@@ -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() {