Skip to content

Instantly share code, notes, and snippets.

@hunner
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hunner/3c217df9a6cc26dc823d to your computer and use it in GitHub Desktop.
Save hunner/3c217df9a6cc26dc823d to your computer and use it in GitHub Desktop.
perf testing concats
node 'agent' {
$file_count = '100'
$backend = 'concat'
$content = "test1\n"
each(range('1',$file_count)) |$file_num| {
case $backend {
'concat': {
concat { "/tmp/frag_${file_num}":
ensure => present,
}
}
'file_concat': {
file_concat { "/tmp/frag_${file_num}":
ensure => present,
tag => "frag_${file_num}",
}
}
'concat_native': {
concat_build { "test_frag_${file_num}":
target => "/tmp/frag_${file_num}",
}
}
}
$fragment_count = 1000 / $file_count
$fragment_start = $fragment_count * $file_num
$fragment_end = $fragment_start + $fragment_count - 1
each(range($fragment_start,$fragment_end)) |$fragment_num| {
case $backend {
'concat': {
concat::fragment { "test_${fragment_num}":
target => "/tmp/frag_${file_num}",
content => $content,
}
}
'file_concat': {
file_fragment { "test_${fragment_num}":
tag => "frag_${file_num}",
content => $content,
}
}
'concat_native': {
concat_fragment { "test_frag_${file_num}+test_${fragment_num}":
content => $content,
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment