Class SonarQubePointGenerator
- java.lang.Object
-
- jenkinsci.plugins.influxdb.generators.AbstractPointGenerator
-
- jenkinsci.plugins.influxdb.generators.SonarQubePointGenerator
-
- All Implemented Interfaces:
PointGenerator
public class SonarQubePointGenerator extends AbstractPointGenerator
-
-
Field Summary
-
Fields inherited from class jenkinsci.plugins.influxdb.generators.AbstractPointGenerator
build, BUILD_NUMBER, CUSTOM_PREFIX, INSTANCE, PROJECT_NAME, PROJECT_NAMESPACE, PROJECT_PATH, timestamp
-
-
Constructor Summary
Constructors Constructor Description SonarQubePointGenerator(Run<?,?> build, TaskListener listener, ProjectNameRenderer projectNameRenderer, long timestamp, String jenkinsEnvParameterTag, String customPrefix, EnvVars env)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Path>
findReportByFileName(String workspacePath)
com.influxdb.client.write.Point[]
generate()
String
getProjectKey()
protected String
getResult(String url)
String
getSonarBuildTaskId()
String
getSonarBuildTaskIdUrl()
String
getSonarBuildURL()
Float
getSonarMetric(String url, String metric)
String
getSonarMetricStr(String url, String metric)
boolean
hasReport()
void
setEnv(EnvVars env)
-
Methods inherited from class jenkinsci.plugins.influxdb.generators.AbstractPointGenerator
buildPoint, buildPoint, parsePropertiesString, resolveEnvParameterAndTransformToMap
-
-
-
-
Constructor Detail
-
SonarQubePointGenerator
public SonarQubePointGenerator(Run<?,?> build, TaskListener listener, ProjectNameRenderer projectNameRenderer, long timestamp, String jenkinsEnvParameterTag, String customPrefix, EnvVars env)
-
-
Method Detail
-
getProjectKey
public String getProjectKey()
-
getSonarBuildURL
public String getSonarBuildURL()
-
getSonarBuildTaskIdUrl
public String getSonarBuildTaskIdUrl()
-
getSonarBuildTaskId
public String getSonarBuildTaskId()
-
hasReport
public boolean hasReport()
- Returns:
- true, if environment variable LOG_SONAR_QUBE_RESULTS is set to true and SQ Reports exist
-
setEnv
public void setEnv(EnvVars env)
-
generate
public com.influxdb.client.write.Point[] generate()
-
getResult
protected String getResult(String url) throws IOException
- Throws:
IOException
-
findReportByFileName
public List<Path> findReportByFileName(String workspacePath) throws IOException, UncheckedIOException
- Throws:
IOException
UncheckedIOException
-
getSonarMetricStr
public String getSonarMetricStr(String url, String metric) throws IOException
- Throws:
IOException
-
getSonarMetric
public Float getSonarMetric(String url, String metric) throws IOException
- Throws:
IOException
-
-