ResultSet size (in KB)

  • Thread starter Thread starter yonip
  • Start date Start date
Y

yonip

In my DB layer, I have a monitoring tool. This tool logs every access
to the database, and writes out the SQL and the time it takes to get
the results.
I want to add another important figure: the size of the result. It's
obvious that an answer of one single integer is completely different
from a dataset of thousends of rows with several columns.
So far, I only found the "RowSize" attribute of OracleCommand, which
is not enough for my need.
Any idead how to obtain this data ?
 
Serialize it to a memorystream, and check the length.

Do note however that this would be how much kb is occupied in the memory by
the dataset.

If you really want the exact # of bytes transferred between SQL Server and
your ado.net machine, then you might need to look into perf. counters.

- Sahil Malik
http://codebetter.com/blogs/sahil.malik/



yonip said:
In my DB layer, I have a monitoring tool. This tool logs every access
to the database, and writes out the SQL and the time it takes to get
the results.
I want to add another important figure: the size of the result. It's
obvious that an answer of one single integer is completely different
from a dataset of thousends of rows with several columns.
So far, I only found the "RowSize" attribute of OracleCommand, which
is not enough for my need.
Any idead how to obtain this data ?
 
Hi,

I have the need to also write some monitoring tool that needs to logs every
read/write on the DB. But I have no idea how to start. Is there any pattern
or model that you followed?

Thanks a lot.

Francois


yonip said:
In my DB layer, I have a monitoring tool. This tool logs every access
to the database, and writes out the SQL and the time it takes to get
the results.
I want to add another important figure: the size of the result. It's
obvious that an answer of one single integer is completely different
from a dataset of thousends of rows with several columns.
So far, I only found the "RowSize" attribute of OracleCommand, which
is not enough for my need.
Any idead how to obtain this data ?
 
Back
Top