* -------------------------------------------------------------------------
* This file is part of the MindStudio project.
* Copyright (c) 2025 Huawei Technologies Co.,Ltd.
*
* MindStudio is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
*
* http://license.coscl.org.cn/MulanPSL2
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
* -------------------------------------------------------------------------
*/
#ifndef PROFILER_SERVER_MEMORYTABLEVIEW_H
#define PROFILER_SERVER_MEMORYTABLEVIEW_H
#include "StringUtil.h"
#include "CommonRequests.h"
#include "MemoryTableColum.h"
namespace Dic::Module::Memory {
const TableViewColumn TABLE_VIEW_COMPARE_COLUMN{"Source", "source", true, false, false, false};
namespace OperatorMemoryTableView {
using namespace Dic::Protocol;
constexpr int64_t DEFAULT_MAX_SIZE = std::numeric_limits<int32_t>::max();
constexpr int64_t DEFAULT_MIN_SIZE = std::numeric_limits<int32_t>::min();
inline const std::vector<TableViewColumn> FIELD_FULL_COLUMNS = {
{"ID", "id"},
{"Name", OpMemoryColumn::NAME, true, true, true, false},
{"Size(KB)", OpMemoryColumn::SIZE, true, true, false, true},
{"Allocation Time(ms)", OpMemoryColumn::ALLOCATION_TIME, true, true, false, true},
{"Release Time(ms)", OpMemoryColumn::RELEASE_TIME, true, true, false, true},
{"Active Release Time(ms)", OpMemoryColumn::ACTIVE_RELEASE_TIME, true, true, false, true},
{"Duration(ms)", OpMemoryColumn::DURATION, true, true, false, true},
{"Active Duration(ms)", OpMemoryColumn::ACTIVE_DURATION, true, true, false, true},
{"Allocation Total Allocated(MB)", OpMemoryColumn::ALLOCATION_ALLOCATED, true, true, false,
true},
{"Allocation Total Reserved(MB)", OpMemoryColumn::ALLOCATION_RESERVE, true, true, false, true},
{"Allocation Total Active(MB)", OpMemoryColumn::ALLOCATION_ACTIVE, true, true, false, true},
{"Release Total Allocated(MB)", OpMemoryColumn::RELEASE_ALLOCATED, true, true, false, true},
{"Release Total Reserved(MB)", OpMemoryColumn::RELEASE_RESERVE, true, true, false, true},
{"Release Total Active(MB)", OpMemoryColumn::RELEASE_ACTIVE, true, true, false, true},
{"Stream", OpMemoryColumn::STREAM, true, true, false, false},
{"deviceId", OpMemoryColumn::DEVICE_ID}
};
}
namespace StaticOpTableView {
inline const std::vector<TableViewColumn> FIELD_FULL_COLUMNS = {
{"Device ID", StaticOpColumn::DEVICE_ID, true, true, false, false},
{"Name", StaticOpColumn::OP_NAME, true, true, false, false},
{"Node Index Start", StaticOpColumn::NODE_INDEX_START, true, true, false, false},
{"Node Index End", StaticOpColumn::NODE_INDEX_END, true, true, false, false},
{"Size(MB)", StaticOpColumn::SIZE, true, true, false, false}};
}
}
#endif