Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payara 1322 application deployment time #1585

Merged
merged 11 commits into from
Jun 13, 2017
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/

// Portions Copyright [2016-2017] [Payara Foundation and/or its affiliates]

/*
Expand Down Expand Up @@ -125,6 +124,7 @@ public static void getDeployedAppsInfo(HandlerContext handlerCtx) {
oneRow.put("enableURL", DeployUtil.getTargetEnableInfo(oneAppName, true, true));
oneRow.put("sniffers", engines);
oneRow.put("deploymentOrder", RestUtil.getAttributesMap(prefix+encodedName).get("deploymentOrder"));
oneRow.put("deploymentTime", RestUtil.getAttributesMap(prefix+encodedName).get("deploymentTime"));

List sniffersList = GuiUtil.parseStringList(engines, ",");
oneRow.put("sniffersList", sniffersList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@
<sun:tableColumn headerText="$resource{i18n.deployTable.colDeploymentOrder}" sort="deploymentOrder" id="colorder">
<staticText id="order" value="#{td.value.deploymentOrder}" />
</sun:tableColumn>

<sun:tableColumn headerText="$resource{i18n.deployTable.colDeploymentTime}" sort="deploymentTime" id="coltime">
<staticText id="time" value="#{td.value.deploymentTime}" />
</sun:tableColumn>

<sun:tableColumn rendered="#{!pageSession.onlyDASExist}" headerText="$resource{i18n.deployTable.colStatus}" sort="enableURL" id="col2">
<sun:hyperlink rendered="#{!pageSession.onlyDASExist}" id="targetLink" text="#{td.value.enableURL}" url="#{targetLink}?appName=#{td.value.encodedName}&listPageLink=#{pageSession.listPageLink}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

-->

<!-- Portions Copyright [2017] [Payara Foundation and/or its affiliates] -->


<sun:propertySheet id="propertySheet">
<!-- Text Field section -->
Expand Down Expand Up @@ -109,10 +111,13 @@
<sun:property id="deploymentOrderProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n.deploy.deploymentOrder}" helpText="$resource{i18n.deploy.deploymentOrderHelp}">
<sun:textField id="deploymentOrder" columns="$int{40}" maxLength="#{sessionScope.fieldLengths['maxLength.deploy.deploymentOrder']}" text="#{pageSession.valueMap['deploymentOrder']}" />
</sun:property>

<sun:property id="deploymentTimeProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n.deploy.deploymentTime}" helpText="$resource{i18n.deploy.deploymentTimeHelp}">
<sun:staticText id="deploymentOrder" text="#{pageSession.valueMap['deploymentTime']}" />
</sun:property>

<sun:property id="librariesProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n.common.Libraries}">
<sun:staticText id="libraries" text="#{pageSession.valueMap['libraries']}"/>

</sun:property>

<sun:property id="descProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n.common.description}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# only if the new code is made subject to such option by the copyright
# holder.
#
# Portions Copyright [2016] [Payara Foundation and/or its affiliates]
# Portions Copyright [2016-2017] [Payara Foundation and/or its affiliates]
TODO=
TBD=TBD
versionImage.description=Consola de Administraci\u00f3n de Payara Server
Expand Down Expand Up @@ -541,6 +541,7 @@ common.Instance=Instancia
common.resource.deploymentOrder=Orden de Despliegue:
common.resource.deploymentOrderHelp=Especifica el orden de carga del recurso al iniciar el servidor. Los n\u00fameros inferiores se cargan en primer lugar.


# this is used as the tab name or a section of the screen, to indicate for configurating some advanced attributes of an object.
common.Advanced=Avanzada

Expand Down Expand Up @@ -781,6 +782,7 @@ deployTable.colLoadOrder=Orden de Carga
deployTable.classnameCol=Nombre de Clase
deployTable.colJavaWebStart=Java Web Start
deployTable.colDeploymentOrder=Orden de Despliegue
deployTable.colDeploymentTime=Tiempo de Despliegue (Milisegundos)

## this is the column name of the table that lists out the deployed applications. This column shows the sniffer engineer of this application
## eg. web, ejb, appclient etc.
Expand Down Expand Up @@ -909,6 +911,8 @@ deploy.compatibility=Compatibilidad:
deploy.compatibilityHelp=Soporta la compatibilidad con versiones anteriores respecto a la visibilidad JAR en v2 en lugar de los requisitos m\u00e1s estrictos de Java EE 6 implantados en v3.
deploy.deploymentOrder=Orden de Despliegue:
deploy.deploymentOrderHelp=N\u00famero que determina el orden de carga de la aplicaci\u00f3n al iniciar el servidor. Los n\u00fameros inferiores se cargan en primer lugar. El valor por defecto es 100.
deploy.deploymentTime=Tiempo de Despliegue:
deploy.deploymentTimeHelp=El tiempo necesario para desplegar la aplicaci\u00f3n en milisegundos.
deploy.type=Tipo de Aplicaci\u00f3n:
deploy.chooseLocal=Archivo empaquetado local o directorio accesible desde Payara Server
deploy.warning=El despliegue se ha realizado correctamente con una advertencia. Consulte el archivo log para obtener m\u00e1s informaci\u00f3n.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# only if the new code is made subject to such option by the copyright
# holder.
#
# Portions Copyright [2016] [Payara Foundation and/or its affiliates]
# Portions Copyright [2016-2017] [Payara Foundation and/or its affiliates]
TODO=
TBD=TBD
versionImage.description=Console de Administra\u00e7\u00e3o do Payara Server
Expand Down Expand Up @@ -781,6 +781,7 @@ deployTable.colLoadOrder=Ordem de Carga
deployTable.classnameCol=Nome de classe
deployTable.colJavaWebStart=Iniciar Java Web
deployTable.colDeploymentOrder=Ordem de Implanta\u00e7\u00e3o
deployTable.colDeploymentTime=Tempo de implanta\u00e7\u00e3o (Milisegundos)

## this is the column name of the table that lists out the deployed applications. This column shows the sniffer engineer of this application
## eg. web, ejb, appclient etc.
Expand Down Expand Up @@ -909,6 +910,8 @@ deploy.compatibility=Compatibilidade:
deploy.compatibilityHelp=Oferece suporte \u00e0 compatibilidade com vers\u00f5es anteriores da visibilidade JAR na v2, em vez dos estritos requisitos do Java EE 6 implementados na v3.
deploy.deploymentOrder=Ordem de Implanta\u00e7\u00e3o:
deploy.deploymentOrderHelp=Um n\u00famero que determina a ordem de carregamento da aplica\u00e7\u00e3o na inicializa\u00e7\u00e3o do servidor. N\u00fameros mais baixos s\u00e3o carregados antes. O default \u00e9 100.
deploy.deploymentTime=Tempo de implanta\u00e7\u00e3oi:
deploy.deploymentTimeHelp=O tempo necess\u00e1rio para implementar o aplicativo em milisegundos.
deploy.type=Tipo de Aplica\u00e7\u00e3o:
deploy.chooseLocal=Diret\u00f3rio ou arquivo local encapsulado que pode ser acessado a partir do Payara Server
deploy.warning=A implanta\u00e7\u00e3o foi bem-sucedida mas gerou uma advert\u00eancia, consulte o arquivo de log para obter os detalhes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@ deployTable.colLoadOrder=Load Order
deployTable.classnameCol=Classname
deployTable.colJavaWebStart=Java Web Start
deployTable.colDeploymentOrder=Deployment Order
deployTable.colDeploymentTime=Deployment Time (Milliseconds)

## this is the column name of the table that lists out the deployed applications. This column shows the sniffer engineer of this application
## eg. web, ejb, appclient etc.
Expand Down Expand Up @@ -922,6 +923,8 @@ deploy.compatibility=Compatibility:
deploy.compatibilityHelp=Supports the backward compatibility of JAR visibility in v2 instead of the stricter Java EE 6 requirements implemented in v3.
deploy.deploymentOrder=Deployment Order:
deploy.deploymentOrderHelp=A number that determines the loading order of the application at server startup. Lower numbers are loaded first. The default is 100.
deploy.deploymentTime=Deployment Time:
deploy.deploymentTimeHelp=The time taken to deploy the application in milliseconds.
deploy.implicitCdi=Implicit CDI
deploy.implicitCdiHelp=Implicit discovery of CDI beans
deploy.type=Application Type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2017] [Payara Foundation and/or its affiliates]
package com.sun.enterprise.config.serverbeans;

import java.beans.PropertyVetoException;
Expand All @@ -62,15 +63,15 @@
import org.jvnet.hk2.config.Element;

import com.sun.enterprise.config.serverbeans.customvalidators.ContextRootCheck;

import fish.payara.api.admin.config.ApplicationDeploymentTime;

@Configured
@RestRedirects({
@RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "undeploy"),
@RestRedirect(opType = RestRedirect.OpType.POST, commandName = "redeploy")
})
@ContextRootCheck(message="{contextroot.duplicate}", payload=Application.class)
public interface Application extends ApplicationName, PropertyBag {
public interface Application extends ApplicationName, ApplicationDeploymentTime, PropertyBag {

public static final String APP_LOCATION_PROP_NAME = "appLocation";
public static final String DEPLOYMENT_PLAN_LOCATION_PROP_NAME = "deploymentPlanLocation";
Expand Down
1 change: 1 addition & 0 deletions nucleus/common/glassfish-api/osgi.bundle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
org.glassfish.api.admin; \
org.glassfish.api.admin.cli; \
org.glassfish.api.admin.config; \
fish.payara.api.admin.config; \
org.glassfish.api.admin.progress; \
org.glassfish.api.admingui; \
org.glassfish.api.amx; \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) [2017] Payara Foundation and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* https://github.com/payara/Payara/blob/master/LICENSE.txt
* See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at glassfish/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* The Payara Foundation designates this particular file as subject to the "Classpath"
* exception as provided by the Payara Foundation in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
package fish.payara.api.admin.config;

import org.jvnet.hk2.config.Attribute;
import org.jvnet.hk2.config.Configured;
import org.jvnet.hk2.config.ConfigBeanProxy;

import java.beans.PropertyVetoException;
import javax.validation.Payload;

/**
* An configured element which shows the time taken to deploy the application in
* seconds
*
* @author Matt Gill
*/
@Configured
public interface ApplicationDeploymentTime extends ConfigBeanProxy, Payload {

/**
* Time taken to deploy the application.
*
* @return deployment time
*/
@Attribute(dataType = Integer.class)
String getDeploymentTime();

void setDeploymentTime(String value) throws PropertyVetoException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2016] [Payara Foundation]
// Portions Copyright [2016-2017] [Payara Foundation and/or its affiliates]
package org.glassfish.deployment.admin;

import java.net.URI;
Expand Down Expand Up @@ -339,6 +339,7 @@ public Collection<? extends AccessCheck> getAccessChecks() {
*/
@Override
public void execute(AdminCommandContext context) {
long timeTakenToDeploy = 0;
try {
// needs to be fixed in hk2, we don't generate the right innerclass index. it should use $
Collection<Interceptor> interceptors = habitat.getAllServices(Interceptor.class);
Expand Down Expand Up @@ -506,6 +507,10 @@ public void execute(AdminCommandContext context) {
downloadableArtifacts.record(appProps);
generatedArtifacts.record(appProps);

// Set the application deploy time
timeTakenToDeploy = timing.elapsed();
deploymentContext.getTransientAppMetaData("application", Application.class).setDeploymentTime(Long.toString(timeTakenToDeploy));

// register application information in domain.xml
deployment.registerAppInDomainXML(appInfo, deploymentContext, t);
if (tracing != null) {
Expand Down Expand Up @@ -563,7 +568,7 @@ public void execute(AdminCommandContext context) {
"deploy.done",
"Deployment of {0} done is {1} ms",
name,
timing.elapsed()));
timeTakenToDeploy));
} else if (report.getActionExitCode().equals(ActionReport.ExitCode.FAILURE)) {
String errorMessage = report.getMessage();
Throwable cause = report.getFailureCause();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2017] [Payara Foundation and/or its affiliates]

package org.glassfish.deployment.admin;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/

// Portions Copyright [2017] [Payara Foundation and/or its affiliates]
package org.glassfish.deployment.admin;

import java.io.File;
Expand Down Expand Up @@ -222,6 +222,8 @@ public void setDirectoryDeployed(String value) throws PropertyVetoException{}
public void setDescription(String value) throws PropertyVetoException{}
public String getDeploymentOrder() { return "100"; }
public void setDeploymentOrder(String value) throws PropertyVetoException {}
public String getDeploymentTime() { return "0"; }
public void setDeploymentTime(String value) throws PropertyVetoException {}
public List<Engine> getEngine(){ return null;}
public List<Property> getProperty(){ return null;}
public <T extends ApplicationConfig> T getApplicationConfig(Class<T> type) {return null;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2017] [Payara Foundation and/or its affiliates]

package org.glassfish.deployment.versioning;

Expand Down Expand Up @@ -697,6 +698,14 @@ public String getDeploymentOrder() {
public void setDeploymentOrder(String value) throws PropertyVetoException{
throw new UnsupportedOperationException("Not supported yet.");
}

public String getDeploymentTime() {
throw new UnsupportedOperationException("Not supported yet.");
}

public void setDeploymentTime(String value) throws PropertyVetoException{
throw new UnsupportedOperationException("Not supported yet.");
}

@Override
public List<Module> getModule() {
Expand Down