github.com/pyroscope-io/pyroscope@v0.37.3-0.20230725203016-5f6947968bd0/webapp/javascript/pages/exemplars/filterNonCpu.spec.ts (about)

     1  import { filterNonCPU } from './filterNonCPU';
     2  
     3  describe('filterNonCPU', function () {
     4    describe('an app with cpu suffix is provided', function () {
     5      it('should be allowed', function () {
     6        expect(filterNonCPU('myapp.cpu')).toBe(true);
     7      });
     8    });
     9  
    10    describe('when an unidentified suffix is available', function () {
    11      it('should be allowed', function () {
    12        expect(filterNonCPU('myapp.weirdsuffix')).toBe(true);
    13      });
    14    });
    15  
    16    describe('an app with any other supported suffix is provided', function () {
    17      it.each`
    18        name                                 | expected
    19        ${'myapp.alloc_objects'}             | ${false}
    20        ${'myapp.alloc_space'}               | ${false}
    21        ${'myapp.goroutines'}                | ${false}
    22        ${'myapp.inuse_objects'}             | ${false}
    23        ${'myapp.inuse_space'}               | ${false}
    24        ${'myapp.mutex_count'}               | ${false}
    25        ${'myapp.alloc_in_new_tlab_bytes '}  | ${false}
    26        ${'myapp.alloc_in_new_tlab_objects'} | ${false}
    27        ${'myapp.lock_count'}                | ${false}
    28        ${'myapp.lock_duration'}             | ${false}
    29      `('filterNonCPU($appName) -> $expected', ({ name, expected }) => {
    30        expect(filterNonCPU(name)).toBe(expected);
    31      });
    32    });
    33  });