home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 2
Plugin Development
SQLiteDatabase Plugin for MP2
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="MJGraf" data-source="post: 1028479" data-attributes="member: 17886"><p>I'm sitting here in front of my laptop and have to admit that I'm a little bit stuck with how to proceed.</p><p>We have first test results, but we don't know whether these results really reflect what we want to measure...</p><p>I could imagine to improve the logging in two ways:</p><ul> <li data-xf-list-type="ul">Currently we use a wrapper around the DBCommand to generate our SQLDebug.log. The issue is that this wrapper, when used for reading, returns an IDBReader and it may be possible that the actual reading from disk into RAM happens when the IDBReader is used. When we want to implement further low lever logging, we could hook into SQLiteDatabase.ReadDBValue(Type type, IDataReader reader, int colIndex), which is called every time when we get a single field value from the database. But do we know whether this is really the point in time, when we read from disk? Typically, the IDataReader would be used in a loop like "while (MyDataReader.Read()) { Read the field values... }". So what we usually do is by calling "Read()" we loop through all the rows in our result. Maybe this is the point in time when the data is actually read from disk? We don't really know - but what I know is that we don't have a single point of access to the Read() method. This means that if we want to log how long a call to Read() takes, we would have to implement a wrapper around SQLiteDataReader, which measures the time all the calls to itself take and logs this somewhere. But although the IDBReader interface looks simple, there are a lot of public methods in SQLiteDataReader not contained in the Interface, which we would have to implement. So this is more of a long term task....</li> <li data-xf-list-type="ul">The second idea would be to hook in a little higher in the system - but I don't know where... Of course I could do this in my synthetic tests - just measure how long the call to MediaLibrary.Search(miq, false) takes. But where would be the right hook for queries generated by using the MP2 Client frontend (such as Read Test 3 and Read Test 4)? Is there a single entry point on the MP2 Server Side which is used when the MP2 Client queries for Media Items? I think it should be somewhere in the client communication, but I have no clue about uPnP and don't know where to look at. Can anyone give me a hint? .....</li> </ul><p>...wait, while I'm writing this, I realize that I'm stupid <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue :p" loading="lazy" data-shortname=":p" /> We could just hook into MediaLibrary.Search - which I suppose is used to perform a search in the MediaLibrary also in case the search is initiated by an MP2 client and which returns a list of MediaItems. So if we measure the time this method call takes, we know exactly how long it takes until we have the desired list of MediaItem objects in RAM - including reading all the values such as the covers. The only disadvantage we have is that this is also not exactly the time our database needs, it includes the time to build our MediaItem objects in RAM, but compared to the actual reading from disk, this should be negligible...</p><p></p><p>Will try and report back!</p></blockquote><p></p>
[QUOTE="MJGraf, post: 1028479, member: 17886"] I'm sitting here in front of my laptop and have to admit that I'm a little bit stuck with how to proceed. We have first test results, but we don't know whether these results really reflect what we want to measure... I could imagine to improve the logging in two ways: [LIST] [*]Currently we use a wrapper around the DBCommand to generate our SQLDebug.log. The issue is that this wrapper, when used for reading, returns an IDBReader and it may be possible that the actual reading from disk into RAM happens when the IDBReader is used. When we want to implement further low lever logging, we could hook into SQLiteDatabase.ReadDBValue(Type type, IDataReader reader, int colIndex), which is called every time when we get a single field value from the database. But do we know whether this is really the point in time, when we read from disk? Typically, the IDataReader would be used in a loop like "while (MyDataReader.Read()) { Read the field values... }". So what we usually do is by calling "Read()" we loop through all the rows in our result. Maybe this is the point in time when the data is actually read from disk? We don't really know - but what I know is that we don't have a single point of access to the Read() method. This means that if we want to log how long a call to Read() takes, we would have to implement a wrapper around SQLiteDataReader, which measures the time all the calls to itself take and logs this somewhere. But although the IDBReader interface looks simple, there are a lot of public methods in SQLiteDataReader not contained in the Interface, which we would have to implement. So this is more of a long term task.... [*]The second idea would be to hook in a little higher in the system - but I don't know where... Of course I could do this in my synthetic tests - just measure how long the call to MediaLibrary.Search(miq, false) takes. But where would be the right hook for queries generated by using the MP2 Client frontend (such as Read Test 3 and Read Test 4)? Is there a single entry point on the MP2 Server Side which is used when the MP2 Client queries for Media Items? I think it should be somewhere in the client communication, but I have no clue about uPnP and don't know where to look at. Can anyone give me a hint? ..... [/LIST] ...wait, while I'm writing this, I realize that I'm stupid :p We could just hook into MediaLibrary.Search - which I suppose is used to perform a search in the MediaLibrary also in case the search is initiated by an MP2 client and which returns a list of MediaItems. So if we measure the time this method call takes, we know exactly how long it takes until we have the desired list of MediaItem objects in RAM - including reading all the values such as the covers. The only disadvantage we have is that this is also not exactly the time our database needs, it includes the time to build our MediaItem objects in RAM, but compared to the actual reading from disk, this should be negligible... Will try and report back! [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Plugin Development
SQLiteDatabase Plugin for MP2
Contact us
RSS
Top
Bottom