Skip to content

Commit d4350ba

Browse files
committed
Rename the method
1 parent cfb27d1 commit d4350ba

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

doc/Using_OO_API.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2136,9 +2136,9 @@ If `getCounters()` is called with a counter group not supported by the implement
21362136
<a name="PerformanceCounters"></a> PerformanceCounters interface:
21372137

21382138
- unsigned getObjectCount() - returns number of objects (e.g. tables) containing non-zero performance counters
2139-
- unsigned getCountersCapacity() - returns total number of performance counters supported by the implementation (it's the same for all objects of the same type)
2139+
- unsigned getMaxCounterIndex() - returns maximum index number of the performance counters supported by the implementation (it's the same for all objects of the same group)
21402140
- unsigned getObjectId(unsigned index) - returns ID of the specified object
21412141
- const char* getObjectName(unsigned index) - returns name of the specified object
2142-
- const ISC_INT64* getObjectCounters(unsigned index) - returns pointer to the vector of performance counters (containing getCountersCapacity() elements) of the specified object
2142+
- const ISC_INT64* getObjectCounters(unsigned index) - returns pointer to the vector of performance counters (containing getMaxCounterIndex() + 1 elements) of the specified object
21432143

21442144
The returned pointer to the vector (as well as the whole instance of `PerformanceStats`) is valid until the object used to obtain the statistics (using the `getPerfStats()` method) is destroyed.

src/include/firebird/FirebirdInterface.idl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1923,7 +1923,7 @@ interface PerformanceCounters : Versioned
19231923
const uint RECORD_IMGC = 14;
19241924

19251925
uint getObjectCount();
1926-
uint getCountersCapacity();
1926+
uint getMaxCounterIndex();
19271927

19281928
uint getObjectId(uint index);
19291929
const string getObjectName(uint index);

src/include/firebird/IdlFbInterfaces.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7614,7 +7614,7 @@ namespace Firebird
76147614
struct VTable : public IVersioned::VTable
76157615
{
76167616
unsigned (CLOOP_CARG *getObjectCount)(IPerformanceCounters* self) CLOOP_NOEXCEPT;
7617-
unsigned (CLOOP_CARG *getCountersCapacity)(IPerformanceCounters* self) CLOOP_NOEXCEPT;
7617+
unsigned (CLOOP_CARG *getMaxCounterIndex)(IPerformanceCounters* self) CLOOP_NOEXCEPT;
76187618
unsigned (CLOOP_CARG *getObjectId)(IPerformanceCounters* self, unsigned index) CLOOP_NOEXCEPT;
76197619
const char* (CLOOP_CARG *getObjectName)(IPerformanceCounters* self, unsigned index) CLOOP_NOEXCEPT;
76207620
const ISC_INT64* (CLOOP_CARG *getObjectCounters)(IPerformanceCounters* self, unsigned index) CLOOP_NOEXCEPT;
@@ -7659,9 +7659,9 @@ namespace Firebird
76597659
return ret;
76607660
}
76617661

7662-
unsigned getCountersCapacity()
7662+
unsigned getMaxCounterIndex()
76637663
{
7664-
unsigned ret = static_cast<VTable*>(this->cloopVTable)->getCountersCapacity(this);
7664+
unsigned ret = static_cast<VTable*>(this->cloopVTable)->getMaxCounterIndex(this);
76657665
return ret;
76667666
}
76677667

@@ -22024,7 +22024,7 @@ namespace Firebird
2202422024
{
2202522025
this->version = Base::VERSION;
2202622026
this->getObjectCount = &Name::cloopgetObjectCountDispatcher;
22027-
this->getCountersCapacity = &Name::cloopgetCountersCapacityDispatcher;
22027+
this->getMaxCounterIndex = &Name::cloopgetMaxCounterIndexDispatcher;
2202822028
this->getObjectId = &Name::cloopgetObjectIdDispatcher;
2202922029
this->getObjectName = &Name::cloopgetObjectNameDispatcher;
2203022030
this->getObjectCounters = &Name::cloopgetObjectCountersDispatcher;
@@ -22047,11 +22047,11 @@ namespace Firebird
2204722047
}
2204822048
}
2204922049

22050-
static unsigned CLOOP_CARG cloopgetCountersCapacityDispatcher(IPerformanceCounters* self) CLOOP_NOEXCEPT
22050+
static unsigned CLOOP_CARG cloopgetMaxCounterIndexDispatcher(IPerformanceCounters* self) CLOOP_NOEXCEPT
2205122051
{
2205222052
try
2205322053
{
22054-
return static_cast<Name*>(self)->Name::getCountersCapacity();
22054+
return static_cast<Name*>(self)->Name::getMaxCounterIndex();
2205522055
}
2205622056
catch (...)
2205722057
{
@@ -22114,7 +22114,7 @@ namespace Firebird
2211422114
}
2211522115

2211622116
virtual unsigned getObjectCount() = 0;
22117-
virtual unsigned getCountersCapacity() = 0;
22117+
virtual unsigned getMaxCounterIndex() = 0;
2211822118
virtual unsigned getObjectId(unsigned index) = 0;
2211922119
virtual const char* getObjectName(unsigned index) = 0;
2212022120
virtual const ISC_INT64* getObjectCounters(unsigned index) = 0;

src/include/gen/Firebird.pas

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ ISC_TIMESTAMP_TZ_EX = record
779779
IProfilerSession_defineStatement2Ptr = procedure(this: IProfilerSession; status: IStatus; statementId: Int64; parentStatementId: Int64; type_: PAnsiChar; schemaName: PAnsiChar; packageName: PAnsiChar; routineName: PAnsiChar; sqlText: PAnsiChar); cdecl;
780780
IProfilerStats_getElapsedTicksPtr = function(this: IProfilerStats): QWord; cdecl;
781781
IPerformanceCounters_getObjectCountPtr = function(this: IPerformanceCounters): Cardinal; cdecl;
782-
IPerformanceCounters_getCountersCapacityPtr = function(this: IPerformanceCounters): Cardinal; cdecl;
782+
IPerformanceCounters_getMaxCounterIndexPtr = function(this: IPerformanceCounters): Cardinal; cdecl;
783783
IPerformanceCounters_getObjectIdPtr = function(this: IPerformanceCounters; index: Cardinal): Cardinal; cdecl;
784784
IPerformanceCounters_getObjectNamePtr = function(this: IPerformanceCounters; index: Cardinal): PAnsiChar; cdecl;
785785
IPerformanceCounters_getObjectCountersPtr = function(this: IPerformanceCounters; index: Cardinal): Int64Ptr; cdecl;
@@ -4063,7 +4063,7 @@ IProfilerStatsImpl = class(IProfilerStats)
40634063

40644064
PerformanceCountersVTable = class(VersionedVTable)
40654065
getObjectCount: IPerformanceCounters_getObjectCountPtr;
4066-
getCountersCapacity: IPerformanceCounters_getCountersCapacityPtr;
4066+
getMaxCounterIndex: IPerformanceCounters_getMaxCounterIndexPtr;
40674067
getObjectId: IPerformanceCounters_getObjectIdPtr;
40684068
getObjectName: IPerformanceCounters_getObjectNamePtr;
40694069
getObjectCounters: IPerformanceCounters_getObjectCountersPtr;
@@ -4092,7 +4092,7 @@ IPerformanceCounters = class(IVersioned)
40924092
const RECORD_IMGC = Cardinal(14);
40934093

40944094
function getObjectCount(): Cardinal;
4095-
function getCountersCapacity(): Cardinal;
4095+
function getMaxCounterIndex(): Cardinal;
40964096
function getObjectId(index: Cardinal): Cardinal;
40974097
function getObjectName(index: Cardinal): PAnsiChar;
40984098
function getObjectCounters(index: Cardinal): Int64Ptr;
@@ -4102,7 +4102,7 @@ IPerformanceCountersImpl = class(IPerformanceCounters)
41024102
constructor create;
41034103

41044104
function getObjectCount(): Cardinal; virtual; abstract;
4105-
function getCountersCapacity(): Cardinal; virtual; abstract;
4105+
function getMaxCounterIndex(): Cardinal; virtual; abstract;
41064106
function getObjectId(index: Cardinal): Cardinal; virtual; abstract;
41074107
function getObjectName(index: Cardinal): PAnsiChar; virtual; abstract;
41084108
function getObjectCounters(index: Cardinal): Int64Ptr; virtual; abstract;
@@ -10221,9 +10221,9 @@ function IPerformanceCounters.getObjectCount(): Cardinal;
1022110221
Result := PerformanceCountersVTable(vTable).getObjectCount(Self);
1022210222
end;
1022310223

10224-
function IPerformanceCounters.getCountersCapacity(): Cardinal;
10224+
function IPerformanceCounters.getMaxCounterIndex(): Cardinal;
1022510225
begin
10226-
Result := PerformanceCountersVTable(vTable).getCountersCapacity(Self);
10226+
Result := PerformanceCountersVTable(vTable).getMaxCounterIndex(Self);
1022710227
end;
1022810228

1022910229
function IPerformanceCounters.getObjectId(index: Cardinal): Cardinal;
@@ -17840,11 +17840,11 @@ function IPerformanceCountersImpl_getObjectCountDispatcher(this: IPerformanceCou
1784017840
end
1784117841
end;
1784217842

17843-
function IPerformanceCountersImpl_getCountersCapacityDispatcher(this: IPerformanceCounters): Cardinal; cdecl;
17843+
function IPerformanceCountersImpl_getMaxCounterIndexDispatcher(this: IPerformanceCounters): Cardinal; cdecl;
1784417844
begin
1784517845
Result := 0;
1784617846
try
17847-
Result := IPerformanceCountersImpl(this).getCountersCapacity();
17847+
Result := IPerformanceCountersImpl(this).getMaxCounterIndex();
1784817848
except
1784917849
on e: Exception do FbException.catchException(nil, e);
1785017850
end
@@ -18994,7 +18994,7 @@ initialization
1899418994
IPerformanceCountersImpl_vTable := PerformanceCountersVTable.create;
1899518995
IPerformanceCountersImpl_vTable.version := 2;
1899618996
IPerformanceCountersImpl_vTable.getObjectCount := @IPerformanceCountersImpl_getObjectCountDispatcher;
18997-
IPerformanceCountersImpl_vTable.getCountersCapacity := @IPerformanceCountersImpl_getCountersCapacityDispatcher;
18997+
IPerformanceCountersImpl_vTable.getMaxCounterIndex := @IPerformanceCountersImpl_getMaxCounterIndexDispatcher;
1899818998
IPerformanceCountersImpl_vTable.getObjectId := @IPerformanceCountersImpl_getObjectIdDispatcher;
1899918999
IPerformanceCountersImpl_vTable.getObjectName := @IPerformanceCountersImpl_getObjectNameDispatcher;
1900019000
IPerformanceCountersImpl_vTable.getObjectCounters := @IPerformanceCountersImpl_getObjectCountersDispatcher;

src/jrd/trace/TraceObjects.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ class TraceRuntimeStats :
124124
return m_counts ? m_counts->getCount() : 0;
125125
}
126126

127-
unsigned getCountersCapacity()
127+
unsigned getMaxCounterIndex()
128128
{
129-
return T::getVectorCapacity();
129+
return T::getVectorCapacity() - 1;
130130
}
131131

132132
unsigned getObjectId(unsigned index)

0 commit comments

Comments
 (0)