1/* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15// @ts-ignore 16import {initMemoryAggStrategy} from "../../../../dist/trace/component/metrics/MemAggStrategy.js"; 17 18describe('MemAggStrategy Test', () => { 19 20 it('initMemoryAggStrategyTest01', () => { 21 const metricData=[{ 22 length:1, 23 processName:"name", 24 name:"oom_score_adj", 25 value:"", 26 ts:"" 27 }] 28 expect(initMemoryAggStrategy(metricData)).toBeTruthy(); 29 }); 30 31 it('initMemoryAggStrategyTest02', () => { 32 const metricData=[{ 33 length:1, 34 processName:"name", 35 name:"mem.rss.anon", 36 value:"", 37 ts:"" 38 }] 39 expect(initMemoryAggStrategy(metricData)).toBeTruthy(); 40 }); 41 42 it('initMemoryAggStrategyTest03', () => { 43 const metricData=[{ 44 length:1, 45 processName:"name", 46 name:"mem.swap", 47 value:"", 48 ts:"" 49 }] 50 expect(initMemoryAggStrategy(metricData)).toBeTruthy(); 51 }); 52 53 it('initMemoryAggStrategyTest04', () => { 54 const metricData=[{ 55 length:1, 56 processName:"name", 57 name:"mem.rss.file", 58 value:"", 59 ts:"" 60 }] 61 expect(initMemoryAggStrategy(metricData)).toBeTruthy(); 62 }); 63 64 it('initMemoryAggStrategyTest05', () => { 65 const metricData=[{ 66 length:1, 67 processName:"name", 68 name:"oom_score_adj", 69 value:"", 70 ts:"" 71 }] 72 expect(initMemoryAggStrategy(metricData)).toBeTruthy(); 73 }) 74})