Skip to content

Commit c3306cd

Browse files
author
Rob Langley
committed
Add logarithmic support to plotBuildData
1 parent e1368a3 commit c3306cd

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

docs/Job-reference.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3938,6 +3938,7 @@ job {
39383938
useDescriptions(boolean useDescriptions = true) // defaults to false
39393939
excludeZero(boolean excludeZero = true) // defaults to false
39403940
keepRecords(boolean keepRecords = true) // defaults to false
3941+
logarithmic(bollean logarithmic = true) // defaults to false
39413942
propertiesFile(String fileName) {
39423943
label(String label)
39433944
}
@@ -3991,6 +3992,7 @@ job {
39913992
useDescriptions()
39923993
keepRecords()
39933994
excludeZero()
3995+
logarithmic()
39943996
propertiesFile('my_data.properties') {
39953997
label('Builds')
39963998
}

job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/publisher/PlotContext.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class PlotContext implements Context {
2121
boolean useDescriptions
2222
boolean keepRecords
2323
boolean excludeZero
24+
boolean logarithmic
2425

2526
PlotContext(String group, String dataStore) {
2627
this.group = group
@@ -56,6 +57,10 @@ class PlotContext implements Context {
5657
this.excludeZero = excludeZero
5758
}
5859

60+
void logarithmic(boolean logarithmic = true) {
61+
this.logarithmic = logarithmic
62+
}
63+
5964
void propertiesFile(String fileName, Closure plotSeriesClosure = null) {
6065
checkArgument(!Strings.isNullOrEmpty(fileName), 'fileName must not be null or empty')
6166

job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/publisher/PublisherContext.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ class PublisherContext implements Context {
391391
useDescr(plot.useDescriptions)
392392
keepRecords(plot.keepRecords)
393393
exclZero(plot.excludeZero)
394-
logarithmic(false)
394+
logarithmic(plot.logarithmic)
395395
}
396396
}
397397
}

job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/helpers/publisher/PublisherContextSpec.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3127,6 +3127,7 @@ class PublisherContextSpec extends Specification {
31273127
useDescriptions()
31283128
keepRecords()
31293129
excludeZero()
3130+
logarithmic()
31303131
propertiesFile('data.prop')
31313132
}
31323133
}
@@ -3147,7 +3148,7 @@ class PublisherContextSpec extends Specification {
31473148
useDescr[0].value() == true
31483149
keepRecords[0].value() == true
31493150
exclZero[0].value() == true
3150-
logarithmic[0].value() == false
3151+
logarithmic[0].value() == true
31513152
with(series[0].'hudson.plugins.plot.PropertiesSeries'[0]) {
31523153
children().size() == 3
31533154
file[0].value() == 'data.prop'

0 commit comments

Comments
 (0)