Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Merging files, 1 line for every 10

by CountZero (Bishop)
on Sep 06, 2011 at 21:27 UTC ( #924469=note: print w/ replies, xml ) Need Help??


in reply to Merging files, 1 line for every 10

What a very strange concept. I can see no real practical use for such a thing.

Homework?

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James


Comment on Re: Merging files, 1 line for every 10
Re^2: Merging files, 1 line for every 10
by Luxin (Initiate) on Sep 07, 2011 at 13:27 UTC
    LOL - No, not homework. I am performance testing a system that uses multiple data repositories. In Production, about 10% of requests get serviced by system A, and 90% get serviced by system B. To properly mimic production I need to load test the system with similar requests, hence the 10/90 split.
      OK. But doing a "1 line from file A followed by 9 lines from file B", you are actually handling a degenerate case where all requests are artificially spaced in an even way. Wouldn't it be more "real" to randomly determine from which file to read the next request:
      if (int(rand(10) = 0)) { # read from file A } else { # read from file B }

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://924469]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2014-07-29 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (225 votes), past polls