enh: report time series by period and quantity
This commit is contained in:
parent
b72370f154
commit
db07511c93
|
@ -699,13 +699,16 @@ int64_t metaGetTbNum(SMeta *pMeta) {
|
||||||
// N.B. Called by statusReq per second
|
// N.B. Called by statusReq per second
|
||||||
int64_t metaGetTimeSeriesNum(SMeta *pMeta) {
|
int64_t metaGetTimeSeriesNum(SMeta *pMeta) {
|
||||||
// sum of (number of columns of stable - 1) * number of ctables (excluding timestamp column)
|
// sum of (number of columns of stable - 1) * number of ctables (excluding timestamp column)
|
||||||
if (pMeta->pVnode->config.vndStats.numOfTimeSeries <= 0 ||
|
static int64_t vndNumOfCTables = 0;
|
||||||
|
int64_t numOfCTables = pMeta->pVnode->config.vndStats.numOfCTables;
|
||||||
|
if (numOfCTables - vndNumOfCTables > 100 || pMeta->pVnode->config.vndStats.numOfTimeSeries <= 0 ||
|
||||||
++pMeta->pVnode->config.vndStats.itvTimeSeries % (60 * 5) == 0) {
|
++pMeta->pVnode->config.vndStats.itvTimeSeries % (60 * 5) == 0) {
|
||||||
int64_t num = 0;
|
int64_t num = 0;
|
||||||
vnodeGetTimeSeriesNum(pMeta->pVnode, &num);
|
vnodeGetTimeSeriesNum(pMeta->pVnode, &num);
|
||||||
pMeta->pVnode->config.vndStats.numOfTimeSeries = num;
|
pMeta->pVnode->config.vndStats.numOfTimeSeries = num;
|
||||||
|
|
||||||
pMeta->pVnode->config.vndStats.itvTimeSeries = (TD_VID(pMeta->pVnode) % 100) * 2;
|
pMeta->pVnode->config.vndStats.itvTimeSeries = (TD_VID(pMeta->pVnode) % 100) * 2;
|
||||||
|
vndNumOfCTables = numOfCTables;
|
||||||
}
|
}
|
||||||
|
|
||||||
return pMeta->pVnode->config.vndStats.numOfTimeSeries + pMeta->pVnode->config.vndStats.numOfNTimeSeries;
|
return pMeta->pVnode->config.vndStats.numOfTimeSeries + pMeta->pVnode->config.vndStats.numOfNTimeSeries;
|
||||||
|
|
|
@ -545,13 +545,11 @@ int32_t vnodeGetCtbNum(SVnode *pVnode, int64_t suid, int64_t *num) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t vnodeGetStbColumnNum(SVnode *pVnode, tb_uid_t suid, int *num) {
|
static int32_t vnodeGetStbColumnNum(SVnode *pVnode, tb_uid_t suid, int *num) {
|
||||||
STSchema *pTSchema = metaGetTbTSchema(pVnode->pMeta, suid, -1, 1);
|
static int32_t vnodeGetStbColumnNum(SVnode *pVnode, tb_uid_t suid, int *num) {
|
||||||
// metaGetTbTSchemaEx(pVnode->pMeta, suid, suid, -1, &pTSchema);
|
SSchemaWrapper *pSW = metaGetTableSchema(pVnode->pMeta, suid, -1, 1);
|
||||||
|
if (pSW) {
|
||||||
if (pTSchema) {
|
*num = pSW->nCols;
|
||||||
*num = pTSchema->numOfCols;
|
tDeleteSchemaWrapper(pSW);
|
||||||
|
|
||||||
taosMemoryFree(pTSchema);
|
|
||||||
} else {
|
} else {
|
||||||
*num = 2;
|
*num = 2;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue