提交 fef4ef1c 编写于 作者: O Oliver Gondža

Merge pull request #1482 from olivergondza/node-monitor-refactorization

Node monitor refactorization
......@@ -51,7 +51,7 @@ public abstract class DiskSpaceMonitorDescriptor extends AbstractAsyncNodeMonito
* Value object that represents the disk space.
*/
@ExportedBean
public static final class DiskSpace extends OfflineCause implements Serializable {
public static final class DiskSpace extends MonitorOfflineCause implements Serializable {
private final String path;
@Exported
public final long size;
......@@ -70,7 +70,7 @@ public abstract class DiskSpaceMonitorDescriptor extends AbstractAsyncNodeMonito
@Override
public String toString() {
return String.valueOf(size);
return Messages.DiskSpaceMonitorDescriptor_DiskSpace_FreeSpaceTooLow(getGbLeft(), path);
}
/**
......@@ -119,6 +119,7 @@ public abstract class DiskSpaceMonitorDescriptor extends AbstractAsyncNodeMonito
this.triggered = triggered;
}
@Override
public Class<? extends AbstractDiskSpaceMonitor> getTrigger() {
return trigger;
}
......
/*
* The MIT License
*
* Copyright (c) 2014 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.node_monitors;
import javax.annotation.Nonnull;
import hudson.slaves.OfflineCause;
/**
* Offline cause to denote it was node monitor what put computer offline.
*
* @author ogondza
* @since 1.595
*/
public abstract class MonitorOfflineCause extends OfflineCause {
/**
* Identify monitor implementation that put computer offline.
*/
public abstract @Nonnull Class<? extends NodeMonitor> getTrigger();
}
......@@ -142,7 +142,7 @@ public class ResponseTimeMonitor extends NodeMonitor {
* Immutable representation of the monitoring data.
*/
@ExportedBean
public static final class Data extends OfflineCause implements Serializable {
public static final class Data extends MonitorOfflineCause implements Serializable {
/**
* Record of the past 5 times. -1 if time out. Otherwise in milliseconds.
* Old ones first.
......@@ -204,6 +204,11 @@ public class ResponseTimeMonitor extends NodeMonitor {
return getAverage()+"ms";
}
@Override
public Class<? extends NodeMonitor> getTrigger() {
return ResponseTimeMonitor.class;
}
private static final long serialVersionUID = 1L;
}
......
......@@ -24,5 +24,5 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<p class="error">${%blurb(it.gbLeft, it.path)}</p>
<p class="error">${it}</p>
</j:jelly>
# The MIT License
#
# Copyright (c) 2004-2009, Sun Microsystems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
blurb=Disk space is too low. Only {0}GB left on {1}.
\ No newline at end of file
# The MIT License
#
# Copyright (c) 2004-2010, Sun Microsystems, Inc. Kohsuke Kawaguchi. Knud Poulsen.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
blurb=Disk plads for lav. Kun {0}GB tilbage.
# The MIT License
#
# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Simon Wiest
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
blurb=Zu wenig Festplattenplatz: Nur noch {0}GB frei.
\ No newline at end of file
# The MIT License
#
# Copyright (c) 2004-2009, Sun Microsystems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
blurb=El espacio en disco es muy bajo, sólo quedan {0}GB.
# This file is under the MIT License by authors
blurb=Espace disque insuffisant. Seulement {0} GB restant sur {1}
# The MIT License
#
# Copyright (c) 2004-2009, Sun Microsystems, Inc., Seiji Sogabe
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
blurb=\u30C7\u30A3\u30B9\u30AF\u5BB9\u91CF\u304C\u5C11\u306A\u3059\u304E\u307E\u3059\u3002\u6B8B\u308A{0}GB\u3067\u3059\u3002
\ No newline at end of file
# The MIT License
#
# Copyright (c) 2004-, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributers
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# Disk space is too low. Only {0}GB left on {1}.
blurb=Espa\u00e7o em disco est\u00e1 acabando, apenas {0}Gb livre em {1}.
# The MIT License
#
# Copyright (c) 2004-2010, Sun Microsystems, Inc., Cleiber Silva
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# Disk space is too low. Only {0}GB left.
blurb=Pouco espa\u00e7o em disco. Somente {0}GB restante.
# The MIT License
#
# Copyright (c) 2004-2010, Sun Microsystems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
blurb=Diskutrymme l\u00E5gt. Enbart {0}GB kvar.
# The MIT License
#
# Copyright (c) 2013, Chunghwa Telecom Co., Ltd., Pei-Tang Huang
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
blurb=\u78c1\u789f\u7a7a\u9593\u592a\u5c11\u3002{1} \u4e0a\u53ea\u5269 {0}GB\u3002
......@@ -31,3 +31,4 @@ ResponseTimeMonitor.TimeOut=Time out for last {0} try
SwapSpaceMonitor.DisplayName=Free Swap Space
TemporarySpaceMonitor.DisplayName=Free Temp Space
AbstractNodeMonitorDescriptor.NoDataYet=Not yet
DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Disk space is too low. Only {0}GB left on {1}.
......@@ -20,4 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
blurb=M\u00E1lo m\u00EDsta na disku. Zb\u00FDv\u00E1 pouze {0}GB.
DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=M\u00E1lo m\u00EDsta na disku. Zb\u00FDv\u00E1 pouze {0}GB.
......@@ -29,3 +29,4 @@ SwapSpaceMonitor.DisplayName=Ledig Swap Plads
ArchitectureMonitor.DisplayName=Arkitektur
ResponseTimeMonitor.MarkedOffline=Tager {0} offline midlertidigt da den ikke svarer
ResponseTimeMonitor.DisplayName=Respons Tid
DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Disk plads for lav. Kun {0}GB tilbage.
......@@ -29,7 +29,4 @@ ResponseTimeMonitor.MarkedOffline=Nehme {0} tempor
ResponseTimeMonitor.TimeOut= {0} mal keine Antwort
SwapSpaceMonitor.DisplayName=Freier Swap Space
TemporarySpaceMonitor.DisplayName=Freier TEMP-Platz
\ No newline at end of file
DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Zu wenig Festplattenplatz: Nur noch {0}GB frei.
......@@ -29,3 +29,4 @@ ResponseTimeMonitor.MarkedOffline=Poniendo temporalmente {0} fuera de l
ResponseTimeMonitor.TimeOut=Se sobrepasó el tiempo de espera en el último intento de {0}
SwapSpaceMonitor.DisplayName=Espacio de intercambio libre
TemporarySpaceMonitor.DisplayName=Espacio temporal libre
DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=El espacio en disco es muy bajo, sólo quedan {0}GB.
......@@ -28,3 +28,4 @@ ResponseTimeMonitor.DisplayName=Temps de r\u00e9ponse
ResponseTimeMonitor.MarkedOffline={0} est marqu\u00e9 comme d\u00e9connect\u00e9 temporairement, parce qu''il ne r\u00e9pond pas
ResponseTimeMonitor.TimeOut=Time out du dernier essai {0}
SwapSpaceMonitor.DisplayName=Espace de swap disponible
DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Espace disque insuffisant. Seulement {0} GB restant sur {1}
......@@ -30,4 +30,5 @@ ResponseTimeMonitor.MarkedOffline=\u5fdc\u7b54\u3057\u306a\u3044\u305f\u3081\u30
ResponseTimeMonitor.TimeOut=\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8(\u76f4\u8fd1 {0}\u56de)
SwapSpaceMonitor.DisplayName=\u7a7a\u304d\u30b9\u30ef\u30c3\u30d7\u5bb9\u91cf
TemporarySpaceMonitor.DisplayName=\u7a7a\u304d\u30c6\u30f3\u30dd\u30e9\u30ea\u5bb9\u91cf
AbstractNodeMonitorDescriptor.NoDataYet=\u30c7\u30fc\u30bf\u672a\u53d6\u5f97
\ No newline at end of file
AbstractNodeMonitorDescriptor.NoDataYet=\u30c7\u30fc\u30bf\u672a\u53d6\u5f97
DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=\u30C7\u30A3\u30B9\u30AF\u5BB9\u91CF\u304C\u5C11\u306A\u3059\u304E\u307E\u3059\u3002\u6B8B\u308A{0}GB\u3067\u3059\u3002
......@@ -22,4 +22,5 @@
ArchitectureMonitor.DisplayName=Architectuur
ClockMonitor.DisplayName=Tijdsverschil
DiskSpaceMonitor.DisplayName=Beschikbare schijfruimte
\ No newline at end of file
DiskSpaceMonitor.DisplayName=Beschikbare schijfruimte
DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Er is te weinig vrije schijfruimte, nog maar {0} GB over.
......@@ -31,3 +31,4 @@ DiskSpaceMonitor.DisplayName=Espa\u00e7o em disco livre
SwapSpaceMonitor.DisplayName=Espa\u00e7o de swap livre
ArchitectureMonitor.DisplayName=Arquitetura
ResponseTimeMonitor.MarkedOffline=Deixar {0} offline porque n\u00e3o est\u00e1 respondendo
DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Espa\u00e7o em disco est\u00e1 acabando, apenas {0}Gb livre em {1}.
......@@ -39,3 +39,5 @@ ResponseTimeMonitor.MarkedOffline= Indispon\u00edvel temporariamente por que n\u
AbstractNodeMonitorDescriptor.NoDataYet=Nada ainda
# Putting {0} back online as there is enough disk space again
DiskSpaceMonitor.MarkedOnline=Retornando {0} para online pois h\u00e1 espa\u00e7o em disco suficiente novamente
# Disk space is too low. Only {0}GB left.
DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Pouco espa\u00e7o em disco. Somente {0}GB restante.
......@@ -20,4 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
blurb=Er is te weinig vrije schijfruimte, nog maar {0} GB over.
DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=Diskutrymme l\u00E5gt. Enbart {0}GB kvar.
......@@ -30,3 +30,4 @@ ResponseTimeMonitor.MarkedOffline={0} \u6c92\u6709\u56de\u61c9\uff0c\u5c07\u5176
ResponseTimeMonitor.TimeOut=\u6700\u8fd1 {0} \u6b21\u9023\u7dda\u90fd\u903e\u6642
SwapSpaceMonitor.DisplayName=\u53ef\u7528 Swap \u7a7a\u9593
TemporarySpaceMonitor.DisplayName=\u53ef\u7528\u66ab\u5b58\u7a7a\u9593
DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=\u78c1\u789f\u7a7a\u9593\u592a\u5c11\u3002{1} \u4e0a\u53ea\u5269 {0}GB\u3002
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册