diff --git a/src/main/java/jenkinsci/plugins/influxdb/DescriptorImpl.java b/src/main/java/jenkinsci/plugins/influxdb/DescriptorImpl.java index edbebd26..19b25772 100644 --- a/src/main/java/jenkinsci/plugins/influxdb/DescriptorImpl.java +++ b/src/main/java/jenkinsci/plugins/influxdb/DescriptorImpl.java @@ -2,10 +2,9 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.CheckForNull; import org.jenkinsci.Symbol; +import hudson.util.ListBoxModel; import org.kohsuke.stapler.DataBoundSetter; import org.kohsuke.stapler.StaplerRequest; @@ -19,7 +18,7 @@ @Symbol("influxDbPublisher") public final class DescriptorImpl extends BuildStepDescriptor implements ModelObject, java.io.Serializable { - private static final String DISPLAY_NAME = "Publish build data to InfluxDb target"; + private static final String DISPLAY_NAME = "Publish build data to InfluxDB"; private List targets = new CopyOnWriteArrayList<>(); public DescriptorImpl() { @@ -64,17 +63,19 @@ public boolean isApplicable(Class jobType) { return true; } - @Override - public Publisher newInstance(@CheckForNull StaplerRequest req, @Nonnull JSONObject formData) { - InfluxDbPublisher publisher = new InfluxDbPublisher(); - req.bindParameters(publisher, "publisherBinding."); - return publisher; - } - @Override public boolean configure(StaplerRequest req, JSONObject formData) { - targets = req.bindJSONToList(Target.class, formData.get("currentTarget")); + targets.clear(); + targets.addAll(req.bindJSONToList(Target.class, formData.get("targets"))); save(); return true; } + + public ListBoxModel doFillSelectedTargetItems() { + ListBoxModel model = new ListBoxModel(); + for (Target target : targets) { + model.add(target.getDescription()); + } + return model; + } } diff --git a/src/main/java/jenkinsci/plugins/influxdb/models/Target.java b/src/main/java/jenkinsci/plugins/influxdb/models/Target.java index 6220de38..8a59e7df 100644 --- a/src/main/java/jenkinsci/plugins/influxdb/models/Target.java +++ b/src/main/java/jenkinsci/plugins/influxdb/models/Target.java @@ -1,5 +1,6 @@ package jenkinsci.plugins.influxdb.models; +import com.google.common.base.Objects; import hudson.Extension; import hudson.model.AbstractDescribableImpl; import hudson.model.Descriptor; @@ -130,8 +131,12 @@ public void setGlobalListenerFilter(String globalListenerFilter) { @Override public String toString() { - return "[url=" + this.url + ", description=" + this.description + ", username=" + this.username - + ", password=*****, database=" + this.database + "]"; + return Objects.toStringHelper(Target.class) + .add("description", description) + .add("url", url) + .add("username", username) + .add("database", database) + .toString(); } @Extension diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/config.jelly b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/config.jelly index ae29055a..40d31693 100644 --- a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/config.jelly +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/config.jelly @@ -1,34 +1,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/global.jelly b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/global.jelly index f67461dd..d529e0ea 100644 --- a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/global.jelly +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/global.jelly @@ -1,70 +1,49 @@ - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- +
-
- -
- +
+ -
diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-customPrefix.html b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-customPrefix.html index 2231dffc..35d00fc4 100644 --- a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-customPrefix.html +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-customPrefix.html @@ -1 +1 @@ -A custom prefix, that gets prepended to the job name, for example to prevent several 'master' metrics for different jobs in multi branch pipeline jobs \ No newline at end of file +A custom prefix that gets prepended to the job name, for example to prevent several 'master' metrics for different jobs in multi branch pipeline jobs. diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-customProjectName.html b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-customProjectName.html index fa15cde7..bc8b4d61 100644 --- a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-customProjectName.html +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-customProjectName.html @@ -1 +1,2 @@ -Sets a custom value for the InfluxDB 'project_name' tagKey, that overrides the default, which is the job name. Useful to easily group metrics for different jobs in multi branch pipeline jobs. \ No newline at end of file +Sets a custom value for the InfluxDB 'project_name' tag key, that overrides the default, which is the job name. +

Useful to easily group metrics for different jobs in multi branch pipeline jobs.

diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-database.html b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-database.html new file mode 100644 index 00000000..d2f311f5 --- /dev/null +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-database.html @@ -0,0 +1 @@ +Name of the database. diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-description.html b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-description.html new file mode 100644 index 00000000..01c96d6f --- /dev/null +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-description.html @@ -0,0 +1,2 @@ +Description for the InfluxDB target. +

This is used in a job's configuration to select which InfluxDB target to use.

diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-exposeExceptions.html b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-exposeExceptions.html index 3e30c652..5da04967 100644 --- a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-exposeExceptions.html +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-exposeExceptions.html @@ -1 +1,2 @@ -If activated, Exceptions communicating with InfluxDB are exposed and Jobs may fail if a Report could not be written to InfluxDB. If false, even if an Exception occurs while connecting to influxdb, this Exception is not exposed but just logged. \ No newline at end of file +If enabled, exceptions communicating with InfluxDB are exposed and jobs may fail if a report could not be written to InfluxDB.
+If disabled, even if an exception occurs while connecting to InfluxDB, this exception is not exposed but just logged. diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-globalListener.html b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-globalListener.html new file mode 100644 index 00000000..f8c502ce --- /dev/null +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-globalListener.html @@ -0,0 +1,2 @@ +Whether to globally enable publishing build results to this target. +

Even if enabled, it is still possible to configure an additional target per job.

diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-globalListenerFilter.html b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-globalListenerFilter.html index f935845e..7af89730 100644 --- a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-globalListenerFilter.html +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-globalListenerFilter.html @@ -1 +1 @@ -Regular expression to match only certain builds. \ No newline at end of file +Regular expression to match only certain jobs. diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-jenkinsEnvParameterField.html b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-jenkinsEnvParameterField.html index 2697aee9..24850560 100644 --- a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-jenkinsEnvParameterField.html +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-jenkinsEnvParameterField.html @@ -1,8 +1,7 @@ -Custom FieldSets that will be added to the default measurement 'jenkins_data', configured as key-value-pairs (one per line, in Java-Properties file format). -
-Current build parameters and/or environment variables can be used in form ${PARAM} +Custom field set that will be added to the default measurement 'jenkins_data', configured as key-value pairs (one per line, in Java Properties file format). +

Current build parameters and/or environment variables can be used in the form of ${PARAM}

  • KEY=${PARAM}
  • KEY=PREFIX_${PARAM}_SUFFIX
  • KEY=VALUE
  • -
\ No newline at end of file + diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-jenkinsEnvParameterTag.html b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-jenkinsEnvParameterTag.html index 55ba2db6..b924ac73 100644 --- a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-jenkinsEnvParameterTag.html +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-jenkinsEnvParameterTag.html @@ -1,8 +1,7 @@ -Custom TagSets that will be added to the default measurement 'jenkins_data', configured as key-value-pairs (one per line, in Java-Properties file format). -
-Current build parameters and/or environment variables can be used in form ${PARAM} +Custom tag set that will be added to the default measurement 'jenkins_data', configured as key-value pairs (one per line, in Java Properties file format). +

Current build parameters and/or environment variables can be used in the form of ${PARAM}

  • KEY=${PARAM}
  • KEY=PREFIX_${PARAM}_SUFFIX
  • KEY=VALUE
  • -
\ No newline at end of file + diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-jobScheduledTimeAsPointsTimestamp.html b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-jobScheduledTimeAsPointsTimestamp.html index 047911a1..cd894e61 100644 --- a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-jobScheduledTimeAsPointsTimestamp.html +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-jobScheduledTimeAsPointsTimestamp.html @@ -1 +1,5 @@ -If activated, the time when a job is scheduled is set as timestamp for every InfluxDB point instead of the time, when the point is created (and the job is almost done). \ No newline at end of file +Which timestamp to use for InfluxDB points. +

+If enabled, the time when a job is scheduled.
+If disabled, the time when a point is created (the job is almost done). +

diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-password.html b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-password.html new file mode 100644 index 00000000..bade520b --- /dev/null +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-password.html @@ -0,0 +1 @@ +Password of the database. diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-replaceDashWithUnderscore.html b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-replaceDashWithUnderscore.html index d1bb70d2..4db6c710 100644 --- a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-replaceDashWithUnderscore.html +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-replaceDashWithUnderscore.html @@ -1,3 +1,2 @@ -Choose whether or not you would like to change dashes (-) to underscores (_) in tag values. -
-i.e. "my-custom-tag" --> "my_custom_tag". \ No newline at end of file +Choose whether to change dashes (-) to underscores (_) in tag values.
+

i.e. "my-custom-tag" → "my_custom_tag".

diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-retentionPolicy.html b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-retentionPolicy.html index 730f9c68..4a5b9aa8 100644 --- a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-retentionPolicy.html +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-retentionPolicy.html @@ -1,6 +1,7 @@ -Choose the retention policy for the data (i.e. how long is the data stored). -

-The default value for InfluxDB 1.0+ versions is "autogen". For InfluxDB versions <1.0 the default retention policy is "default". -The "autogen" or "default" retention policies mean the data is stored for infinity. -

-The input can be set e.g. "2m", "3d", "4w", for 2 minutes, 3 days, or 4 weeks respectively. +The retention policy for the data (i.e. how long the data is stored). +

+The default value for InfluxDB 1.0+ versions is "autogen".
+The default value for InfluxDB <1.0 versions is "default". +

+

The "autogen" or "default" retention policies mean the data is stored for infinity.

+

The input can be set e.g. "2m", "3d", "4w", for 2 minutes, 3 days, or 4 weeks respectively.

diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-selectedTarget.html b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-selectedTarget.html new file mode 100644 index 00000000..0af26120 --- /dev/null +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-selectedTarget.html @@ -0,0 +1 @@ +InfluxDB target to send data to. Targets have to be configured in the global Jenkins settings. diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-url.html b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-url.html new file mode 100644 index 00000000..f51e9694 --- /dev/null +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-url.html @@ -0,0 +1 @@ +URL of the InfluxDB. diff --git a/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-username.html b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-username.html new file mode 100644 index 00000000..1f024522 --- /dev/null +++ b/src/main/resources/jenkinsci/plugins/influxdb/InfluxDbPublisher/help-username.html @@ -0,0 +1 @@ +Username of the database. diff --git a/src/main/webapp/help/config/choose-influxdb-server.html b/src/main/webapp/help/config/choose-influxdb-server.html deleted file mode 100644 index 7d540cf2..00000000 --- a/src/main/webapp/help/config/choose-influxdb-server.html +++ /dev/null @@ -1 +0,0 @@ -Select InfluxDb server. Check global jenkins config for defining connection properties for this hosts \ No newline at end of file diff --git a/src/main/webapp/help/global/influxdb_database_name.html b/src/main/webapp/help/global/influxdb_database_name.html deleted file mode 100644 index 25439902..00000000 --- a/src/main/webapp/help/global/influxdb_database_name.html +++ /dev/null @@ -1,5 +0,0 @@ -Set the base queue name. This will appear at the beginning of every job's queue. -It's a convenient way to set a default base section of the queue without repeating it in every job. - -i.e.: -jenkins.team4.server1.builds diff --git a/src/main/webapp/help/global/influxdb_servers_added.html b/src/main/webapp/help/global/influxdb_servers_added.html deleted file mode 100644 index 8e7545b0..00000000 --- a/src/main/webapp/help/global/influxdb_servers_added.html +++ /dev/null @@ -1 +0,0 @@ -List of graphite servers added \ No newline at end of file diff --git a/src/main/webapp/help/global/influxdb_servers_adding_description.html b/src/main/webapp/help/global/influxdb_servers_adding_description.html deleted file mode 100644 index b7696e1e..00000000 --- a/src/main/webapp/help/global/influxdb_servers_adding_description.html +++ /dev/null @@ -1 +0,0 @@ -Fill the description of the server \ No newline at end of file diff --git a/src/main/webapp/help/global/influxdb_servers_adding_host.html b/src/main/webapp/help/global/influxdb_servers_adding_host.html deleted file mode 100644 index a1541935..00000000 --- a/src/main/webapp/help/global/influxdb_servers_adding_host.html +++ /dev/null @@ -1 +0,0 @@ -Fill the hostname of the server \ No newline at end of file diff --git a/src/main/webapp/help/global/influxdb_servers_adding_password.html b/src/main/webapp/help/global/influxdb_servers_adding_password.html deleted file mode 100644 index b27fd95e..00000000 --- a/src/main/webapp/help/global/influxdb_servers_adding_password.html +++ /dev/null @@ -1 +0,0 @@ -Fill the password of the database \ No newline at end of file diff --git a/src/main/webapp/help/global/influxdb_servers_adding_port.html b/src/main/webapp/help/global/influxdb_servers_adding_port.html deleted file mode 100644 index 83b3436b..00000000 --- a/src/main/webapp/help/global/influxdb_servers_adding_port.html +++ /dev/null @@ -1 +0,0 @@ -Fill the port of the server \ No newline at end of file diff --git a/src/main/webapp/help/global/influxdb_servers_adding_user.html b/src/main/webapp/help/global/influxdb_servers_adding_user.html deleted file mode 100644 index aad4bc96..00000000 --- a/src/main/webapp/help/global/influxdb_servers_adding_user.html +++ /dev/null @@ -1 +0,0 @@ -Fill the username of the database \ No newline at end of file