create static method
MemoryData
create({
- bool schemeUtilsIsSetDefaultData = false,
- String special_type = "memoryData",
- num? mem_total,
- num? mem_free,
- num? mem_available,
- num? buffers,
- num? cached,
- num? swap_cached,
- num? active,
- num? inactive,
- num? active_anon,
- num? inactive_anon,
- num? active_file,
- num? inactive_file,
- num? unevictable,
- num? mlocked,
- num? swap_total,
- num? swap_free,
- num? zswap,
- num? zswapped,
- num? dirty,
- num? writeback,
- num? anon_pages,
- num? mapped,
- num? shmem,
- num? k_reclaimable,
- num? slab,
- num? s_reclaimable,
- num? s_unreclaim,
- num? kernel_stack,
- num? page_tables,
- num? sec_page_tables,
- num? n_f_s_unstable,
- num? bounce,
- num? writeback_tmp,
- num? commit_limit,
- num? committed_a_s,
- num? vmalloc_total,
- num? vmalloc_used,
- num? vmalloc_chunk,
- num? percpu,
- num? hardware_corrupted,
- num? anon_huge_pages,
- num? shmem_huge_pages,
- num? shmem_pmd_mapped,
- num? file_huge_pages,
- num? file_pmd_mapped,
- num? unaccepted,
- num? huge_pages_total,
- num? huge_pages_free,
- num? huge_pages_rsvd,
- num? huge_pages_surp,
- num? hugepagesize,
- num? hugetlb,
- num? direct_map4k,
- num? direct_map2_m,
- num? direct_map1_g,
override
return original data json
Implementation
static MemoryData create({
bool schemeUtilsIsSetDefaultData = false,
String special_type = "memoryData",
num? mem_total,
num? mem_free,
num? mem_available,
num? buffers,
num? cached,
num? swap_cached,
num? active,
num? inactive,
num? active_anon,
num? inactive_anon,
num? active_file,
num? inactive_file,
num? unevictable,
num? mlocked,
num? swap_total,
num? swap_free,
num? zswap,
num? zswapped,
num? dirty,
num? writeback,
num? anon_pages,
num? mapped,
num? shmem,
num? k_reclaimable,
num? slab,
num? s_reclaimable,
num? s_unreclaim,
num? kernel_stack,
num? page_tables,
num? sec_page_tables,
num? n_f_s_unstable,
num? bounce,
num? writeback_tmp,
num? commit_limit,
num? committed_a_s,
num? vmalloc_total,
num? vmalloc_used,
num? vmalloc_chunk,
num? percpu,
num? hardware_corrupted,
num? anon_huge_pages,
num? shmem_huge_pages,
num? shmem_pmd_mapped,
num? file_huge_pages,
num? file_pmd_mapped,
num? unaccepted,
num? huge_pages_total,
num? huge_pages_free,
num? huge_pages_rsvd,
num? huge_pages_surp,
num? hugepagesize,
num? hugetlb,
num? direct_map4k,
num? direct_map2_m,
num? direct_map1_g,
}) {
// MemoryData memoryData = MemoryData({
final Map memoryData_data_create_json = {
"@type": special_type,
"mem_total": mem_total,
"mem_free": mem_free,
"mem_available": mem_available,
"buffers": buffers,
"cached": cached,
"swap_cached": swap_cached,
"active": active,
"inactive": inactive,
"active_anon": active_anon,
"inactive_anon": inactive_anon,
"active_file": active_file,
"inactive_file": inactive_file,
"unevictable": unevictable,
"mlocked": mlocked,
"swap_total": swap_total,
"swap_free": swap_free,
"zswap": zswap,
"zswapped": zswapped,
"dirty": dirty,
"writeback": writeback,
"anon_pages": anon_pages,
"mapped": mapped,
"shmem": shmem,
"k_reclaimable": k_reclaimable,
"slab": slab,
"s_reclaimable": s_reclaimable,
"s_unreclaim": s_unreclaim,
"kernel_stack": kernel_stack,
"page_tables": page_tables,
"sec_page_tables": sec_page_tables,
"n_f_s_unstable": n_f_s_unstable,
"bounce": bounce,
"writeback_tmp": writeback_tmp,
"commit_limit": commit_limit,
"committed_a_s": committed_a_s,
"vmalloc_total": vmalloc_total,
"vmalloc_used": vmalloc_used,
"vmalloc_chunk": vmalloc_chunk,
"percpu": percpu,
"hardware_corrupted": hardware_corrupted,
"anon_huge_pages": anon_huge_pages,
"shmem_huge_pages": shmem_huge_pages,
"shmem_pmd_mapped": shmem_pmd_mapped,
"file_huge_pages": file_huge_pages,
"file_pmd_mapped": file_pmd_mapped,
"unaccepted": unaccepted,
"huge_pages_total": huge_pages_total,
"huge_pages_free": huge_pages_free,
"huge_pages_rsvd": huge_pages_rsvd,
"huge_pages_surp": huge_pages_surp,
"hugepagesize": hugepagesize,
"hugetlb": hugetlb,
"direct_map4k": direct_map4k,
"direct_map2_m": direct_map2_m,
"direct_map1_g": direct_map1_g,
};
memoryData_data_create_json.removeWhere((key, value) => value == null);
if (schemeUtilsIsSetDefaultData) {
defaultData.forEach((key, value) {
if (memoryData_data_create_json.containsKey(key) == false) {
memoryData_data_create_json[key] = value;
}
});
}
return MemoryData(memoryData_data_create_json);
}