How to use the mem.memused.percent function in mem

To help you get started, we’ve selected a few mem examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github domeos / server / front / src / monitor / js / monitor.js View on Github external
chartData: self.getAmchartConfig('网络流出(KB/s)', formartFlowArr(monitorItem, currentCounterData, 'KB'), 'KB/s'),
							tableData: tableData
						};
					}

				});
			}
			// 主机/容器/实例: 内存使用率数据
			if (monitorResult.counterResults['mem.memused.percent'] || monitorResult.counterResults['container.mem.usage.percent']) {
				tableData = {
					head: [],
					item: [],
					body: []
				};
				var usedPercetData, usedTotalData, usedData;
				if (monitorResult.counterResults['mem.memused.percent']) {
					usedPercetData = monitorResult.counterResults['mem.memused.percent'];
					usedTotalData = monitorResult.counterResults['mem.memtotal'];
					usedData = monitorResult.counterResults['mem.memused'];
				} else {
					usedPercetData = monitorResult.counterResults['container.mem.usage.percent'];
					usedTotalData = monitorResult.counterResults['container.mem.limit'];
					usedData = monitorResult.counterResults['container.mem.usage'];
				}

				if (singleItemName !== undefined) {
					if (monitorResult.counterResults['mem.memused.percent']) {
						tableData.head = [tableKeyName, '内存占用量(MB)', '内存总量(MB)', '内存占用率'];
					} else {
						tableData.head = [tableKeyName, '内存占用量(MB)', '内存限额(MB)', '内存占用率'];
					}
					tableData.item = ['key', 'memused', 'memtotal', 'mempercent'];
github domeos / server / front / src / monitor / js / monitor.js View on Github external
tableData: tableData
						};
					}

				});
			}
			// 主机/容器/实例: 内存使用率数据
			if (monitorResult.counterResults['mem.memused.percent'] || monitorResult.counterResults['container.mem.usage.percent']) {
				tableData = {
					head: [],
					item: [],
					body: []
				};
				var usedPercetData, usedTotalData, usedData;
				if (monitorResult.counterResults['mem.memused.percent']) {
					usedPercetData = monitorResult.counterResults['mem.memused.percent'];
					usedTotalData = monitorResult.counterResults['mem.memtotal'];
					usedData = monitorResult.counterResults['mem.memused'];
				} else {
					usedPercetData = monitorResult.counterResults['container.mem.usage.percent'];
					usedTotalData = monitorResult.counterResults['container.mem.limit'];
					usedData = monitorResult.counterResults['container.mem.usage'];
				}

				if (singleItemName !== undefined) {
					if (monitorResult.counterResults['mem.memused.percent']) {
						tableData.head = [tableKeyName, '内存占用量(MB)', '内存总量(MB)', '内存占用率'];
					} else {
						tableData.head = [tableKeyName, '内存占用量(MB)', '内存限额(MB)', '内存占用率'];
					}
					tableData.item = ['key', 'memused', 'memtotal', 'mempercent'];
github domeos / server / front / src / monitor / js / monitor.js View on Github external
_monitorCountResult.netIn = {
							chartData: self.getAmchartConfig('网络流入(KB/s)', formartFlowArr(monitorItem, currentCounterData, 'KB'), 'KB/s'),
							tableData: tableData
						};

					} else {
						_monitorCountResult.netOut = {
							chartData: self.getAmchartConfig('网络流出(KB/s)', formartFlowArr(monitorItem, currentCounterData, 'KB'), 'KB/s'),
							tableData: tableData
						};
					}

				});
			}
			// 主机/容器/实例: 内存使用率数据
			if (monitorResult.counterResults['mem.memused.percent'] || monitorResult.counterResults['container.mem.usage.percent']) {
				tableData = {
					head: [],
					item: [],
					body: []
				};
				var usedPercetData, usedTotalData, usedData;
				if (monitorResult.counterResults['mem.memused.percent']) {
					usedPercetData = monitorResult.counterResults['mem.memused.percent'];
					usedTotalData = monitorResult.counterResults['mem.memtotal'];
					usedData = monitorResult.counterResults['mem.memused'];
				} else {
					usedPercetData = monitorResult.counterResults['container.mem.usage.percent'];
					usedTotalData = monitorResult.counterResults['container.mem.limit'];
					usedData = monitorResult.counterResults['container.mem.usage'];
				}
github domeos / server / DomeOS / front / dist / index / js / services / monitorService.js View on Github external
}
                });
                if (unit !== undefined) {
                    angular.forEach(monitorItemData, function(data) {
                        if (unit == '%') {
                            data[countName] = toDecimal(data[countName], 2);
                        } else {
                            data[countName] = formartBytesData(data[countName], unit);
                        }
                    });
                }
            }

            if (monitorType == 'node') {
                cpuBusy = monitorData.counterResults['cpu.busy'].slice(-3, -2)[0];
                memPercet = monitorData.counterResults['mem.memused.percent'].slice(-3, -2)[0];
                collectMonitorInfo = {
                    diskUsedMap: {},
                    diskReadMap: {},
                    diskWriteMap: {},
                    netInMap: {},
                    netOutMap: {}
                };

                for (i = 0; i < monitorItems.length; i++) {
                    monitorItemData[monitorItems[i]] = {
                        diskUsedData: [],
                        diskUsedCount: 0,
                        diskReadData: [],
                        diskReadCount: 0,
                        diskWriteData: [],
                        diskWriteCount: 0,
github domeos / server / front / src / index / js / services / monitorService.js View on Github external
}
                    });
                    if (typeof unit !== 'undefined') {
                        angular.forEach(monitorItemData, function (data) {
                            if (unit == '%') {
                                data[countName] = toDecimal(data[countName], 2);
                            } else {
                                data[countName] = formartBytesData(data[countName], unit);
                            }
                        });
                    }
                }

                if (monitorType == 'node') {
                    cpuBusy = monitorData.counterResults['cpu.busy'].slice(-3, -2)[0];
                    memPercet = monitorData.counterResults['mem.memused.percent'].slice(-3, -2)[0];
                    collectMonitorInfo = {
                        diskUsedMap: {},
                        diskReadMap: {},
                        diskWriteMap: {},
                        netInMap: {},
                        netOutMap: {}
                    };

                    for (i = 0, l = monitorItems.length; i < l; i++) {
                        monitorItemData[monitorItems[i]] = {
                            diskUsedData: [],
                            diskUsedCount: 0,
                            diskReadData: [],
                            diskReadCount: 0,
                            diskWriteData: [],
                            diskWriteCount: 0,
github domeos / server / front / src / monitor / js / monitor.js View on Github external
item: [],
					body: []
				};
				var usedPercetData, usedTotalData, usedData;
				if (monitorResult.counterResults['mem.memused.percent']) {
					usedPercetData = monitorResult.counterResults['mem.memused.percent'];
					usedTotalData = monitorResult.counterResults['mem.memtotal'];
					usedData = monitorResult.counterResults['mem.memused'];
				} else {
					usedPercetData = monitorResult.counterResults['container.mem.usage.percent'];
					usedTotalData = monitorResult.counterResults['container.mem.limit'];
					usedData = monitorResult.counterResults['container.mem.usage'];
				}

				if (singleItemName !== undefined) {
					if (monitorResult.counterResults['mem.memused.percent']) {
						tableData.head = [tableKeyName, '内存占用量(MB)', '内存总量(MB)', '内存占用率'];
					} else {
						tableData.head = [tableKeyName, '内存占用量(MB)', '内存限额(MB)', '内存占用率'];
					}
					tableData.item = ['key', 'memused', 'memtotal', 'mempercent'];

					if (isShowCountTable) {
						counterCountResults = {
							memused: getCounterCountResult(usedData, 'MB', singleItemName),
							memtotal: getCounterCountResult(usedTotalData, 'MB', singleItemName),
							mempercent: getCounterCountResult(usedPercetData, '%', singleItemName)
						};
						tableData.body = getCounterCountTable(tableData.item, counterCountResults);
					} else {
						startIndex = getHasDataLastIndex(usedPercetData, singleItemName);
						if (startIndex !== -1) {

mem

Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input

MIT
Latest version published 1 year ago

Package Health Score

61 / 100
Full package analysis