feat: show progress and remain time for compact task
This commit is contained in:
parent
cafa960db8
commit
7c0d150708
|
@ -397,6 +397,8 @@ static const SSysDbTableSchema userCompactsDetailSchema[] = {
|
|||
{.name = "number_fileset", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false},
|
||||
{.name = "finished", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false},
|
||||
{.name = "start_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = false},
|
||||
{.name = "progress(%)", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false},
|
||||
{.name = "remain_time(s)", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT, .sysInfo = false},
|
||||
};
|
||||
|
||||
static const SSysDbTableSchema anodesSchema[] = {
|
||||
|
|
|
@ -90,6 +90,16 @@ int32_t mndRetrieveCompactDetail(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
|
|||
TAOS_CHECK_RETURN_WITH_RELEASE(colDataSetVal(pColInfo, numOfRows, (const char *)&pCompactDetail->startTime, false),
|
||||
pSdb, pCompactDetail);
|
||||
|
||||
int32_t percentage = 0;
|
||||
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
|
||||
TAOS_CHECK_RETURN_WITH_RELEASE(colDataSetVal(pColInfo, numOfRows, (const char *)&percentage, false), pSdb,
|
||||
pCompactDetail);
|
||||
|
||||
int64_t remainTime = 0;
|
||||
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
|
||||
TAOS_CHECK_RETURN_WITH_RELEASE(colDataSetVal(pColInfo, numOfRows, (const char *)&remainTime, false), pSdb,
|
||||
pCompactDetail);
|
||||
|
||||
numOfRows++;
|
||||
sdbRelease(pSdb, pCompactDetail);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue