Package com.splunk.splunkjenkins.utils
Class LogEventHelper
java.lang.Object
com.splunk.splunkjenkins.utils.LogEventHelper
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic shaded.splk.org.apache.http.client.methods.HttpPostbuildPost(EventRecord record, SplunkJenkinsInstallation config) static StringgetBuildCauses(Run run) getBuildVariables(Run run) getBuildVariables(Run run, boolean completed) static StringgetComputerStatus(Computer computer) static Stringstatic EnvVarsgetEnvironment(Run run) static StringgetRelativeJenkinsHomePath(String configPath) static floatgetRunDuration(Run run) getScmInfo(Run build) getScmInfo(String scmName, EnvVars envVars) static Stringstatic StringgetTriggerUserName(Run run) static StringThis method may trigger load user operations.static booleanhasPublisherName(String shortClassName, Run build) check if the project has publisherstatic voidlogUserAction(String user, String message) static booleanstatic longparseFileSize(String size) static intsendFiles(Run build, FilePath ws, Map<String, String> envVars, TaskListener listener, String includes, String excludes, boolean sendFromSlave, long maxFileSize) static StringtoJson(EventRecord record) static voidupdateSlaveInfoAsync(String nodeName) static FormValidationvalidateGroovyScript(String script) static FormValidation
-
Field Details
-
SEPARATOR
- See Also:
-
-
Constructor Details
-
LogEventHelper
public LogEventHelper()
-
-
Method Details
-
buildPost
public static shaded.splk.org.apache.http.client.methods.HttpPost buildPost(EventRecord record, SplunkJenkinsInstallation config) -
verifyHttpInput
-
nonEmpty
-
getUserName
This method may trigger load user operations.- Returns:
- User display name
-
getMasterStats
- Returns:
- Jenkins master statistics with timestamp
-
sendFiles
-
parseFileSize
-
getTriggerUserName
- Parameters:
run- Jenkins Run- Returns:
- the user who triggered the build or upstream build
-
getComputerStatus
-
getRunningJob
-
getSlaveStats
- Returns:
- a map with slave name as key and monitor result as value monitor result is a map with monitor name as key, monitor data as value
-
getEnvironment
- Parameters:
run- the build- Returns:
- build env with masked password variables
-
getBuildVariables
- Parameters:
run- the buildcompleted- the task is completed to compute scm info- Returns:
- build variables with password masked
-
getBuildVariables
- Parameters:
run- the build- Returns:
- build variables with password masked
-
logUserAction
-
updateSlaveInfoAsync
-
getRelativeJenkinsHomePath
- Parameters:
configPath- the absolute path- Returns:
- the relative path to
JENKINS_HOMEdirectory
-
getDefaultDslScript
-
validateGroovyScript
- Parameters:
script- user input script to validate- Returns:
- error message if there is any
-
hasPublisherName
check if the project has publisher- Parameters:
shortClassName- common used publishers arebuild- jenkins build- Returns:
- true if the publisher is defined, false otherwise
-
getRunDuration
- Parameters:
run- an execution of job- Returns:
- job duration
-
appendScm
-
getScmInfo
-
getScmInfo
- Parameters:
scmName- scm class nameenvVars- environment variables- Returns:
- scm information, we only support git,svn and p4
-
getScmURL
- Parameters:
envVars- environment variablesprefix- scm prefix, such as GIT_URL, SVN_URL- Returns:
- parsed scm urls from build env, e.g. GIT_URL_1, GIT_URL_2, ... GIT_URL_10 or GIT_URL
-
toJson
-
getBuildVersion
-
getBuildCauses
- Parameters:
run- Jenkins job run- Returns:
- causes separated by comma
-