Package io.jenkins.plugins.maplelabs
Class Utils
- java.lang.Object
-
- io.jenkins.plugins.maplelabs.Utils
-
public class Utils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static longpublisherTime
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longgetCurrentTimeInMillis()static ConfigurationgetGlobalDescriptor()static StringgetHostName(EnvVars envVars)This function will get hostnamestatic StringgetTerminalOP(String[] cmd)This function will execute command in terminal and return outputstatic <T> TgetValue(T value, T defaultValue)This function will get a value if value not found return defaultvaluestatic BooleanisValidHostName(String hostname)Validator function to ensure that the hostname is valid.static StringreplaceCapsWithUnderscore(String project)static booleansendEvent(IEvent event)This function will assembel Event details and call clientstatic booleansendMetrics(HashMap<String,Object> payload)This function will send metrics if Enable Metric is selected
-
-
-
Method Detail
-
getGlobalDescriptor
public static Configuration getGlobalDescriptor()
- Returns:
- - The descriptor for the APM plugin. In this case the global configuration.
-
getCurrentTimeInMillis
public static long getCurrentTimeInMillis()
-
getTerminalOP
public static String getTerminalOP(String[] cmd)
This function will execute command in terminal and return output
-
isValidHostName
public static Boolean isValidHostName(String hostname)
Validator function to ensure that the hostname is valid. Also, fails on empty String.
-
getValue
public static <T> T getValue(T value, T defaultValue)This function will get a value if value not found return defaultvalue
-
sendEvent
public static boolean sendEvent(IEvent event)
This function will assembel Event details and call client
-
sendMetrics
public static boolean sendMetrics(HashMap<String,Object> payload)
This function will send metrics if Enable Metric is selected
-
-