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 long
publisherTime
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static long
getCurrentTimeInMillis()
static Configuration
getGlobalDescriptor()
static String
getHostName(EnvVars envVars)
This function will get hostnamestatic String
getTerminalOP(String[] cmd)
This function will execute command in terminal and return outputstatic <T> T
getValue(T value, T defaultValue)
This function will get a value if value not found return defaultvaluestatic Boolean
isValidHostName(String hostname)
Validator function to ensure that the hostname is valid.static String
replaceCapsWithUnderscore(String project)
static boolean
sendEvent(IEvent event)
This function will assembel Event details and call clientstatic boolean
sendMetrics(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
-
-