-
-
Notifications
You must be signed in to change notification settings - Fork 268
Per pagespace I/O statistics and new trace API interfaces to allow extendable statistics #8808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
9304339
e0817d0
45ec316
089060f
cfb27d1
d4350ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1364,6 +1364,9 @@ interface TraceTransaction : Versioned | |
| version: // 3.0.4 -> 3.0.5 | ||
| int64 getInitialID(); | ||
| int64 getPreviousID(); | ||
|
|
||
| version: // 5.0 -> 6.0 | ||
| PerformanceStats getPerfStats(); | ||
| } | ||
|
|
||
| interface TraceParams : Versioned | ||
|
|
@@ -1379,6 +1382,9 @@ interface TraceStatement : Versioned | |
| { | ||
| int64 getStmtID(); | ||
| PerformanceInfo* getPerf(); | ||
|
|
||
| version: // 5.0 -> 6.0 | ||
| PerformanceStats getPerfStats(); | ||
| } | ||
|
|
||
| interface TraceSQLStatement : TraceStatement | ||
|
|
@@ -1421,6 +1427,9 @@ version: // 4.0 -> 5.0 | |
| int64 getStmtID(); | ||
| const string getPlan(); | ||
| const string getExplainedPlan(); | ||
|
|
||
| version: // 5.0 -> 6.0 | ||
| PerformanceStats getPerfStats(); | ||
| } | ||
|
|
||
| interface TraceFunction : Versioned | ||
|
|
@@ -1434,6 +1443,9 @@ version: // 4.0 -> 5.0 | |
| int64 getStmtID(); | ||
| const string getPlan(); | ||
| const string getExplainedPlan(); | ||
|
|
||
| version: // 5.0 -> 6.0 | ||
| PerformanceStats getPerfStats(); | ||
| } | ||
|
|
||
| interface TraceTrigger : Versioned | ||
|
|
@@ -1456,6 +1468,9 @@ version: // 4.0 -> 5.0 | |
| int64 getStmtID(); | ||
| const string getPlan(); | ||
| const string getExplainedPlan(); | ||
|
|
||
| version: // 5.0 -> 6.0 | ||
| PerformanceStats getPerfStats(); | ||
| } | ||
|
|
||
| interface TraceServiceConnection : TraceConnection | ||
|
|
@@ -1480,6 +1495,9 @@ interface TraceSweepInfo : Versioned | |
| int64 getOAT(); | ||
| int64 getNext(); | ||
| PerformanceInfo* getPerf(); | ||
|
|
||
| version: // 5.0 -> 6.0 | ||
| PerformanceStats getPerfStats(); | ||
| } | ||
|
|
||
| interface TraceLogWriter : ReferenceCounted | ||
|
|
@@ -1876,3 +1894,26 @@ interface ProfilerStats : Versioned | |
| { | ||
| uint64 getElapsedTicks(); | ||
| } | ||
|
|
||
| // Extendable replacement for struct PerformanceInfo | ||
|
|
||
| interface PerformanceCounters : Versioned | ||
| { | ||
| uint getCount(); | ||
| uint getVectorCapacity(); | ||
|
|
||
| uint getId(uint index); | ||
| const string getName(uint index); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ID and name of... what?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Object (table, tablespace, whatever) counters belong to. Would you suggest
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I just wonder what these methods shall return for Global and Page counters.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nothing (zero) for global, valid id/name otherwise.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps, it could be useful to return hardcoded "Global" and "Pages" in these cases...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, please. Now it is confusing as could be read as
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thinking twice, I suppose |
||
| const int64* getCounterVector(uint index); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TTL of returned value is...?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It corresponds to the object TTL.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well... Returning of a plain array is simple and effective, but doesn't quite fit the ideology of OO API. How about returning of another object with methods
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Valid point that I don't have a strong opinion about. Given the performance stats being somewhat low-level thing, I tried to follow the old-style interface with struct and counter vector, just made it extendable for new counter groups. Also, when we add new counters into the engine they automatically become available in the API, even being undocumented as enum members they're still usable without the need to recompile your trace plugin. With the pure OO approach the trace plugin should be recompiled to utilize new interface methods (and they should be added every time we add new counters). @AlexPeshkoff @hvlad @asfernandes What do you think about this?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not think that adding separate method for each counter is good idea. An additional argument not to follow OO rules too strict here is that calling virtual function once and working with array elements after it should be faster than calling N virtual functions.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
How do a v7 caller of this interface can know the returned array from a v6 implementation does not have its expected items?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Looks like you missed the whole thing or are insisting on bad things 20 years later. Virtual functions has no standard ABI layout between different compilers.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You are dead wrong.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
+1
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If you want to access 9th counter, but |
||
| } | ||
|
|
||
| interface PerformanceStats : Versioned | ||
| { | ||
| uint64 getElapsedTime(); // in milliseconds | ||
| uint64 getFetchedRecords(); | ||
|
|
||
| PerformanceCounters getGlobalCounters(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you claim expandability, this must be one function with enum parameter:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can easily add more functions to extend the interface. But I may agree a single function would be simpler. |
||
| PerformanceCounters getPageCounters(); | ||
| PerformanceCounters getRelationCounters(); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What it purpose of this method ? Why
getCount()is not enough ?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getCount()returns a number of objects (tables, tablespaces, etc), each of them has a vector ofgetVectorCapacity()counters.getVectorCapacity()is intended to ensure compatibility without interface versioning -- you can easily check whether the engine supports the counter you'd like to access.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose
getObjectCount()would suit better here, given we discussgetObjectId() / getObjectName().There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest
maxCounterbecause it is count of counters, not objects, and it is constant for every object/counter's set.