-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from LisiLisenok/develop
version 0.5.2
- Loading branch information
Showing
11 changed files
with
136 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 21 additions & 20 deletions
41
examples/herd/examples/asynctest/mapperformance/titles.ceylon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
|
||
"contains titles to be usedto store and retrieve plotters" | ||
object titles { | ||
shared String put = "put"; | ||
shared String get = "get"; | ||
shared String remove = "remove"; | ||
|
||
shared String ceylonHashMap = "ceylon hash map"; | ||
shared String ceylonTreeMap = "ceylon tree map"; | ||
shared String javaHashMap = "java hash map"; | ||
shared String javaTreeMap = "java tree map"; | ||
|
||
shared String hashMapRatios = "HashMap Ceylon / Java ratios"; | ||
shared String treeMapRatios = "TreeMap Ceylon / Java ratios"; | ||
|
||
shared String titlesDelimiter = "-"; | ||
|
||
shared String categoryTitle = "count"; | ||
shared String valTitle = "time, ms"; | ||
} | ||
|
||
"contains titles to be usedto store and retrieve plotters" | ||
object titles { | ||
shared String put = "put"; | ||
shared String get = "get"; | ||
shared String remove = "remove"; | ||
|
||
shared String ceylonHashMap = "ceylon hash map"; | ||
shared String ceylonTreeMap = "ceylon tree map"; | ||
shared String javaHashMap = "java hash map"; | ||
shared String javaTreeMap = "java tree map"; | ||
|
||
shared String hashMapRatios = "HashMap Ceylon / Java ratios"; | ||
shared String treeMapRatios = "TreeMap Ceylon / Java ratios"; | ||
|
||
shared String titlesDelimiter = "-"; | ||
|
||
shared String categoryTitle = "count"; | ||
shared String valTitle = "time, ms"; | ||
shared String valRatioTitle = "Ceylon / Java ratio"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,81 @@ | ||
|
||
|
||
"Reports charts writing line by line: | ||
* line with chart title, category title and value title | ||
* line with plot titles | ||
* lines with points for each plot | ||
Each item is separated using [[ReportFormat.delimiter]] (see [[defaultFormat]]). | ||
Numbers are reported using language [[formatFloat]] | ||
with given decimalPlaces (see [[defaultFormat]]). | ||
" | ||
by( "Lis" ) | ||
shared void reportChartByLines ( | ||
"Default format used if no format specified in chart." ReportFormat defaultFormat, | ||
"Charts to be reported." Chart[] charts, | ||
"Function used to write a line." void writeLine( String line ) | ||
) { | ||
for ( chart in charts ) { | ||
// format used for the current chart | ||
ReportFormat format = if ( exists f = chart.format ) then f else defaultFormat; | ||
|
||
// write and empty line | ||
writeLine( "" ); | ||
|
||
// write chart title, category and value titles | ||
writeLine ( | ||
"'chart':" + format.delimiter + chart.title + format.delimiter | ||
+ "'category':" + format.delimiter + chart.categoryTitle + format.delimiter | ||
+ "'value':" + format.delimiter + chart.valueTitle | ||
); | ||
|
||
// write plot titles | ||
StringBuilder builder = StringBuilder(); | ||
Integer delimSize = format.delimiter.size; | ||
for ( plot in chart.plots ) { | ||
builder.append( plot.title ); | ||
builder.append( format.delimiter ); | ||
builder.append( format.delimiter ); | ||
} | ||
variable String line = builder.string; | ||
while ( line.endsWith( format.delimiter ) ) { | ||
line = line.spanTo( line.size - delimSize - 1 ); | ||
} | ||
writeLine( line ); | ||
|
||
// write plot points | ||
if ( exists maxLines = max( {for ( plot in chart.plots ) plot.points.size} ) ) { | ||
variable Integer current = 0; | ||
while ( current < maxLines ) { | ||
builder.clear(); | ||
for ( plot in chart.plots ) { | ||
if ( exists pt = plot.points[current] ) { | ||
builder.append ( | ||
formatFloatToString ( | ||
pt.category, format.minCategoryDecimalPlaces, format.maxCategoryDecimalPlaces | ||
) | ||
); | ||
builder.append( format.delimiter ); | ||
builder.append ( | ||
formatFloatToString ( | ||
pt.val, format.minValueDecimalPlaces, format.maxValueDecimalPlaces | ||
) | ||
); | ||
builder.append( format.delimiter ); | ||
} | ||
else { | ||
builder.append( format.delimiter ); | ||
builder.append( format.delimiter ); | ||
} | ||
} | ||
line = builder.string; | ||
while ( line.endsWith( format.delimiter ) ) { | ||
line = line.spanTo( line.size - delimSize - 1 ); | ||
} | ||
writeLine( line ); | ||
current ++; | ||
} | ||
} | ||
|
||
} | ||
} | ||
|
||
|
||
"Reports charts writing line by line: | ||
* line with chart title, category title and value title | ||
* line with plot titles | ||
* lines with points for each plot | ||
Each item is separated using [[ReportFormat.delimiter]] (see [[defaultFormat]]). | ||
Numbers are reported using language [[formatFloat]] | ||
with given decimalPlaces (see [[defaultFormat]]). | ||
" | ||
by( "Lis" ) | ||
shared void reportChartByLines ( | ||
"Default format used if no format specified in chart." ReportFormat defaultFormat, | ||
"Charts to be reported." Chart[] charts, | ||
"Function used to write a line." void writeLine( String line ) | ||
) { | ||
for ( chart in charts ) { | ||
// format used for the current chart | ||
ReportFormat format = if ( exists f = chart.format ) then f else defaultFormat; | ||
|
||
// write and empty line | ||
writeLine( "" ); | ||
|
||
// write chart title, category and value titles | ||
writeLine ( | ||
"'chart':" + format.delimiter + chart.title + format.delimiter | ||
+ "'category':" + format.delimiter + chart.categoryTitle + format.delimiter | ||
+ "'value':" + format.delimiter + chart.valueTitle | ||
); | ||
|
||
// write plot titles | ||
StringBuilder builder = StringBuilder(); | ||
Integer delimSize = format.delimiter.size; | ||
for ( plot in chart.plots ) { | ||
builder.append( plot.title ); | ||
builder.append( format.delimiter ); | ||
builder.append( format.delimiter ); | ||
} | ||
variable String line = builder.string; | ||
while ( line.endsWith( format.delimiter ) ) { | ||
line = line.spanTo( line.size - delimSize - 1 ); | ||
} | ||
writeLine( line ); | ||
|
||
// write plot points | ||
if ( exists maxLines = max( {for ( plot in chart.plots ) plot.points.size} ) ) { | ||
variable Integer current = 0; | ||
while ( current < maxLines ) { | ||
builder.clear(); | ||
for ( plot in chart.plots ) { | ||
if ( exists pt = plot.points[current] ) { | ||
builder.append ( | ||
formatFloat ( | ||
pt.category, format.minCategoryDecimalPlaces, format.maxCategoryDecimalPlaces | ||
) | ||
); | ||
builder.append( format.delimiter ); | ||
builder.append ( | ||
formatFloat ( | ||
pt.val, format.minValueDecimalPlaces, format.maxValueDecimalPlaces | ||
) | ||
); | ||
builder.append( format.delimiter ); | ||
} | ||
else { | ||
builder.append( format.delimiter ); | ||
builder.append( format.delimiter ); | ||
} | ||
} | ||
line = builder.string; | ||
while ( line.endsWith( format.delimiter ) ) { | ||
line = line.spanTo( line.size - delimSize - 1 ); | ||
} | ||
writeLine( line ); | ||
current ++; | ||
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters