Hi Greg,
there was a lot of reflection is the past to decide what is the most optimal ;-)
so, at the end you have 2 possible choices for new Add-Ons :
- single-line
- multi-line
The main point here is that whatever stats you want to analyze, you can operate with numbers only.. -- the only difference with multi-line is that you need to have a kind of "name" for each line of numbers to be able to differentiate one line from another one. And as such a "name" could be anything, the VARCHAR is used to save it in the database ;-)
Now, why only a single "name" column is allowed within multi-line Add-On ?.. -- in reality having more than one brings no more flexibility (vs just one), but adding much more mess to manage it in the code ;-) -- but well, let's skip the "mess", let's look on any potential advantage then.. -- let's use your example here :
so you have: PID user cmd pcu pmem
from the list of these values I can suppose that your main goal is to analyze the PCU and PMEM usage of some commands / users .. -- but there will be very hard to consider PID (except for reporting or other) => but how ever do you see to do a research by PID ? - it'll change everytime.. -- imagine you'll have it as a "name" attribute in your multi-stat command.. -- how many PID values you'll see in the list by the end of the day? week? months ?.. -- and will at least one of them say you something ?.. ;-))
now, let's take USER and CMD.. -- will you look only on USER or only on CMD ? or mostly on both together ?.. -- I can suppose that on both.. => then why have them separated then ?.. ;-)
what I'm generally doing in this case (depending on what I want to look first) -- I'm placing them all together within a single "name", e.g. :
- CMD-USER-PID : if I'm mostly interested in CMD
- USER-CMD-PID : if I'm mostly interested in USER, and only then in CMD..
keeping in mind that user names will vary, I'm adding "_" to the name in my stat command output to keep them within the same length (say, 8 chars, and the same for CMD to keep it say within 16 chars, and PID as %7d for ex. to keep in 7 chars length, etc.) -- which will give me on my stat command kind of following output :
NAME PCU PMEM
root____-bash____________-0002345 10 32123
root____-top_____________-0002349 1 445678
dim_____-bash____________-001264 3 32100
...
so, there will be a single "name" composed of USER-CMD-PID
and once it's saved in the database, I can easily group the data by first 8 letters to get SUM/ AVG/ MAX per USER for PCU/ PMEM, or apply whatever regex criteria I need to select only bash CMD or any other, etc..
Note: this was for the case when the USER is my main point of interest..
if it'll be CMD, then I just can use CMD-USER-PID format for my "name" ;-)
well, don't know if I'm clear with this explanation, let me know if you need any more details, etc.. ;-)
Rgds,
-Dimitri